aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/forestry/bees/gui
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-10-02 14:44:06 +1000
committerAlkalus <draknyte1@hotmail.com>2017-10-02 14:44:06 +1000
commit04cb1921bd93e91fd526800d0cc36ff4b1df616c (patch)
tree83891415efa34465788935bb1a01dd3db7e80d29 /src/Java/gtPlusPlus/xmod/forestry/bees/gui
parent0a671c03811dce0ed11844cc503db3652c4ee2ef (diff)
downloadGT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.tar.gz
GT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.tar.bz2
GT5-Unofficial-04cb1921bd93e91fd526800d0cc36ff4b1df616c.zip
$ Fixed Toluene handling.
% Adjusted Eglin base Compound slightly. - Disabled new, non-working Forestry content.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/forestry/bees/gui')
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java42
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java52
2 files changed, 94 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java b/src/Java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java
new file mode 100644
index 0000000000..91ab60f8bb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/gui/ContainerBeeHouse.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package gtPlusPlus.xmod.forestry.bees.gui;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import forestry.apiculture.gui.ContainerBeeHelper;
+import forestry.apiculture.gui.IContainerBeeHousing;
+import forestry.apiculture.tiles.TileBeeHousingBase;
+import forestry.core.gui.ContainerTile;
+import forestry.core.network.IForestryPacketClient;
+import forestry.core.network.packets.PacketGuiUpdate;
+
+public class ContainerBeeHouse extends ContainerTile<TileBeeHousingBase> implements IContainerBeeHousing {
+
+ public ContainerBeeHouse(InventoryPlayer player, TileBeeHousingBase tile, boolean hasFrames) {
+ super(tile, player, 8, 108);
+ ContainerBeeHelper.addSlots(this, tile, hasFrames);
+ }
+
+ private int beeProgress = 0;
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+
+ int beeProgress = tile.getBeekeepingLogic().getBeeProgressPercent();
+ if (this.beeProgress != beeProgress) {
+ this.beeProgress = beeProgress;
+ IForestryPacketClient packet = new PacketGuiUpdate(tile);
+ sendPacketToCrafters(packet);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java b/src/Java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java
new file mode 100644
index 0000000000..b510b7a4d6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/gui/GuiBeeHouse.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
+ ******************************************************************************/
+package gtPlusPlus.xmod.forestry.bees.gui;
+
+import net.minecraft.inventory.Container;
+import forestry.apiculture.gui.IContainerBeeHousing;
+import forestry.apiculture.gui.IGuiBeeHousingInventory;
+import forestry.core.config.Constants;
+import forestry.core.gui.GuiForestryTitled;
+import forestry.core.render.EnumTankLevel;
+
+public class GuiBeeHouse<C extends Container & IContainerBeeHousing> extends GuiForestryTitled<C, IGuiBeeHousingInventory> {
+
+ public enum Icon {
+ APIARY("/apiary.png"),
+ BEE_HOUSE("/alveary.png");
+
+ private final String path;
+
+ Icon(String path) {
+ this.path = path;
+ }
+ }
+
+ public GuiBeeHouse(IGuiBeeHousingInventory tile, C container, Icon icon) {
+ super(Constants.TEXTURE_PATH_GUI + icon.path, container, tile);
+ ySize = 190;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
+ super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
+
+ drawHealthMeter(guiLeft + 20, guiTop + 37, inventory.getHealthScaled(46), EnumTankLevel.rateTankLevel(inventory.getHealthScaled(100)));
+ }
+
+ private void drawHealthMeter(int x, int y, int height, EnumTankLevel rated) {
+ int i = 176 + rated.getLevelScaled(16);
+ int k = 0;
+
+ this.drawTexturedModalRect(x, y + 46 - height, i, k + 46 - height, 4, height);
+ }
+
+}