mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-28 07:56:01 +00:00
Only run scythe AOE crop harvest on right click (#357)
This commit is contained in:
1 parent
52f603e4a1
commit
ccd5d66f35
1 file changed
+4
-1
@@ -14,11 +14,14 @@ public class AoeCropHarvestHandler {
|
||||
|
||||
/**
|
||||
* We're using EventPriority.HIGH here to run before RightClickCropHandler from EnderCore.
|
||||
* <p>
|
||||
* Only right clicks harvest.
|
||||
*/
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void handlePlayerInteractEvent(PlayerInteractEvent event) {
|
||||
ItemStack equippedItem = event.entityPlayer.getCurrentEquippedItem();
|
||||
if (!event.world.isRemote && isScythe(equippedItem)
|
||||
if (!event.world.isRemote && event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK
|
||||
&& isScythe(equippedItem)
|
||||
&& harvestCropsInRange(equippedItem, event.entityPlayer, event.world, event.x, event.y, event.z)) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user