Skip to content

Commit

Permalink
Merge pull request #392 from MrTroble/1.15.2/fix-linkableapi
Browse files Browse the repository at this point in the history
ref: update linkableapi
  • Loading branch information
Jeronimo97 authored Aug 6, 2024
2 parents eec7db2 + 1fead8b commit 82bd433
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ public RemoteActivator(final ItemGroup tab, final BiPredicate<World, BlockPos> p
public ActionResult<ItemStack> 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);
}

Expand Down

0 comments on commit 82bd433

Please sign in to comment.