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 4618471..4feba3b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## [1.14.4 - 3.2.3] + +* feat: add item damage +* ref: update linkable api + ## [1.14.4 - 3.2.2] * rem: debug output diff --git a/linkableapi b/linkableapi index 8cf3e62..3e0db47 160000 --- a/linkableapi +++ b/linkableapi @@ -1 +1 @@ -Subproject commit 8cf3e62420c841d3b9ccd24e94e8568aaff567b7 +Subproject commit 3e0db47a2c9521db9fdb691bc955dd483bda8922 diff --git a/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java b/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java index bc1c6e2..d985eda 100644 --- a/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java +++ b/src/main/java/com/troblecodings/tcredstone/item/RemoteActivator.java @@ -26,13 +26,21 @@ 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.newResult(ActionResultType.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)); - return ActionResult.newResult(ActionResultType.SUCCESS,itemstack); + final CompoundNBT tag = getOrCreateForStack(itemstack); + if (tag.contains(LINKINGTOOL_TAG)) { + if (!hand.equals(Hand.MAIN_HAND) || level.isClientSide) + return ActionResult.newResult(ActionResultType.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.newResult(ActionResultType.SUCCESS, itemstack); + } + } + return ActionResult.newResult(ActionResultType.PASS, itemstack); } }