diff options
| author | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
|---|---|---|
| committer | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
| commit | 0669f5eb9d5029a8b94ec552171b0837605f7747 (patch) | |
| tree | 6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui | |
| parent | 3654052fb63a571c5eaca7f20714b87c17f7e966 (diff) | |
| download | GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2 GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip | |
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui')
3 files changed, 114 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 5e218667f6..c8e4081ee3 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 @@ -11,88 +11,75 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -public class CONTAINER_FrameHousing extends Container -{ - private TileAlvearyFrameHousing te; +public class CONTAINER_FrameHousing extends Container { + public static final int INPUT_1 = 0; - 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 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; - private int slotID = 0; + private int slotID = 0; - public CONTAINER_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player) - { + public CONTAINER_FrameHousing(final TileAlvearyFrameHousing te, final EntityPlayer player) { this.te = te; - this.beeFrameSlot = new SlotFrame(te, slotID++, 80, 35); + this.beeFrameSlot = new SlotFrame(te, this.slotID++, 80, 35); - //Fuel Slot A - beeFrameSlot.setBackgroundIconTexture(beeFrameIcon); - - addSlotToContainer(beeFrameSlot); + // Fuel Slot A + this.beeFrameSlot.setBackgroundIconTexture(this.beeFrameIcon); - //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)); + 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)); } } // Hotbar - for (int i = 0; i < 9; i++) - { - addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + for (int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); } } @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) - { + public boolean canInteractWith(final EntityPlayer player) { + return this.te.isUseableByPlayer(player); + } + + @Override + public ItemStack transferStackInSlot(final EntityPlayer player, final int slotRaw) { ItemStack stack = null; - Slot slot = (Slot)inventorySlots.get(slotRaw); + final Slot slot = (Slot) this.inventorySlots.get(slotRaw); - if (slot != null && slot.getHasStack()) - { - ItemStack stackInSlot = slot.getStack(); + if (slot != null && slot.getHasStack()) { + final 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 (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) - { + if (slotRaw < 1) { + if (!this.mergeItemStack(stackInSlot, 3 * 9, this.inventorySlots.size(), true)) { return null; } } - else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) - { + else if (!this.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 2a4000ddb4..1acbfd534e 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 @@ -11,39 +11,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 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); - } +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); + } + + @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); + } }
\ 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 6c1b6310f4..1c562936bd 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java @@ -14,100 +14,98 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; -public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing> implements IAlvearyFrameHousing -{ - +public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing> + implements IAlvearyFrameHousing { + TileAlvearyFrameHousing alvearyFrame; - - public InventoryFrameHousing(TileAlvearyFrameHousing alvearyFrame) - { + + public InventoryFrameHousing(final TileAlvearyFrameHousing alvearyFrame) { super(alvearyFrame, 1, "FrameHousingInv"); this.alvearyFrame = alvearyFrame; } @Override - public boolean canSlotAccept(int slotIndex, ItemStack itemStack) - { + public boolean canBlockSeeTheSky() { + return this.alvearyFrame.canBlockSeeTheSky(); + } + + @Override + public boolean canSlotAccept(final int slotIndex, final ItemStack itemStack) { return ItemStackUtil.containsItemStack(BeeManager.inducers.keySet(), itemStack); } @Override - public boolean canBlockSeeTheSky() { - return alvearyFrame.canBlockSeeTheSky(); + public InventoryFrameHousing getAlvearyInventory() { + return this; } @Override public Vec3 getBeeFXCoordinates() { - return alvearyFrame.getBeeFXCoordinates(); + return this.alvearyFrame.getBeeFXCoordinates(); } @Override public IBeeHousingInventory getBeeInventory() { - return alvearyFrame.getBeeInventory(); + return this.alvearyFrame.getBeeInventory(); } @Override - public Iterable<IBeeListener> getBeeListeners() { - return alvearyFrame.getBeeListeners(); + public IBeekeepingLogic getBeekeepingLogic() { + return this.alvearyFrame.getBeekeepingLogic(); } @Override - public Iterable<IBeeModifier> getBeeModifiers() { - return alvearyFrame.getBeeModifiers(); + public Iterable<IBeeListener> getBeeListeners() { + return this.alvearyFrame.getBeeListeners(); } @Override - public IBeekeepingLogic getBeekeepingLogic() { - return alvearyFrame.getBeekeepingLogic(); + public Iterable<IBeeModifier> getBeeModifiers() { + return this.alvearyFrame.getBeeModifiers(); } @Override public BiomeGenBase getBiome() { - return alvearyFrame.getBiome(); + return this.alvearyFrame.getBiome(); } @Override public int getBlockLightValue() { - return alvearyFrame.getBlockLightValue(); - } - - @Override - public EnumHumidity getHumidity() { - return alvearyFrame.getHumidity(); + return this.alvearyFrame.getBlockLightValue(); } @Override - public GameProfile getOwner() { - return alvearyFrame.getOwner(); + public ChunkCoordinates getCoordinates() { + return this.alvearyFrame.getCoordinates(); } @Override - public EnumTemperature getTemperature() { - return alvearyFrame.getTemperature(); + public IErrorLogic getErrorLogic() { + return this.alvearyFrame.getErrorLogic(); } @Override - public World getWorld() { - return alvearyFrame.getWorld(); + public EnumHumidity getHumidity() { + return this.alvearyFrame.getHumidity(); } @Override - public ChunkCoordinates getCoordinates() { - return alvearyFrame.getCoordinates(); + public GameProfile getOwner() { + return this.alvearyFrame.getOwner(); } @Override - public IErrorLogic getErrorLogic() { - return alvearyFrame.getErrorLogic(); + public EnumTemperature getTemperature() { + return this.alvearyFrame.getTemperature(); } @Override - public InventoryFrameHousing getAlvearyInventory() { - return this; + public World getWorld() { + return this.alvearyFrame.getWorld(); } @Override - public void wearOutFrames(IBeeHousing beeHousing, int amount) { - alvearyFrame.wearOutFrames(beeHousing, amount); + public void wearOutFrames(final IBeeHousing beeHousing, final int amount) { + this.alvearyFrame.wearOutFrames(beeHousing, amount); } } |
