fixed some bugs. Testing time!
This commit is contained in:
@@ -49,10 +49,12 @@ import kotlin.reflect.full.declaredMemberProperties
|
|||||||
|
|
||||||
// TODO: (future additions)
|
// TODO: (future additions)
|
||||||
// Allowing the use of regular Minecraft particles instead of just BDEs.
|
// Allowing the use of regular Minecraft particles instead of just BDEs.
|
||||||
|
// Will basically require a whole new system.
|
||||||
|
// Most likely wont ever happen.
|
||||||
// Cylinder and cone force field shape.
|
// Cylinder and cone force field shape.
|
||||||
// Copying particle params in-game
|
// Copying particle params in-game.
|
||||||
// Custom curve equation command args (parse from strings)
|
// Custom curve equation command args (parse from strings).
|
||||||
// force field "config" option
|
// force field "config" option.
|
||||||
|
|
||||||
|
|
||||||
var ALL_PARTICLE_EMITTERS: Array<ParticleEmitter> = emptyArray()
|
var ALL_PARTICLE_EMITTERS: Array<ParticleEmitter> = emptyArray()
|
||||||
|
|||||||
@@ -49,11 +49,13 @@ class DisplayEntity(private var properties: DisplayEntityProperties?) {
|
|||||||
|
|
||||||
put("Tags", tagList)
|
put("Tags", tagList)
|
||||||
|
|
||||||
|
if (modelName != "none") {
|
||||||
put("item", NbtCompound().apply {
|
put("item", NbtCompound().apply {
|
||||||
putString("id", modelName)
|
putString("id", modelName)
|
||||||
putInt("count", 1)
|
putInt("count", 1)
|
||||||
put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", customModelNum) })
|
put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", customModelNum) })
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
put("transformation", NbtCompound().apply {
|
put("transformation", NbtCompound().apply {
|
||||||
val offsetList = NbtList().apply {
|
val offsetList = NbtList().apply {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ fun vec3fArg(access: KProperty1<EmitterParams, Vector3f>) : RequiredArgumentBuil
|
|||||||
val valueY = FloatArgumentType.getFloat(context, "Y")
|
val valueY = FloatArgumentType.getFloat(context, "Y")
|
||||||
val valueZ = FloatArgumentType.getFloat(context, "Z")
|
val valueZ = FloatArgumentType.getFloat(context, "Z")
|
||||||
|
|
||||||
updateParam(id, access, Vector3f(valueX, valueY, valueX))
|
updateParam(id, access, Vector3f(valueX, valueY, valueZ))
|
||||||
|
|
||||||
successText(access, "[$valueX, $valueY, $valueZ]", id, context)
|
successText(access, "[$valueX, $valueY, $valueZ]", id, context)
|
||||||
Command.SINGLE_SUCCESS
|
Command.SINGLE_SUCCESS
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class Particle(
|
|||||||
val properties = DisplayEntityProperties(
|
val properties = DisplayEntityProperties(
|
||||||
pos = entityPos,
|
pos = entityPos,
|
||||||
rot = entityRot,
|
rot = entityRot,
|
||||||
model = emitterParams.modelCurve.lerp(0.0f),
|
model = if (emitterParams.modelCurve.array.isNotEmpty()) { emitterParams.modelCurve.lerp(0.0f) } else "none",
|
||||||
translation = newPos.add(pos),
|
translation = newPos.add(pos),
|
||||||
leftRotation = quatRot,
|
leftRotation = quatRot,
|
||||||
scale = Vector3f(scale).mul(emitterParams.scaleCurve.lerpToVector3f(0.0f)),
|
scale = Vector3f(scale).mul(emitterParams.scaleCurve.lerpToVector3f(0.0f)),
|
||||||
@@ -130,7 +130,7 @@ class Particle(
|
|||||||
private fun calcNewProperties() : DisplayEntityProperties {
|
private fun calcNewProperties() : DisplayEntityProperties {
|
||||||
val timeAliveClamped = (timeAlive.toFloat() / lifeTime.toFloat()).coerceIn(0.0f, 1.0f)
|
val timeAliveClamped = (timeAlive.toFloat() / lifeTime.toFloat()).coerceIn(0.0f, 1.0f)
|
||||||
|
|
||||||
val newModel = emitterParams.modelCurve.lerp(timeAliveClamped)
|
val newModel = if (emitterParams.modelCurve.array.isNotEmpty()) { emitterParams.modelCurve.lerp(timeAliveClamped) } else "none"
|
||||||
val (newVel, newPos) = calcPos()
|
val (newVel, newPos) = calcPos()
|
||||||
val newOriginOffset = Vector3f(originOffset.mul(emitterParams.offsetCurve.lerpToVector3f(timeAliveClamped)))
|
val newOriginOffset = Vector3f(originOffset.mul(emitterParams.offsetCurve.lerpToVector3f(timeAliveClamped)))
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ sealed class SpawningShape() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun randomOnEdge(): Vector3f {
|
fun randomOnEdge(): Vector3f {
|
||||||
val edgeIndex = randomIntBetween(0, 11) // 12 edges
|
val edgeIndex = randomIntBetween(0, 12) // 12 edges
|
||||||
val randPos = randomFloatBetween(0.0f, 1.0f)
|
val randPos = randomFloatBetween(0.0f, 1.0f)
|
||||||
|
|
||||||
return when (edgeIndex) {
|
return when (edgeIndex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user