resonant-induction/archive/java/dark/lib/prefab/invgui/ContainerFake.java
2014-01-11 17:44:07 +08:00

32 lines
683 B
Java

package dark.lib.prefab.invgui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity;
/**
* Allows the use of a tile inv without the need for a container class
*
* @author DarkGuardsman
*/
public class ContainerFake extends Container
{
TileEntity entity = null;
public ContainerFake(TileEntity entity)
{
this.entity = entity;
}
@Override
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
if (entity instanceof IInventory)
{
return ((IInventory) this.entity).isUseableByPlayer(par1EntityPlayer);
}
return true;
}
}