fixed bug when compiling JAR file

This commit is contained in:
2024-12-15 18:53:52 +01:00
parent ddd78dcef4
commit 3b47ad870f
6 changed files with 12 additions and 14 deletions
@@ -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)
}
@@ -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)
}
@@ -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
@@ -416,14 +416,15 @@ fun transformWithVelArg(access: KProperty1<EmitterParams, ParamClasses.Transform
)
}
fun stringCurveArg(access: KProperty1<EmitterParams, ParamClasses.StringCurve>,
configArg: LiteralArgumentBuilder<ServerCommandSource>,
registryAccess: CommandRegistryAccess
//registryAccess: CommandRegistryAccess
) : LiteralArgumentBuilder<ServerCommandSource>
{
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<EmitterParams, ParamClasses.StringCurve>,
)
}
fun stringCurveAddArg(context: CommandContext<ServerCommandSource>,
access: KProperty1<EmitterParams, ParamClasses.StringCurve>,
index: Int
@@ -177,11 +177,11 @@ object ManageEmitters {
}
private fun config(registryAccess: CommandRegistryAccess) : RequiredArgumentBuilder<ServerCommandSource, String> {
var emitterList = emitterListArg("Emitter ID")
val emitterList = emitterListArg("Emitter ID")
emitterList = listConfigArgs(dataClassToArray(EmitterParams::class), emitterList, registryAccess) as RequiredArgumentBuilder<ServerCommandSource, String>
val configArg = listConfigArgs(dataClassToArray(EmitterParams::class), emitterList, registryAccess) as RequiredArgumentBuilder<ServerCommandSource, String>
return emitterList
return configArg
}
// I am not going to torture myself by converting this to a json.
@@ -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<String, EmitterParams> = mutableMapOf()