mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-18 03:25:34 +00:00
Add player interact event to server left-click handler.
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user