diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 196697a..38ffe1e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,7 +30,7 @@ jobs: if: endswith(github.ref_name, 'master') && github.ref_protected && github.ref_type == 'branch' runs-on: ubuntu-latest env: - APPVEYOR_BUILD_VERSION: '3.2.2' + APPVEYOR_BUILD_VERSION: '3.2.3' CURSETOKEN: ${{ secrets.CURSETOKEN }} steps: - uses: actions/checkout@v3 diff --git a/changelog.md b/changelog.md index 199c199..66d3536 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## [1.15.2 - 3.2.3] + +* feat: add item damage +* ref: update linkable api + ## [1.15.2 - 3.2.2] * rem: debug output diff --git a/linkableapi b/linkableapi index 94f5947..f81201a 160000 --- a/linkableapi +++ b/linkableapi @@ -1 +1 @@ -Subproject commit 94f5947713eea61aef926adcdad17601c207aebe +Subproject commit f81201ae52d6a6ce520badd7921a2734e7643c4a diff --git a/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java b/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java index 2201fe4..214d7e5 100644 --- a/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java +++ b/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java @@ -25,12 +25,20 @@ public RemoteActivator(final ItemGroup tab, final BiPredicate p public ActionResult use(final World level, final PlayerEntity player, final Hand hand) { final ItemStack itemstack = player.getItemInHand(hand); - if (!hand.equals(Hand.MAIN_HAND) || level.isClientSide) - return ActionResult.pass(itemstack); - final CompoundNBT comp = itemstack.getTag(); - final BlockPos linkpos = NBTUtil.readBlockPos(comp); - final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level); - message(player, "ra.state", String.valueOf(state)); + final CompoundNBT tag = getOrCreateForStack(itemstack); + if (tag.contains(LINKINGTOOL_TAG)) { + if (!hand.equals(Hand.MAIN_HAND) || level.isClientSide) + return ActionResult.pass(itemstack); + final CompoundNBT comp = tag.getCompound(LINKINGTOOL_TAG); + final boolean containsPos = + comp.contains("X") && comp.contains("Y") && comp.contains("Z"); + if (containsPos) { + final BlockPos linkpos = NBTUtil.readBlockPos(comp); + final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level); + message(player, "ra.state", String.valueOf(state)); + return ActionResult.success(itemstack); + } + } return ActionResult.success(itemstack); }