Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: update linkableapi #393

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.16.5 - 3.2.3]

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

## [1.16.5 - 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 = itemstack.getOrCreateTag();
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
Loading