Skip to content

Commit

Permalink
Merge Staff Mod 0.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
opekope2 authored Jul 10, 2024
2 parents a236737 + 2e54de3 commit f20ff9e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion FabricMod/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"fabric-api": ">=$fabric_api",
"fabric-language-kotlin": ">=$fabric_language_kotlin",
"architectury": ">=$architectury",
"minecraft": ">=$minecraft",
"minecraft": "=$minecraft",
"java": ">=$java"
},
"custom": {
Expand Down
2 changes: 1 addition & 1 deletion NeoForgeMod/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ side = "BOTH"
[[dependencies.avm_staff]]
modId = "minecraft"
type = "required"
versionRange = "[$minecraft,)"
versionRange = "[$minecraft]"
ordering = "NONE"
side = "BOTH"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -123,19 +120,17 @@ private fun dispatchStaffBlockAttack(
private fun tryThrowCake(player: PlayerEntity, hand: Hand): CompoundEventResult<ItemStack> {
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() {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit f20ff9e

Please sign in to comment.