The different sized Alchemical Chests aren't quite working yet, but loads of GUI work and textures and stuff tonight
|
@ -36,6 +36,12 @@ public class BlockAlchemicalChest extends BlockEE implements ITileEntityProvider
|
|||
return new TileAlchemicalChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metaData)
|
||||
{
|
||||
return new TileAlchemicalChest(metaData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
|
@ -68,7 +74,18 @@ public class BlockAlchemicalChest extends BlockEE implements ITileEntityProvider
|
|||
{
|
||||
if (world.getBlockTileEntity(x, y, z) instanceof TileAlchemicalChest)
|
||||
{
|
||||
player.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_CHEST, world, x, y, z);
|
||||
if (world.getBlockMetadata(x, y, z) == 0)
|
||||
{
|
||||
player.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_CHEST_SMALL, world, x, y, z);
|
||||
}
|
||||
else if (world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
player.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_CHEST_MEDIUM, world, x, y, z);
|
||||
}
|
||||
else if (world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
player.openGui(EquivalentExchange3.instance, GuiIds.ALCHEMICAL_CHEST_LARGE, world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.pahimar.ee3.client.gui.inventory;
|
|||
import com.pahimar.ee3.helper.ItemStackNBTHelper;
|
||||
import com.pahimar.ee3.inventory.ContainerAlchemicalBag;
|
||||
import com.pahimar.ee3.lib.Strings;
|
||||
import com.pahimar.ee3.lib.Textures;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
@ -46,7 +45,7 @@ public class GuiAlchemicalBag extends GuiContainer
|
|||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
// this.mc.getTextureManager().bindTexture(...)
|
||||
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE);
|
||||
//this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE);
|
||||
|
||||
int xStart = (width - xSize) / 2;
|
||||
int yStart = (height - ySize) / 2;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.pahimar.ee3.client.gui.inventory;
|
||||
|
||||
import com.pahimar.ee3.inventory.ContainerAlchemicalChestLarge;
|
||||
import com.pahimar.ee3.lib.Textures;
|
||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Equivalent-Exchange-3
|
||||
* <p/>
|
||||
* GuiAlchemicalChestLarge
|
||||
*
|
||||
* @author pahimar
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAlchemicalChestLarge extends GuiContainer
|
||||
{
|
||||
public GuiAlchemicalChestLarge(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest)
|
||||
{
|
||||
super(new ContainerAlchemicalChestLarge(inventoryPlayer, alchemicalChest));
|
||||
xSize = 248;
|
||||
ySize = 256;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_LARGE);
|
||||
int xStart = (width - xSize) / 2;
|
||||
int yStart = (height - ySize) / 2;
|
||||
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package com.pahimar.ee3.client.gui.inventory;
|
||||
|
||||
import com.pahimar.ee3.inventory.ContainerAlchemicalChest;
|
||||
import com.pahimar.ee3.inventory.ContainerAlchemicalChestMedium;
|
||||
import com.pahimar.ee3.lib.Strings;
|
||||
import com.pahimar.ee3.lib.Textures;
|
||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||
|
@ -14,41 +14,35 @@ import org.lwjgl.opengl.GL11;
|
|||
/**
|
||||
* Equivalent-Exchange-3
|
||||
* <p/>
|
||||
* GuiAlchemicalChest
|
||||
* GuiAlchemicalChestLarge
|
||||
*
|
||||
* @author pahimar
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAlchemicalChest extends GuiContainer
|
||||
public class GuiAlchemicalChestMedium extends GuiContainer
|
||||
{
|
||||
|
||||
private TileAlchemicalChest tileAlchemicalChest;
|
||||
|
||||
public GuiAlchemicalChest(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest)
|
||||
public GuiAlchemicalChestMedium(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest)
|
||||
{
|
||||
|
||||
super(new ContainerAlchemicalChest(inventoryPlayer, alchemicalChest));
|
||||
super(new ContainerAlchemicalChestMedium(inventoryPlayer, alchemicalChest));
|
||||
tileAlchemicalChest = alchemicalChest;
|
||||
xSize = 248;
|
||||
ySize = 186;
|
||||
xSize = 230;
|
||||
ySize = 240;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y)
|
||||
{
|
||||
|
||||
fontRenderer.drawString(tileAlchemicalChest.isInvNameLocalized() ? tileAlchemicalChest.getInvName() : StatCollector.translateToLocal(tileAlchemicalChest.getInvName()), 8, 6, 4210752);
|
||||
fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 44, ySize - 96 + 2, 4210752);
|
||||
fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 45, ySize - 89 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
|
||||
{
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE);
|
||||
|
||||
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_MEDIUM);
|
||||
int xStart = (width - xSize) / 2;
|
||||
int yStart = (height - ySize) / 2;
|
||||
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
|
|
@ -0,0 +1,46 @@
|
|||
package com.pahimar.ee3.client.gui.inventory;
|
||||
|
||||
import com.pahimar.ee3.inventory.ContainerAlchemicalChestSmall;
|
||||
import com.pahimar.ee3.lib.Strings;
|
||||
import com.pahimar.ee3.lib.Textures;
|
||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Created by pahimar on 04/01/14.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiAlchemicalChestSmall extends GuiContainer
|
||||
{
|
||||
private TileAlchemicalChest tileAlchemicalChest;
|
||||
|
||||
public GuiAlchemicalChestSmall(InventoryPlayer inventoryPlayer, TileAlchemicalChest alchemicalChest)
|
||||
{
|
||||
super(new ContainerAlchemicalChestSmall(inventoryPlayer, alchemicalChest));
|
||||
tileAlchemicalChest = alchemicalChest;
|
||||
xSize = 230;
|
||||
ySize = 186;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y)
|
||||
{
|
||||
fontRenderer.drawString(tileAlchemicalChest.isInvNameLocalized() ? tileAlchemicalChest.getInvName() : StatCollector.translateToLocal(tileAlchemicalChest.getInvName()), 8, 6, 4210752);
|
||||
fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 45, ySize - 89 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE_SMALL);
|
||||
int xStart = (width - xSize) / 2;
|
||||
int yStart = (height - ySize) / 2;
|
||||
this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
|
||||
}
|
||||
}
|
|
@ -37,7 +37,24 @@ public class TileEntityAlchemicalChestRenderer extends TileEntitySpecialRenderer
|
|||
direction = tileAlchemicalChest.getOrientation();
|
||||
}
|
||||
|
||||
if (tileAlchemicalChest.getState() == 0)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMICAL_CHEST_SMALL);
|
||||
}
|
||||
else if (tileAlchemicalChest.getState() == 1)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMICAL_CHEST_MEDIUM);
|
||||
}
|
||||
else if (tileAlchemicalChest.getState() == 2)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMICAL_CHEST_LARGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(Textures.MODEL_ALCHEMICAL_CHEST);
|
||||
}
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
|
|
@ -26,10 +26,20 @@ public class GuiHandler implements IGuiHandler
|
|||
TileCalcinator tileCalcinator = (TileCalcinator) world.getBlockTileEntity(x, y, z);
|
||||
return new ContainerCalcinator(player.inventory, tileCalcinator);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST)
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_SMALL)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new ContainerAlchemicalChest(player.inventory, tileAlchemicalChest);
|
||||
return new ContainerAlchemicalChestSmall(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_MEDIUM)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new ContainerAlchemicalChestMedium(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_LARGE)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new ContainerAlchemicalChestLarge(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_BAG)
|
||||
// TODO Alchemical Bag inventory work is incomplete
|
||||
|
@ -63,10 +73,20 @@ public class GuiHandler implements IGuiHandler
|
|||
TileCalcinator tileCalcinator = (TileCalcinator) world.getBlockTileEntity(x, y, z);
|
||||
return new GuiCalcinator(player.inventory, tileCalcinator);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST)
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_SMALL)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new GuiAlchemicalChest(player.inventory, tileAlchemicalChest);
|
||||
return new GuiAlchemicalChestSmall(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_MEDIUM)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new GuiAlchemicalChestMedium(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_CHEST_LARGE)
|
||||
{
|
||||
TileAlchemicalChest tileAlchemicalChest = (TileAlchemicalChest) world.getBlockTileEntity(x, y, z);
|
||||
return new GuiAlchemicalChestLarge(player.inventory, tileAlchemicalChest);
|
||||
}
|
||||
else if (ID == GuiIds.ALCHEMICAL_BAG)
|
||||
// TODO Alchemical Bag inventory work is incomplete
|
||||
|
|
|
@ -17,8 +17,7 @@ import net.minecraft.item.ItemStack;
|
|||
*/
|
||||
public class ContainerAlchemicalBag extends Container
|
||||
{
|
||||
|
||||
private final int BAG_INVENTORY_ROWS = 4;
|
||||
private final int BAG_INVENTORY_ROWS = 9;
|
||||
private final int BAG_INVENTORY_COLUMNS = 13;
|
||||
|
||||
private final int PLAYER_INVENTORY_ROWS = 3;
|
||||
|
@ -26,7 +25,6 @@ public class ContainerAlchemicalBag extends Container
|
|||
|
||||
public ContainerAlchemicalBag(InventoryPlayer inventoryPlayer)
|
||||
{
|
||||
|
||||
// Add the player's inventory slots to the container
|
||||
for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex)
|
||||
{
|
||||
|
|
|
@ -10,24 +10,22 @@ import net.minecraft.item.ItemStack;
|
|||
/**
|
||||
* Equivalent-Exchange-3
|
||||
* <p/>
|
||||
* ContainerAlchemicalChest
|
||||
* ContainerAlchemicalChestLarge
|
||||
*
|
||||
* @author pahimar
|
||||
*/
|
||||
public class ContainerAlchemicalChest extends Container
|
||||
public class ContainerAlchemicalChestLarge extends Container
|
||||
{
|
||||
|
||||
private TileAlchemicalChest tileAlchemicalChest;
|
||||
|
||||
private final int CHEST_INVENTORY_ROWS = 4;
|
||||
private final int CHEST_INVENTORY_ROWS = 9;
|
||||
private final int CHEST_INVENTORY_COLUMNS = 13;
|
||||
|
||||
private final int PLAYER_INVENTORY_ROWS = 3;
|
||||
private final int PLAYER_INVENTORY_COLUMNS = 9;
|
||||
|
||||
public ContainerAlchemicalChest(InventoryPlayer inventoryPlayer, TileAlchemicalChest tileAlchemicalChest)
|
||||
public ContainerAlchemicalChestLarge(InventoryPlayer inventoryPlayer, TileAlchemicalChest tileAlchemicalChest)
|
||||
{
|
||||
|
||||
this.tileAlchemicalChest = tileAlchemicalChest;
|
||||
|
||||
tileAlchemicalChest.openChest();
|
||||
|
@ -37,7 +35,7 @@ public class ContainerAlchemicalChest extends Container
|
|||
{
|
||||
for (int chestColumnIndex = 0; chestColumnIndex < CHEST_INVENTORY_COLUMNS; ++chestColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(tileAlchemicalChest, chestColumnIndex + chestRowIndex * 13, 8 + chestColumnIndex * 18, 18 + chestRowIndex * 18));
|
||||
this.addSlotToContainer(new Slot(tileAlchemicalChest, chestColumnIndex + chestRowIndex * 13, 8 + chestColumnIndex * 18, 8 + chestRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,21 +44,20 @@ public class ContainerAlchemicalChest extends Container
|
|||
{
|
||||
for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 44 + inventoryColumnIndex * 18, 104 + inventoryRowIndex * 18));
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 44 + inventoryColumnIndex * 18, 174 + inventoryRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Add the player's action bar slots to the container
|
||||
for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 162));
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 232));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer var1)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -70,7 +67,6 @@ public class ContainerAlchemicalChest extends Container
|
|||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityPlayer)
|
||||
{
|
||||
|
||||
super.onContainerClosed(entityPlayer);
|
||||
tileAlchemicalChest.closeChest();
|
||||
}
|
||||
|
@ -78,7 +74,6 @@ public class ContainerAlchemicalChest extends Container
|
|||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex)
|
||||
{
|
||||
|
||||
ItemStack newItemStack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.pahimar.ee3.inventory;
|
||||
|
||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Equivalent-Exchange-3
|
||||
* <p/>
|
||||
* ContainerAlchemicalChestLarge
|
||||
*
|
||||
* @author pahimar
|
||||
*/
|
||||
public class ContainerAlchemicalChestMedium extends Container
|
||||
{
|
||||
private TileAlchemicalChest tileAlchemicalChest;
|
||||
|
||||
private final int CHEST_INVENTORY_ROWS = 7;
|
||||
private final int CHEST_INVENTORY_COLUMNS = 12;
|
||||
|
||||
private final int PLAYER_INVENTORY_ROWS = 3;
|
||||
private final int PLAYER_INVENTORY_COLUMNS = 9;
|
||||
|
||||
public ContainerAlchemicalChestMedium(InventoryPlayer inventoryPlayer, TileAlchemicalChest tileAlchemicalChest)
|
||||
{
|
||||
this.tileAlchemicalChest = tileAlchemicalChest;
|
||||
|
||||
tileAlchemicalChest.openChest();
|
||||
|
||||
// Add the Alchemical Chest slots to the container
|
||||
for (int chestRowIndex = 0; chestRowIndex < CHEST_INVENTORY_ROWS; ++chestRowIndex)
|
||||
{
|
||||
for (int chestColumnIndex = 0; chestColumnIndex < CHEST_INVENTORY_COLUMNS; ++chestColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(tileAlchemicalChest, chestColumnIndex + chestRowIndex * 13, 8 + chestColumnIndex * 18, 8 + chestRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Add the player's inventory slots to the container
|
||||
for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex)
|
||||
{
|
||||
for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 44 + inventoryColumnIndex * 18, 174 + inventoryRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Add the player's action bar slots to the container
|
||||
for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 232));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer var1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for when the crafting gui is closed.
|
||||
*/
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityPlayer)
|
||||
{
|
||||
super.onContainerClosed(entityPlayer);
|
||||
tileAlchemicalChest.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex)
|
||||
{
|
||||
ItemStack newItemStack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
ItemStack itemStack = slot.getStack();
|
||||
newItemStack = itemStack.copy();
|
||||
|
||||
if (slotIndex < CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS)
|
||||
{
|
||||
if (!this.mergeItemStack(itemStack, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemStack, 0, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return newItemStack;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package com.pahimar.ee3.inventory;
|
||||
|
||||
import com.pahimar.ee3.tileentity.TileAlchemicalChest;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Equivalent-Exchange-3
|
||||
* <p/>
|
||||
* ContainerAlchemicalChestLarge
|
||||
*
|
||||
* @author pahimar
|
||||
*/
|
||||
public class ContainerAlchemicalChestSmall extends Container
|
||||
{
|
||||
private TileAlchemicalChest tileAlchemicalChest;
|
||||
|
||||
private final int CHEST_INVENTORY_ROWS = 4;
|
||||
private final int CHEST_INVENTORY_COLUMNS = 12;
|
||||
|
||||
private final int PLAYER_INVENTORY_ROWS = 3;
|
||||
private final int PLAYER_INVENTORY_COLUMNS = 9;
|
||||
|
||||
public ContainerAlchemicalChestSmall(InventoryPlayer inventoryPlayer, TileAlchemicalChest tileAlchemicalChest)
|
||||
{
|
||||
this.tileAlchemicalChest = tileAlchemicalChest;
|
||||
|
||||
tileAlchemicalChest.openChest();
|
||||
|
||||
// Add the Alchemical Chest slots to the container
|
||||
for (int chestRowIndex = 0; chestRowIndex < CHEST_INVENTORY_ROWS; ++chestRowIndex)
|
||||
{
|
||||
for (int chestColumnIndex = 0; chestColumnIndex < CHEST_INVENTORY_COLUMNS; ++chestColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(tileAlchemicalChest, chestColumnIndex + chestRowIndex * 13, 8 + chestColumnIndex * 18, 8 + chestRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Add the player's inventory slots to the container
|
||||
for (int inventoryRowIndex = 0; inventoryRowIndex < PLAYER_INVENTORY_ROWS; ++inventoryRowIndex)
|
||||
{
|
||||
for (int inventoryColumnIndex = 0; inventoryColumnIndex < PLAYER_INVENTORY_COLUMNS; ++inventoryColumnIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 44 + inventoryColumnIndex * 18, 174 + inventoryRowIndex * 18));
|
||||
}
|
||||
}
|
||||
|
||||
// Add the player's action bar slots to the container
|
||||
for (int actionBarSlotIndex = 0; actionBarSlotIndex < PLAYER_INVENTORY_COLUMNS; ++actionBarSlotIndex)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 44 + actionBarSlotIndex * 18, 232));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer var1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for when the crafting gui is closed.
|
||||
*/
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityPlayer)
|
||||
{
|
||||
super.onContainerClosed(entityPlayer);
|
||||
tileAlchemicalChest.closeChest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex)
|
||||
{
|
||||
ItemStack newItemStack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
ItemStack itemStack = slot.getStack();
|
||||
newItemStack = itemStack.copy();
|
||||
|
||||
if (slotIndex < CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS)
|
||||
{
|
||||
if (!this.mergeItemStack(itemStack, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemStack, 0, CHEST_INVENTORY_ROWS * CHEST_INVENTORY_COLUMNS, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return newItemStack;
|
||||
}
|
||||
}
|
|
@ -9,11 +9,12 @@ package com.pahimar.ee3.lib;
|
|||
*/
|
||||
public class GuiIds
|
||||
{
|
||||
|
||||
public static final int PORTABLE_CRAFTING = 0;
|
||||
public static final int CALCINATOR = 2;
|
||||
public static final int ALUDEL = 3;
|
||||
public static final int ALCHEMICAL_CHEST = 4;
|
||||
public static final int ALCHEMICAL_BAG = 5;
|
||||
public static final int CALCINATOR = 1;
|
||||
public static final int ALUDEL = 2;
|
||||
public static final int ALCHEMICAL_CHEST_SMALL = 3;
|
||||
public static final int ALCHEMICAL_CHEST_MEDIUM = 4;
|
||||
public static final int ALCHEMICAL_CHEST_LARGE = 5;
|
||||
public static final int ALCHEMICAL_BAG = 6;
|
||||
public static final int GLASS_BELL = 7;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,9 @@ public class Textures
|
|||
// GUI textures
|
||||
public static final ResourceLocation GUI_CALCINATOR = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "calcinator.png");
|
||||
public static final ResourceLocation GUI_ALUDEL = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "aludel.png");
|
||||
public static final ResourceLocation GUI_ALCHEMICAL_STORAGE = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "alchemicalStorage.png");
|
||||
public static final ResourceLocation GUI_ALCHEMICAL_STORAGE_SMALL = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "alchemicalStorage_Small.png");
|
||||
public static final ResourceLocation GUI_ALCHEMICAL_STORAGE_MEDIUM = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "alchemicalStorage_Medium.png");
|
||||
public static final ResourceLocation GUI_ALCHEMICAL_STORAGE_LARGE = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "alchemicalStorage_Large.png");
|
||||
public static final ResourceLocation GUI_PORTABLE_CRAFTING = new ResourceLocation("textures/gui/container/crafting_table.png");
|
||||
public static final ResourceLocation GUI_GLASS_BELL = ResourceLocationHelper.getResourceLocation(GUI_SHEET_LOCATION + "glassBell.png");
|
||||
|
||||
|
@ -37,6 +39,11 @@ public class Textures
|
|||
public static final ResourceLocation MODEL_CALCINATOR = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "calcinator.png");
|
||||
public static final ResourceLocation MODEL_ALUDEL = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "aludel.png");
|
||||
public static final ResourceLocation MODEL_ALCHEMICAL_CHEST = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "alchemicalChest.png");
|
||||
|
||||
public static final ResourceLocation MODEL_ALCHEMICAL_CHEST_SMALL = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "alchemicalChest_Small.png");
|
||||
public static final ResourceLocation MODEL_ALCHEMICAL_CHEST_MEDIUM = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "alchemicalChest_Medium.png");
|
||||
public static final ResourceLocation MODEL_ALCHEMICAL_CHEST_LARGE = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "alchemicalChest_Large.png");
|
||||
|
||||
public static final ResourceLocation MODEL_GLASS_BELL = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "aludel.png");
|
||||
public static final ResourceLocation MODEL_RESEARCH_STATION = ResourceLocationHelper.getResourceLocation(MODEL_TEXTURE_LOCATION + "researchStation.png");
|
||||
|
||||
|
|
|
@ -38,7 +38,11 @@ public class TileAlchemicalChest extends TileEE implements IInventory
|
|||
*/
|
||||
private int ticksSinceSync;
|
||||
|
||||
public static final int INVENTORY_SIZE = 13 * 4;
|
||||
public static final int INVENTORY_SIZE = 13 * 9;
|
||||
|
||||
public static final int SMALL_INVENTORY_SIZE = 12 * 4;
|
||||
public static final int MEDIUM_INVENTORY_SIZE = 12 * 7;
|
||||
public static final int LARGE_INVENTORY_SIZE = 13 * 9;
|
||||
|
||||
/**
|
||||
* The ItemStacks that hold the items currently being used in the Alchemical Chest
|
||||
|
@ -46,9 +50,31 @@ public class TileAlchemicalChest extends TileEE implements IInventory
|
|||
private ItemStack[] inventory;
|
||||
|
||||
public TileAlchemicalChest()
|
||||
{
|
||||
this(0);
|
||||
}
|
||||
|
||||
public TileAlchemicalChest(int metaData)
|
||||
{
|
||||
super();
|
||||
inventory = new ItemStack[INVENTORY_SIZE];
|
||||
this.state = (byte) metaData;
|
||||
|
||||
if (metaData == 0)
|
||||
{
|
||||
inventory = new ItemStack[SMALL_INVENTORY_SIZE];
|
||||
}
|
||||
else if (metaData == 1)
|
||||
{
|
||||
inventory = new ItemStack[MEDIUM_INVENTORY_SIZE];
|
||||
}
|
||||
else if (metaData == 2)
|
||||
{
|
||||
inventory = new ItemStack[LARGE_INVENTORY_SIZE];
|
||||
}
|
||||
else
|
||||
{
|
||||
inventory = new ItemStack[SMALL_INVENTORY_SIZE];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Before Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 3.8 KiB |