ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java

65 lines
1.9 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
2016-05-16 22:52:27 +02:00
* This file ("TileEntityGiantChest.java") is part of the Actually Additions mod for Minecraft.
2015-08-29 14:33:25 +02:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http://ellpeck.de/actaddlicense
2015-08-29 14:33:25 +02:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2016-05-16 22:54:42 +02:00
* © 2015-2016 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2016-01-05 04:47:35 +01:00
package de.ellpeck.actuallyadditions.mod.tile;
2016-06-27 20:19:04 +02:00
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
2016-06-27 20:19:04 +02:00
public class TileEntityGiantChest extends TileEntityInventoryBase implements IButtonReactor{
public TileEntityGiantChest(int slotAmount, String name){
super(slotAmount, name);
2016-06-27 20:19:04 +02:00
}
public TileEntityGiantChest(){
this(9*13, "giantChest");
}
@Override
public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){
2015-10-03 10:19:40 +02:00
return this.isItemValidForSlot(slot, stack);
}
@Override
public boolean isItemValidForSlot(int i, ItemStack stack){
2015-10-03 10:19:40 +02:00
return true;
}
@Override
public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){
return true;
}
2016-06-27 20:19:04 +02:00
@Override
public void onButtonPressed(int buttonID, EntityPlayer player){
if(player != null && this.pos != null){
GuiHandler.GuiTypes type;
2016-06-27 20:19:04 +02:00
if(buttonID == 0){
type = GuiHandler.GuiTypes.GIANT_CHEST;
}
else if(buttonID == 1){
type = GuiHandler.GuiTypes.GIANT_CHEST_PAGE_2;
}
else{
type = GuiHandler.GuiTypes.GIANT_CHEST_PAGE_3;
}
2016-06-27 20:19:04 +02:00
player.openGui(ActuallyAdditions.instance, type.ordinal(), this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ());
}
2016-06-27 20:19:04 +02:00
}
}