Work on Thaumic Apiary. Creating Packet Handler for sending network events (ie queen item stack changes)

Tweaking textures on thaumic apiary again
Adding MORE crap to gitignore
build.gradle missing a runDir argument, apparently.
This commit is contained in:
MysteriousAges committed 2015-03-17 23:03:48 -07:00
1 parent ad9135590d
commit 5d4b84727d
11 files changed
+196 -68

No files matched your search

@@ -13,12 +13,12 @@ public class ContainerMB extends Container
public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart)
{
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
addSlotToContainer(new Slot(inventoryPlayer, x, 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18));
addSlotToContainer(new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18));
}
for (int y = 0; y < PLAYER_INVENTORY_ROWS; y++){
for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){
addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, 8 + 18 * x, yStart + y * 18));
addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18));
}
}
}
@@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
public class ContainerThaumicApiary extends ContainerMB {
private TileEntityThaumicApiary thaumicApiary;
public TileEntityThaumicApiary apiary;
public int maxSlot = 0;
// Constants
@@ -24,12 +24,12 @@ public class ContainerThaumicApiary extends ContainerMB {
private static final int SLOT_INVENTORY_COUNT = 7;
public ContainerThaumicApiary(InventoryPlayer inventoryPlayer, TileEntityThaumicApiary thaumicApiary){
this.thaumicApiary = thaumicApiary;
this.apiary = thaumicApiary;
// Queen/Princess slot
addSlotToContainer(new SlotCustomItems(this.thaumicApiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1)));
addSlotToContainer(new SlotCustomItems(this.apiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1)));
// Drone slot
addSlotToContainer(new SlotCustomItems(this.thaumicApiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64)));
addSlotToContainer(new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64)));
int currentSlot = 1;
@@ -56,7 +56,7 @@ public class ContainerThaumicApiary extends ContainerMB {
j++;
}
addPlayerInventory(inventoryPlayer, 0, 108);
addPlayerInventory(inventoryPlayer, 6, 109);
maxSlot = currentSlot;
@@ -105,13 +105,13 @@ public class ContainerThaumicApiary extends ContainerMB {
@Override
public boolean canInteractWith(EntityPlayer entityPlayer) {
return thaumicApiary.isUseableByPlayer(entityPlayer);
return apiary.isUseableByPlayer(entityPlayer);
}
@Override
public void updateProgressBar(int i, int j) {
thaumicApiary.getGUINetworkData(i, j);
apiary.getGUINetworkData(i, j);
}
@Override
@@ -119,7 +119,7 @@ public class ContainerThaumicApiary extends ContainerMB {
super.detectAndSendChanges();
for (Object crafter : crafters) {
thaumicApiary.sendGUINetworkData(this, (ICrafting) crafter);
apiary.sendGUINetworkData(this, (ICrafting) crafter);
}
}
}
@@ -8,6 +8,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
@@ -17,6 +18,40 @@ public class GuiThaumicApiary extends GuiContainer
private static final int WIDTH = 176;
private static final int HEIGHT = 190;
private static final int LIFEBAR_WIDTH = 2;
private static final int LIFEBAR_HEIGHT = 46;
private static final int LIFEBAR_DEST_X = 21;
private static final int LIFEBAR_DEST_Y = 37;
private static final int LIFEBAR_SRC_Y = 0;
private static final int LIFEBAR_SRC_STAGE1_X = 193;
private static final int LIFEBAR_SRC_STAGE2_X = 189;
private static final int LIFEBAR_SRC_STAGE3_X = 185;
private static final int LIFEBAR_SRC_STAGE4_X = 181;
private static final int LIFEBAR_SRC_STAGE5_X = 177;
private static final int WORKBOOST_WIDTH = 16;
private static final int WORKBOOST_HEIGHT = 12;
private static final int WORKBOOST_DEST_X = 37;
private static final int WORKBOOST_DEST_Y = 18;
private static final int WORKBOOST_SRC_X = 176;
private static final int WORKBOOST_SRC_Y = 46;
private static final int DEATHBOOST_WIDTH = 11;
private static final int DEATHBOOST_HEIGHT = 13;
private static final int DEATHBOOST_DEST_X = 25;
private static final int DEATHBOOST_DEST_Y = 17;
private static final int DEATHBOOST_SRC_X = 176;
private static final int DEATHBOOST_SRC_Y = 58;
private static final int MUTATIONBOOST_WIDTH = 9;
private static final int MUTATIONBOOST_HEIGHT = 13;
private static final int MUTATIONBOOST_DEST_X = 15;
private static final int MUTATIONBOOST_DEST_Y = 17;
private static final int MUTATIONBOOST_SRC_X = 176;
private static final int MUTATIONBOOST_SRC_Y = 71;
public GuiThaumicApiary(InventoryPlayer inventoryPlayer, TileEntityThaumicApiary thaumicApiary) {
super(new ContainerThaumicApiary(inventoryPlayer, thaumicApiary));
@@ -25,12 +60,35 @@ public class GuiThaumicApiary extends GuiContainer
this.ySize = HEIGHT;
}
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
fontRendererObj.drawString("Inventory", 9, 99, 0);
}
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) {
GL11.glColor4f(1, 1, 1, 1);
this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
TileEntityThaumicApiary apiary = ((ContainerThaumicApiary)this.inventorySlots).apiary;
int value = LIFEBAR_HEIGHT - (apiary.getHealthScaled(100) * LIFEBAR_HEIGHT) / 100;
this.drawTexturedModalRect(this.guiLeft + LIFEBAR_DEST_X, this.guiTop + LIFEBAR_DEST_Y,
LIFEBAR_SRC_STAGE1_X, LIFEBAR_SRC_Y, LIFEBAR_WIDTH, value);
if (apiary.isWorkBoosted()) {
this.drawTexturedModalRect(this.guiLeft + WORKBOOST_DEST_X, this.guiTop + WORKBOOST_DEST_Y,
WORKBOOST_SRC_X, WORKBOOST_SRC_Y, WORKBOOST_WIDTH, WORKBOOST_HEIGHT);
}
if (apiary.isDeathRateBoosted()) {
this.drawTexturedModalRect(this.guiLeft + DEATHBOOST_DEST_X, this.guiTop + DEATHBOOST_DEST_Y,
DEATHBOOST_SRC_X, DEATHBOOST_SRC_Y, DEATHBOOST_WIDTH, DEATHBOOST_HEIGHT);
}
if (apiary.isMutationBoosted()) {
this.drawTexturedModalRect(this.guiLeft + MUTATIONBOOST_DEST_X, this.guiTop + MUTATIONBOOST_DEST_Y,
MUTATIONBOOST_SRC_X, MUTATIONBOOST_SRC_Y, MUTATIONBOOST_WIDTH, MUTATIONBOOST_HEIGHT);
}
}
}