diff --git a/FabricMod/src/main/resources/fabric.mod.json b/FabricMod/src/main/resources/fabric.mod.json index 16f1d505a..a7b5230f3 100644 --- a/FabricMod/src/main/resources/fabric.mod.json +++ b/FabricMod/src/main/resources/fabric.mod.json @@ -95,7 +95,7 @@ "fabric-api": ">=$fabric_api", "fabric-language-kotlin": ">=$fabric_language_kotlin", "architectury": ">=$architectury", - "minecraft": ">=$minecraft", + "minecraft": "=$minecraft", "java": ">=$java" }, "custom": { diff --git a/NeoForgeMod/src/main/resources/META-INF/neoforge.mods.toml b/NeoForgeMod/src/main/resources/META-INF/neoforge.mods.toml index 1feb1c44a..9ade40c6e 100644 --- a/NeoForgeMod/src/main/resources/META-INF/neoforge.mods.toml +++ b/NeoForgeMod/src/main/resources/META-INF/neoforge.mods.toml @@ -29,7 +29,7 @@ side = "BOTH" [[dependencies.avm_staff]] modId = "minecraft" type = "required" -versionRange = "[$minecraft,)" +versionRange = "[$minecraft]" ordering = "NONE" side = "BOTH" diff --git a/StaffMod/src/main/kotlin/opekope2/avm_staff/internal/Initializer.kt b/StaffMod/src/main/kotlin/opekope2/avm_staff/internal/Initializer.kt index 7f3bcd2ff..cb90f1a00 100644 --- a/StaffMod/src/main/kotlin/opekope2/avm_staff/internal/Initializer.kt +++ b/StaffMod/src/main/kotlin/opekope2/avm_staff/internal/Initializer.kt @@ -65,10 +65,7 @@ import opekope2.avm_staff.internal.networking.c2s.play.InsertItemIntoStaffC2SPac import opekope2.avm_staff.internal.networking.c2s.play.RemoveItemFromStaffC2SPacket import opekope2.avm_staff.mixin.IPiglinBrainInvoker import opekope2.avm_staff.mixin.ISmithingTemplateItemAccessor -import opekope2.avm_staff.util.MOD_ID -import opekope2.avm_staff.util.isStaff -import opekope2.avm_staff.util.plus -import opekope2.avm_staff.util.times +import opekope2.avm_staff.util.* fun registerContent() { opekope2.avm_staff.api.registerContent() @@ -123,19 +120,17 @@ private fun dispatchStaffBlockAttack( private fun tryThrowCake(player: PlayerEntity, hand: Hand): CompoundEventResult { val world = player.entityWorld val cake = player.getStackInHand(hand) + val spawnPos = cakeEntityType.get().getSpawnPosition(world, player.approximateStaffTipPosition) - if (!world.gameRules.getBoolean(throwableCakesGameRule)) return CompoundEventResult.pass() if (!cake.isOf(Items.CAKE)) return CompoundEventResult.pass() + if (spawnPos == null) return CompoundEventResult.pass() + if (world.isClient) return CompoundEventResult.interruptTrue(cake) + if (!world.gameRules.getBoolean(throwableCakesGameRule)) return CompoundEventResult.pass() - if (!world.isClient) { - CakeEntity.throwCake( - world, player.eyePos + player.rotationVector, player.rotationVector * .5 + player.velocity, player - ) - } - + CakeEntity.throwCake(world, spawnPos, player.rotationVector * .5 + player.velocity, player) cake.decrementUnlessCreative(1, player) - return CompoundEventResult.interrupt(world.isClient, player.getStackInHand(hand)) + return CompoundEventResult.interruptFalse(cake) } private fun setup() { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ce6eb6d43..cd4211228 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] java = "21" # Don't forget to update *.mixins.json kotlin = "1.9.23" -staff-mod = "0.16.0" +staff-mod = "0.16.1" architectury-plugin = "3.4-SNAPSHOT" architectury-loom = "1.6-SNAPSHOT" yarn = "1.20.6+build.2"