Sigil of Holding remake!

This commit is contained in:
Arcaratus 2015-05-18 18:33:23 -04:00
parent 61cb569ffb
commit 0f3c0196cd
39 changed files with 874 additions and 327 deletions

View file

@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@ -15,7 +16,7 @@ public class ContainerTeleposer extends Container
public ContainerTeleposer(InventoryPlayer inventoryPlayer, TETeleposer te)
{
tileEntity = te;
addSlotToContainer(new Slot(tileEntity, 0, 80, 15));
addSlotToContainer(new SlotTeleposer(te, 0, 80, 15));
bindPlayerInventory(inventoryPlayer);
}
@ -86,4 +87,18 @@ public class ContainerTeleposer extends Container
return stack;
}
private class SlotTeleposer extends Slot
{
public SlotTeleposer(IInventory inventory, int slotIndex, int x, int y)
{
super(inventory, slotIndex, x, y);
}
@Override
public boolean isItemValid(ItemStack itemStack)
{
return itemStack.getItem() instanceof TelepositionFocus;
}
}
}

View file

@ -1,5 +1,8 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.ContainerHolding;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.GuiHolding;
import WayofTime.alchemicalWizardry.common.items.sigil.holding.InventoryHolding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -40,6 +43,9 @@ public class GuiHandler implements IGuiHandler
{
return new ContainerTeleposer(player.inventory, (TETeleposer) tileEntity);
}
case 3:
return new ContainerHolding(player, new InventoryHolding(player.getHeldItem()));
}
return null;
@ -99,6 +105,8 @@ public class GuiHandler implements IGuiHandler
}
return new GuiCategories(player);
case 3:
return new GuiHolding(player, new InventoryHolding(player.getHeldItem()));
}
return null;