aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
commitcbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch)
treeb85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui
parentc40416b036c0e89451e1558253ccf07bbee028d0 (diff)
downloadGT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui')
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java103
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java74
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java98
3 files changed, 148 insertions, 127 deletions
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
index c8e4081ee3..c685482266 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
@@ -1,85 +1,98 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import forestry.api.apiculture.IHiveFrame;
-import forestry.core.gui.tooltips.ToolTip;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.slots.SlotFrame;
-import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
+import forestry.api.apiculture.IHiveFrame;
+import forestry.core.gui.tooltips.ToolTip;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.slots.SlotFrame;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
-public class CONTAINER_FrameHousing extends Container {
- public static final int INPUT_1 = 0;
+public class CONTAINER_FrameHousing extends Container
+{
+ private TileAlvearyFrameHousing te;
- private final TileAlvearyFrameHousing te;
- private final ResourceLocation beeFrameIcon = new ResourceLocation(CORE.MODID,
- "textures/items/machine_Charger.png");
- public ToolTip newTip = new ToolTip();
- private final SlotFrame beeFrameSlot;
+ public static final int INPUT_1 = 0;
+ private final ResourceLocation beeFrameIcon = new ResourceLocation(CORE.MODID, "textures/items/machine_Charger.png");
+ public ToolTip newTip = new ToolTip();
+ private final SlotFrame beeFrameSlot;
- private int slotID = 0;
+ private int slotID = 0;
- public CONTAINER_FrameHousing(final TileAlvearyFrameHousing te, final EntityPlayer player) {
+ public CONTAINER_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player)
+ {
this.te = te;
- this.beeFrameSlot = new SlotFrame(te, this.slotID++, 80, 35);
+ this.beeFrameSlot = new SlotFrame(te, slotID++, 80, 35);
- // Fuel Slot A
- this.beeFrameSlot.setBackgroundIconTexture(this.beeFrameIcon);
+ //Fuel Slot A
+ beeFrameSlot.setBackgroundIconTexture(beeFrameIcon);
+
+ addSlotToContainer(beeFrameSlot);
- this.addSlotToContainer(this.beeFrameSlot);
-
- // Inventory
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 9; j++) {
- this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ //Inventory
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 9; j++)
+ {
+ addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
// Hotbar
- for (int i = 0; i < 9; i++) {
- this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ for (int i = 0; i < 9; i++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
- public boolean canInteractWith(final EntityPlayer player) {
- return this.te.isUseableByPlayer(player);
- }
-
- @Override
- public ItemStack transferStackInSlot(final EntityPlayer player, final int slotRaw) {
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
ItemStack stack = null;
- final Slot slot = (Slot) this.inventorySlots.get(slotRaw);
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
- if (slot != null && slot.getHasStack()) {
- final ItemStack stackInSlot = slot.getStack();
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
stack = stackInSlot.copy();
-
- // If your inventory only stores certain instances of Items,
- // you can implement shift-clicking to your inventory like this:
+
+
+ //If your inventory only stores certain instances of Items,
+ //you can implement shift-clicking to your inventory like this:
// Check that the item is the right type
- if (!(stack.getItem() instanceof IHiveFrame)) {
- return null;
+ if (!(stack.getItem() instanceof IHiveFrame)){
+ return null;
}
- if (slotRaw < 1) {
- if (!this.mergeItemStack(stackInSlot, 3 * 9, this.inventorySlots.size(), true)) {
+ if (slotRaw < 1)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
return null;
}
}
- else if (!this.mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
return null;
}
- if (stackInSlot.stackSize == 0) {
- slot.putStack((ItemStack) null);
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
}
- else {
+ else
+ {
slot.onSlotChanged();
}
}
return stack;
}
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return te.isUseableByPlayer(player);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
index 1acbfd534e..dcf8da3a1a 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import org.lwjgl.opengl.GL11;
-
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.client.Minecraft;
@@ -11,41 +9,41 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
-public class GUI_FrameHousing extends GuiContainer {
- private final ResourceLocation texture = new ResourceLocation(CORE.MODID,
- "textures/gui/machine_Charger.png");
-
- private final InventoryPlayer inventory;
- private final TileAlvearyFrameHousing te;
-
- public GUI_FrameHousing(final TileAlvearyFrameHousing te, final EntityPlayer player) {
- super(new CONTAINER_FrameHousing(te, player));
- this.inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- Minecraft.getMinecraft().renderEngine.bindTexture(this.texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- final int x = (this.width - this.xSize) / 2;
- final int y = (this.height - this.ySize) / 2;
-
- this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- }
+import org.lwjgl.opengl.GL11;
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(I18n.format("Alveary Frame Housing"),
- this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format("Alveary Frame Housing")) / 2, 6,
- 4210752, false);
- this.fontRendererObj.drawString(I18n.format(this.inventory.getInventoryName()), 8, this.ySize - 96 + 2,
- 4210752);
- // fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"),
- // 8, ySize - 96 + 2, 4210752);
- // fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"),
- // 80, ySize - 96 + 2, 4210752);
- }
+public class GUI_FrameHousing extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
+
+ private InventoryPlayer inventory;
+ private TileAlvearyFrameHousing te;
+
+ public GUI_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player)
+ {
+ super(new CONTAINER_FrameHousing(te, player));
+ inventory = player.inventory;
+ this.te = te;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ fontRendererObj.drawString(I18n.format("Alveary Frame Housing"), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format("Alveary Frame Housing")) / 2), 6, 4210752, false);
+ fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
+ //fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"), 8, ySize - 96 + 2, 4210752);
+ //fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
index 1c562936bd..9d6dd06f2d 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
@@ -1,111 +1,121 @@
package gtPlusPlus.xmod.forestry.bees.alveary.gui;
-import com.mojang.authlib.GameProfile;
-
-import forestry.api.apiculture.*;
-import forestry.api.core.*;
-import forestry.core.inventory.InventoryAdapterTile;
-import forestry.core.utils.ItemStackUtil;
-import gtPlusPlus.xmod.forestry.bees.alveary.IAlvearyFrameHousing;
-import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
-public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing>
- implements IAlvearyFrameHousing {
+import com.mojang.authlib.GameProfile;
- TileAlvearyFrameHousing alvearyFrame;
+import forestry.api.apiculture.BeeManager;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeHousingInventory;
+import forestry.api.apiculture.IBeeListener;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingLogic;
+import forestry.api.core.EnumHumidity;
+import forestry.api.core.EnumTemperature;
+import forestry.api.core.IErrorLogic;
+import forestry.core.inventory.InventoryAdapterTile;
+import forestry.core.utils.ItemStackUtil;
+import gtPlusPlus.xmod.forestry.bees.alveary.IAlvearyFrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
- public InventoryFrameHousing(final TileAlvearyFrameHousing alvearyFrame) {
+public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing> implements IAlvearyFrameHousing
+{
+
+ TileAlvearyFrameHousing alvearyFrame;
+
+ public InventoryFrameHousing(TileAlvearyFrameHousing alvearyFrame)
+ {
super(alvearyFrame, 1, "FrameHousingInv");
this.alvearyFrame = alvearyFrame;
}
@Override
- public boolean canBlockSeeTheSky() {
- return this.alvearyFrame.canBlockSeeTheSky();
- }
-
- @Override
- public boolean canSlotAccept(final int slotIndex, final ItemStack itemStack) {
+ public boolean canSlotAccept(int slotIndex, ItemStack itemStack)
+ {
return ItemStackUtil.containsItemStack(BeeManager.inducers.keySet(), itemStack);
}
@Override
- public InventoryFrameHousing getAlvearyInventory() {
- return this;
+ public boolean canBlockSeeTheSky() {
+ return alvearyFrame.canBlockSeeTheSky();
}
@Override
public Vec3 getBeeFXCoordinates() {
- return this.alvearyFrame.getBeeFXCoordinates();
+ return alvearyFrame.getBeeFXCoordinates();
}
@Override
public IBeeHousingInventory getBeeInventory() {
- return this.alvearyFrame.getBeeInventory();
+ return alvearyFrame.getBeeInventory();
}
@Override
- public IBeekeepingLogic getBeekeepingLogic() {
- return this.alvearyFrame.getBeekeepingLogic();
+ public Iterable<IBeeListener> getBeeListeners() {
+ return alvearyFrame.getBeeListeners();
}
@Override
- public Iterable<IBeeListener> getBeeListeners() {
- return this.alvearyFrame.getBeeListeners();
+ public Iterable<IBeeModifier> getBeeModifiers() {
+ return alvearyFrame.getBeeModifiers();
}
@Override
- public Iterable<IBeeModifier> getBeeModifiers() {
- return this.alvearyFrame.getBeeModifiers();
+ public IBeekeepingLogic getBeekeepingLogic() {
+ return alvearyFrame.getBeekeepingLogic();
}
@Override
public BiomeGenBase getBiome() {
- return this.alvearyFrame.getBiome();
+ return alvearyFrame.getBiome();
}
@Override
public int getBlockLightValue() {
- return this.alvearyFrame.getBlockLightValue();
+ return alvearyFrame.getBlockLightValue();
}
@Override
- public ChunkCoordinates getCoordinates() {
- return this.alvearyFrame.getCoordinates();
+ public EnumHumidity getHumidity() {
+ return alvearyFrame.getHumidity();
}
@Override
- public IErrorLogic getErrorLogic() {
- return this.alvearyFrame.getErrorLogic();
+ public GameProfile getOwner() {
+ return alvearyFrame.getOwner();
}
@Override
- public EnumHumidity getHumidity() {
- return this.alvearyFrame.getHumidity();
+ public EnumTemperature getTemperature() {
+ return alvearyFrame.getTemperature();
}
@Override
- public GameProfile getOwner() {
- return this.alvearyFrame.getOwner();
+ public World getWorld() {
+ return alvearyFrame.getWorld();
}
@Override
- public EnumTemperature getTemperature() {
- return this.alvearyFrame.getTemperature();
+ public ChunkCoordinates getCoordinates() {
+ return alvearyFrame.getCoordinates();
}
@Override
- public World getWorld() {
- return this.alvearyFrame.getWorld();
+ public IErrorLogic getErrorLogic() {
+ return alvearyFrame.getErrorLogic();
+ }
+
+ @Override
+ public InventoryFrameHousing getAlvearyInventory() {
+ return this;
}
@Override
- public void wearOutFrames(final IBeeHousing beeHousing, final int amount) {
- this.alvearyFrame.wearOutFrames(beeHousing, amount);
+ public void wearOutFrames(IBeeHousing beeHousing, int amount) {
+ alvearyFrame.wearOutFrames(beeHousing, amount);
}
}