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

1.12.2/fix linkingapi #389

Merged
merged 5 commits 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.1'
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.12.2 - 3.2.3]

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

## [1.12.2 - 3.2.1]

* feat: added multilinking tool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ public RemoteActivator(final CreativeTabs tab, final BiPredicate<World, BlockPos
public ActionResult<ItemStack> onItemRightClick(final World level, final EntityPlayer player,
final EnumHand hand) {
final ItemStack itemstack = player.getHeldItem(hand);
if (!hand.equals(EnumHand.MAIN_HAND) || level.isRemote)
return ActionResult.newResult(EnumActionResult.PASS, itemstack);
final NBTTagCompound comp = itemstack.getTagCompound();
final BlockPos linkpos = NBTUtil.getPosFromTag(comp);
final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level);
message(player, "ra.state", String.valueOf(state));
return ActionResult.newResult(EnumActionResult.SUCCESS, itemstack);
final NBTTagCompound tag = getOrCreateForStack(itemstack);
if (tag.hasKey(LINKINGTOOL_TAG)) {
if (!hand.equals(EnumHand.MAIN_HAND) || level.isRemote)
return ActionResult.newResult(EnumActionResult.PASS, itemstack);
final NBTTagCompound comp = tag.getCompoundTag(LINKINGTOOL_TAG);
final boolean containsPos = comp.hasKey("X") && comp.hasKey("Y") && comp.hasKey("Z");
if (containsPos) {
final BlockPos linkpos = NBTUtil.getPosFromTag(comp);
final boolean state = TileRedstoneEmitter.redstoneUpdate(linkpos, level);
message(player, "ra.state", String.valueOf(state));
return ActionResult.newResult(EnumActionResult.SUCCESS, itemstack);
}
}
return ActionResult.newResult(EnumActionResult.PASS, itemstack);
}

}
Loading