2014-05-24 06:20:56 +02:00
|
|
|
package appeng.container.implementations;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import net.minecraft.inventory.Slot;
|
2014-06-16 07:48:43 +02:00
|
|
|
import net.minecraft.world.World;
|
2014-05-24 06:20:56 +02:00
|
|
|
import appeng.api.config.SecurityPermissions;
|
2014-06-16 07:48:43 +02:00
|
|
|
import appeng.api.networking.IGrid;
|
|
|
|
import appeng.api.networking.security.BaseActionSource;
|
|
|
|
import appeng.api.networking.security.IActionHost;
|
|
|
|
import appeng.api.networking.security.PlayerSource;
|
2014-05-24 06:20:56 +02:00
|
|
|
import appeng.api.storage.ITerminalHost;
|
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
|
|
|
import appeng.container.AEBaseContainer;
|
|
|
|
import appeng.container.slot.SlotInaccessable;
|
2014-06-16 07:48:43 +02:00
|
|
|
import appeng.crafting.ICraftingHost;
|
2014-05-24 06:20:56 +02:00
|
|
|
import appeng.tile.inventory.AppEngInternalInventory;
|
|
|
|
|
2014-06-16 07:48:43 +02:00
|
|
|
public class ContainerCraftAmount extends AEBaseContainer implements ICraftingHost
|
2014-05-24 06:20:56 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
ITerminalHost priHost;
|
|
|
|
IAEItemStack stack;
|
|
|
|
|
|
|
|
public Slot craftingItem;
|
|
|
|
|
|
|
|
public ContainerCraftAmount(InventoryPlayer ip, ITerminalHost te) {
|
|
|
|
super( ip, te );
|
|
|
|
priHost = te;
|
|
|
|
|
|
|
|
craftingItem = new SlotInaccessable( new AppEngInternalInventory( null, 1 ), 0, 34, 53 );
|
|
|
|
addSlotToContainer( craftingItem );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void detectAndSendChanges()
|
|
|
|
{
|
|
|
|
super.detectAndSendChanges();
|
|
|
|
verifyPermissions( SecurityPermissions.CRAFT, false );
|
|
|
|
}
|
|
|
|
|
2014-06-16 07:48:43 +02:00
|
|
|
@Override
|
|
|
|
public IGrid getGrid()
|
|
|
|
{
|
|
|
|
IActionHost h = ((IActionHost) this.getTarget());
|
|
|
|
return h.getActionableNode().getGrid();
|
|
|
|
}
|
|
|
|
|
|
|
|
public World getWorld()
|
|
|
|
{
|
|
|
|
return getPlayerInv().player.worldObj;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BaseActionSource getActionSrc()
|
|
|
|
{
|
|
|
|
return new PlayerSource( getPlayerInv().player, (IActionHost) getTarget() );
|
|
|
|
}
|
|
|
|
|
2014-05-24 06:20:56 +02:00
|
|
|
}
|