GT5-Unofficial/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java

30 lines
1.2 KiB
Java
Raw Normal View History

2015-04-23 16:14:22 +00:00
package gregtech.api.gui;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class GT_Container_MaintenanceHatch extends GT_ContainerMetaTile_Machine {
2015-10-22 02:06:25 +00:00
public GT_Container_MaintenanceHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public void addSlots(InventoryPlayer aInventoryPlayer) {
addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 80, 35, false, false, 1));
2015-04-23 16:14:22 +00:00
}
2015-10-22 02:06:25 +00:00
2015-04-23 16:14:22 +00:00
@Override
2015-10-22 02:06:25 +00:00
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
if (aSlotIndex != 0) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
ItemStack tStack = aPlayer.inventory.getItemStack();
if (tStack != null) {
((GT_MetaTileEntity_Hatch_Maintenance) mTileEntity.getMetaTileEntity()).onToolClick(tStack, aPlayer);
if (tStack.stackSize <= 0) aPlayer.inventory.setItemStack(null);
}
return null;
2015-04-23 16:14:22 +00:00
}
}