diff --git a/src/client/kotlin/com/bytedice/bde_particles/client/Bde_particlesClient.kt b/src/client/kotlin/com/bytedice/bde_particles/client/Bde_particlesClient.kt index 6153ffe..053a762 100644 --- a/src/client/kotlin/com/bytedice/bde_particles/client/Bde_particlesClient.kt +++ b/src/client/kotlin/com/bytedice/bde_particles/client/Bde_particlesClient.kt @@ -40,7 +40,7 @@ class Bde_particlesClient : ClientModInitializer { CommandRegistrationCallback.EVENT.register { dispatcher, registryAccess, _ -> GiveEmitterTool.register(dispatcher, registryAccess) - ManageEmitters .register(dispatcher) + ManageEmitters .register(dispatcher, registryAccess) KillAllEmitters.register(dispatcher) SpawnEmitter .register(dispatcher) } diff --git a/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt b/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt index 960fb95..0cedc6d 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/Bde_particles.kt @@ -4,7 +4,6 @@ import com.bytedice.bde_particles.commands.GiveEmitterTool import com.bytedice.bde_particles.commands.KillAllEmitters import com.bytedice.bde_particles.commands.ManageEmitters import com.bytedice.bde_particles.commands.SpawnEmitter -//import com.bytedice.bde_particles.commands.ManageEmitters import com.bytedice.bde_particles.items.ParticleEmitterTool import com.bytedice.bde_particles.particles.* import com.mojang.brigadier.arguments.StringArgumentType @@ -46,7 +45,6 @@ import java.util.concurrent.CompletableFuture import kotlin.reflect.full.companionObject import kotlin.reflect.full.companionObjectInstance import kotlin.reflect.full.declaredMemberProperties -import kotlin.reflect.jvm.isAccessible // TODO: (future additions) @@ -88,8 +86,9 @@ class Bde_particles : ModInitializer { } CommandRegistrationCallback.EVENT.register { dispatcher, registryAccess, _ -> - GiveEmitterTool.register(dispatcher, registryAccess) - ManageEmitters .register(dispatcher, registryAccess) + val registryClone = registryAccess + GiveEmitterTool.register(dispatcher, registryClone) + ManageEmitters .register(dispatcher, registryClone) KillAllEmitters.register(dispatcher) SpawnEmitter .register(dispatcher) } diff --git a/src/main/kotlin/com/bytedice/bde_particles/Math.kt b/src/main/kotlin/com/bytedice/bde_particles/Math.kt index 5938bd0..751d073 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/Math.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/Math.kt @@ -5,10 +5,8 @@ import net.minecraft.util.hit.HitResult import net.minecraft.util.math.Vec3d import net.minecraft.world.RaycastContext import net.minecraft.world.World -import org.joml.Vector2f import org.joml.Vector3f import org.joml.Vector4f -import java.util.SplittableRandom import kotlin.math.* import kotlin.random.Random diff --git a/src/main/kotlin/com/bytedice/bde_particles/commands/ConfigArgs.kt b/src/main/kotlin/com/bytedice/bde_particles/commands/ConfigArgs.kt index d5e681a..d082335 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/commands/ConfigArgs.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/commands/ConfigArgs.kt @@ -416,14 +416,15 @@ fun transformWithVelArg(access: KProperty1, configArg: LiteralArgumentBuilder, - registryAccess: CommandRegistryAccess + //registryAccess: CommandRegistryAccess ) : LiteralArgumentBuilder { return configArg .then(CommandManager.literal("Add") - .then(CommandManager.argument("Item", ItemStackArgumentType.itemStack(registryAccess)) + .then(CommandManager.argument("Item", FloatArgumentType.floatArg())//ItemStackArgumentType.itemStack(registryAccess)) .then(CommandManager.argument("Index", IntegerArgumentType.integer()) .executes { context -> val index = IntegerArgumentType.getInteger(context, "Index") @@ -475,6 +476,8 @@ fun stringCurveArg(access: KProperty1, ) } + + fun stringCurveAddArg(context: CommandContext, access: KProperty1, index: Int diff --git a/src/main/kotlin/com/bytedice/bde_particles/commands/ManageEmitters.kt b/src/main/kotlin/com/bytedice/bde_particles/commands/ManageEmitters.kt index dd85c80..3b52455 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/commands/ManageEmitters.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/commands/ManageEmitters.kt @@ -177,11 +177,11 @@ object ManageEmitters { } private fun config(registryAccess: CommandRegistryAccess) : RequiredArgumentBuilder { - var emitterList = emitterListArg("Emitter ID") + val emitterList = emitterListArg("Emitter ID") - emitterList = listConfigArgs(dataClassToArray(EmitterParams::class), emitterList, registryAccess) as RequiredArgumentBuilder + val configArg = listConfigArgs(dataClassToArray(EmitterParams::class), emitterList, registryAccess) as RequiredArgumentBuilder - return emitterList + return configArg } // I am not going to torture myself by converting this to a json. diff --git a/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleIdRegister.kt b/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleIdRegister.kt index 9abac92..e568efb 100644 --- a/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleIdRegister.kt +++ b/src/main/kotlin/com/bytedice/bde_particles/particles/ParticleIdRegister.kt @@ -4,8 +4,6 @@ import kotlin.reflect.KClass import kotlin.reflect.KMutableProperty1 import kotlin.reflect.KProperty1 import kotlin.reflect.full.isSubclassOf -import kotlin.reflect.full.memberProperties -import kotlin.reflect.jvm.isAccessible val idRegister: MutableMap = mutableMapOf()