Skip to content

Commit

Permalink
ref: update linkableapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronimo97 committed Jul 28, 2024
1 parent 01371ec commit 064ae00
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.18.2 - 3.2.3]

* feat: add item damage
* ref: update linkable api

## [1.18.2 - 3.2.2]

* rem: debug output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@ public RemoteActivator(final CreativeModeTab tab,
public InteractionResultHolder<ItemStack> use(final Level level, final Player player,
final InteractionHand hand) {
final ItemStack itemstack = player.getItemInHand(hand);
if (!hand.equals(InteractionHand.MAIN_HAND) || level.isClientSide)
return InteractionResultHolder.pass(itemstack);
final CompoundTag comp = itemstack.getTag();
final BlockPos linkpos = NbtUtils.readBlockPos(comp);
final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level);
message(player, "ra.state", String.valueOf(state));
final CompoundTag tag = itemstack.getOrCreateTag();
if (tag.contains(LINKINGTOOL_TAG)) {
if (!hand.equals(InteractionHand.MAIN_HAND) || level.isClientSide)
return InteractionResultHolder.pass(itemstack);
final CompoundTag comp = tag.getCompound(LINKINGTOOL_TAG);
final boolean containsPos =
comp.contains("X") && comp.contains("Y") && comp.contains("Z");
if (containsPos) {
final BlockPos linkpos = NbtUtils.readBlockPos(comp);
final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level);
message(player, "ra.state", String.valueOf(state));
return InteractionResultHolder.success(itemstack);
}
}
return InteractionResultHolder.success(itemstack);
}

Expand Down

0 comments on commit 064ae00

Please sign in to comment.