#1107: Add getHand() to all relevant events
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
+ }
|
||||
+
|
||||
+ if (entity instanceof EntityHuman) {
|
||||
+ PlayerHarvestBlockEvent event = CraftEventFactory.callPlayerHarvestBlockEvent(world, blockposition, (EntityHuman) entity, Collections.singletonList(new ItemStack(Items.GLOW_BERRIES, 1)));
|
||||
+ PlayerHarvestBlockEvent event = CraftEventFactory.callPlayerHarvestBlockEvent(world, blockposition, (EntityHuman) entity, net.minecraft.world.EnumHand.MAIN_HAND, Collections.singletonList(new ItemStack(Items.GLOW_BERRIES, 1)));
|
||||
+ if (event.isCancelled()) {
|
||||
+ return EnumInteractionResult.SUCCESS; // We need to return a success either way, because making it PASS or FAIL will result in a bug where cancelling while harvesting w/ block in hand places block
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user