summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-02-10 21:25:20 +0100
committerGitHub <noreply@github.com>2024-02-10 21:25:20 +0100
commit3ced2632ac23d968601f83374b8b3ceee0fc5e36 (patch)
tree009a29156bcf4a3c8b6e604d9a33360aa1a13eb5 /src/main/java/at/hannibal2/skyhanni/data
parentffbb693db7921a2d145c545833a98248e4623bf4 (diff)
downloadskyhanni-3ced2632ac23d968601f83374b8b3ceee0fc5e36.tar.gz
skyhanni-3ced2632ac23d968601f83374b8b3ceee0fc5e36.tar.bz2
skyhanni-3ced2632ac23d968601f83374b8b3ceee0fc5e36.zip
Blocks the mining ability when on private island. #860
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
index 4aa796b54..9a7742a29 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
@@ -22,18 +22,18 @@ class ItemClickData {
if (packet is C08PacketPlayerBlockPlacement) {
if (packet.placedBlockDirection != 255) {
val position = packet.position.toLorenzVec()
- BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch()
+ event.isCanceled = BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch()
} else {
- ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.RIGHT_CLICK).postAndCatch()
+ event.isCanceled = ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.RIGHT_CLICK).postAndCatch()
}
}
if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
val position = packet.position.toLorenzVec()
- BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch()
- ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.LEFT_CLICK).postAndCatch()
+ val blockClickCancelled = BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch()
+ event.isCanceled = ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.LEFT_CLICK).also { it.isCanceled = blockClickCancelled }.postAndCatch()
}
if (packet is C0APacketAnimation) {
- ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.LEFT_CLICK).postAndCatch()
+ event.isCanceled = ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.LEFT_CLICK).postAndCatch()
}
}
@@ -56,6 +56,6 @@ class ItemClickData {
if (minecraft.thePlayer == null) return
if (clickedEntity == null) return
- EntityClickEvent(clickType, clickedEntity).postAndCatch()
+ event.isCanceled = EntityClickEvent(clickType, clickedEntity, InventoryUtils.getItemInHand()).postAndCatch()
}
}