Add player interact event to server left-click handler.

This commit is contained in:
Justin Aquadro committed 2015-04-29 01:16:54 -04:00
1 parent 018abfccbf
commit 75fdecbd6f
1 file changed
+6
@@ -33,6 +33,8 @@ import net.minecraft.util.*;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.logging.log4j.Level;
@@ -304,6 +306,10 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
if (StorageDrawers.config.cache.debugTrace)
FMLLog.log(StorageDrawers.MOD_ID, Level.INFO, "IExtendedBlockClickHandler.onBlockClicked");
PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(player, PlayerInteractEvent.Action.LEFT_CLICK_BLOCK, x, y, z, side, world);
if (event.isCanceled())
return;
TileEntityDrawers tileDrawers = getTileEntitySafe(world, x, y, z);
if (tileDrawers.getDirection() != side)
return;