Files
MinecraftForge/common/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java
T
Eurymachus 8d0b58ee6f Added PlayerOpenContainerEvent and added ForgeHooks.canInteractWith
- Used to override the canInteractWith during player tick
- setResult to ALLOW/DENY as required
- Defaults to Vanilla behaviour in any other instance.

Required for LittleBlocks Mod and to Assist Gullivers Mod
2013-10-06 03:58:13 +01:00

30 lines
795 B
Java

package net.minecraftforge.event.entity.player;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraftforge.event.Event.HasResult;
@HasResult
public class PlayerOpenContainerEvent extends PlayerEvent
{
public final boolean canInteractWith;
/**
* This event is fired when a player attempts to view a container during
* player tick.
*
* setResult ALLOW to allow the container to stay open
* setResult DENY to force close the container (denying access)
*
* DEFAULT is vanilla behaviour
*
*/
public PlayerOpenContainerEvent(EntityPlayer player, Container openContainer)
{
super(player);
this.canInteractWith = openContainer.canInteractWith(player);
}
}