fixed some bugs. Testing time!

This commit is contained in:
2024-12-22 17:49:04 +01:00
parent 3ff032db1d
commit 45ff607f6a
5 changed files with 16 additions and 12 deletions
@@ -49,10 +49,12 @@ import kotlin.reflect.full.declaredMemberProperties
// TODO: (future additions)
// 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.
// Copying particle params in-game
// Custom curve equation command args (parse from strings)
// force field "config" option
// Copying particle params in-game.
// Custom curve equation command args (parse from strings).
// force field "config" option.
var ALL_PARTICLE_EMITTERS: Array<ParticleEmitter> = emptyArray()
@@ -49,11 +49,13 @@ class DisplayEntity(private var properties: DisplayEntityProperties?) {
put("Tags", tagList)
put("item", NbtCompound().apply {
putString("id", modelName)
putInt("count", 1)
put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", customModelNum) })
})
if (modelName != "none") {
put("item", NbtCompound().apply {
putString("id", modelName)
putInt("count", 1)
put("components", NbtCompound().apply { putInt("minecraft:custom_model_data", customModelNum) })
})
}
put("transformation", NbtCompound().apply {
val offsetList = NbtList().apply {
@@ -219,7 +219,7 @@ fun vec3fArg(access: KProperty1<EmitterParams, Vector3f>) : RequiredArgumentBuil
val valueY = FloatArgumentType.getFloat(context, "Y")
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)
Command.SINGLE_SUCCESS
@@ -75,7 +75,7 @@ class Particle(
val properties = DisplayEntityProperties(
pos = entityPos,
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),
leftRotation = quatRot,
scale = Vector3f(scale).mul(emitterParams.scaleCurve.lerpToVector3f(0.0f)),
@@ -130,7 +130,7 @@ class Particle(
private fun calcNewProperties() : DisplayEntityProperties {
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 newOriginOffset = Vector3f(originOffset.mul(emitterParams.offsetCurve.lerpToVector3f(timeAliveClamped)))
@@ -51,7 +51,7 @@ sealed class SpawningShape() {
}
fun randomOnEdge(): Vector3f {
val edgeIndex = randomIntBetween(0, 11) // 12 edges
val edgeIndex = randomIntBetween(0, 12) // 12 edges
val randPos = randomFloatBetween(0.0f, 1.0f)
return when (edgeIndex) {