mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
- 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
30 lines
795 B
Java
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);
|
|
}
|
|
}
|