aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/gui
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2023-09-04 03:05:22 +0100
committerGitHub <noreply@github.com>2023-09-04 03:05:22 +0100
commit76719d65a90d98e228a914774d3b11ed9f01ac8e (patch)
treece0d35f954e441e9cc4aa95aa347073728e6f4ee /src/main/java/gtPlusPlus/core/gui
parent0393b582eb3edcb5c575330804b6747577a55e27 (diff)
downloadGT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.gz
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.bz2
GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.zip
Clean-up v2 (#729)
* Remove test items from NEI with no texture * Add number formatting to hand pumps * Remove heavy plates (no recipes & completely unused). * Remove helium generator (no texture, no recipe) * Remove fire pit and fire starter (no use, no recipe, no textures) * Remove giant chicken and associated unused stuff, has no texture and is unobtainable. Used to be relevant but isn't anymore. * Remove villagers with silly trades like 1 motor + 1 hull = 1 hull. Why? * Remove trade bench, no recipe, missing textures. Unused. * Remove farm processors, no texture, no recipe. Unused. * Remove MAX tier components, these exist in GT now, have no recipe here and are unused. * Hide untextured light block from NEI * Update buildscript * Remove unused backpacks, no recipe and contains dupe bugs. Bad. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. * Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. part 2 * Remove dragon catcher (what?), no texture, no recipe, unused. * Remove empty item, does nothing, has no recipe, no idea why it is here. * Empty item v2 removal * Revert "Empty item v2 removal" This reverts commit 75bcd3ccfaf55bbfe2c12b2e4167d5c37636030d. * Revert "Remove empty item, does nothing, has no recipe, no idea why it is here." This reverts commit e41a9f484392776331c58530ab1faa5ef978ef36. * Remove debug square. No recipe, unused. * Number formatting overflow covers * Remove JVM garbage collection block. Unused, no recipe. * Remove nanotubes, no recipe for them. Unused. * Remove "git" item, doesn't seem to work. Has no recipe. * Remove uncraftable food with awful textures. * Remove "bat king" mob, unused content. Does not spawn. * Remove uncraftable doors with bad textures. Unused content. * Remove uncraftable, unlocalised redstone stuff that crashes game when placed. * Remove weird spawner item. No recipe, does not exist in world. * Remove sunnarium bit, no recipe, no usage. * Remove unused modularity table and some misc uncraftable, unused items. * Remove Interconnecting Storage Crate, no recipe, unused. * Delete worse debug power gen, this already exists as part of GT. Unneeded duplication. * Delete unused placeholder circuit * Delete uncraftable generator hatches. * Spotless * Remove XP tank thing, unused and uncraftable. * Remove null item, this fluid registry only seemed to register one null fluid. All others exist? * Remove EU -> RF battery. Unused in GTNH. * Remove some shelf nonsense, why is this in this mod? * Remove some weird random tools. These have no realistic usage in GTNH. * Remove firemaker. Useless in GTNH. * Removed helium blob. Deprecated item, not used anymore, uncraftable. * spotlessApply (#730) Co-authored-by: GitHub GTNH Actions <> * Stop modulators generating unused blocks with no textures * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove more unused untextured casings * Remove some weird methods and uncraftable mining parts, probably part of deprecated multiblock. * spotlessApply (#732) Co-authored-by: GitHub GTNH Actions <> * Remove gem shards, unused. * Remove unused atoms * Remove unused gum * Remove unused elements/materials * Bye bye * Remove some unused reflection stuff * Remove control cores, obsolete now. * Remove mob killing thing with no texture and no recipe. * Remove uncraftable covers * Remove pizza gloves * Net and rope removal, unused * Remove force crop * Removal of some old event stuff * Remove unused nuclear chem items * Remove player safe, mostly because of the horrible event code that was intercepting every block break. I can't see any real usage of this via discord. * Remove Force material and associated other nonsense. Also remove some nuclear chem stuff. * Remove force for realsies * Skookum Chooker purge. * Remove some enderio compat, these plates/dusts are added via GT5 anyway now. This is obsolete. * spotlessApply (#733) Co-authored-by: GitHub GTNH Actions <> * Unused textures * Bump dep * Revert "Remove force for realsies" This reverts commit 0d288912a99f9dabce56d2a2623d4d3510f4804e. * Revert "Remove Force material and associated other nonsense. Also remove some nuclear chem stuff." This reverts commit 3455e6e916defe1f2aef923be6f9696a6cf3095b. * Remove nuclear items that are unused * spotlessApply (#734) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Connor Colenso <colen@CONNORSPC> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/core/gui')
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java125
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java589
-rw-r--r--src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java513
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java57
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java40
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java79
-rw-r--r--src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java53
7 files changed, 0 insertions, 1456 deletions
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
deleted file mode 100644
index ad5ec7deaa..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.OpenGlHelper;
-import net.minecraft.client.renderer.RenderHelper;
-import net.minecraft.client.renderer.entity.RenderManager;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-
-import gtPlusPlus.core.container.Container_BackpackBase;
-import gtPlusPlus.core.inventories.BaseInventoryBackpack;
-
-public class GuiBaseBackpack extends GuiContainer {
-
- /**
- * x and y size of the inventory window in pixels. Defined as float, passed as int These are used for drawing the
- * player model.
- */
- private float xSize_lo;
-
- private float ySize_lo;
-
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
-
- /**
- * ResourceLocation takes 2 parameters: ModId, path to texture at the location: "src/minecraft/assets/modid/"
- *
- * I have provided a sample texture file that works with this tutorial. Download it from
- * Forge_Tutorials/textures/gui/
- */
- private static final ResourceLocation iconLocation = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/itemBackpack.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryBackpack inventory;
-
- public GuiBaseBackpack(final Container_BackpackBase containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int par1, final int par2, final float par3) {
- super.drawScreen(par1, par2, par3);
- this.xSize_lo = par1;
- this.ySize_lo = par2;
- }
-
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- final String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName()
- : this.inventory.getInventoryName();
- // this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
- // this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- final int i1;
- drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75) - 50 - this.ySize_lo, this.mc.thePlayer);
- }
-
- /**
- * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can
- * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code)
- */
- public static void drawPlayerModel(final int x, final int y, final int scale, final float yaw, final float pitch,
- final EntityLivingBase entity) {
- GL11.glEnable(GL11.GL_COLOR_MATERIAL);
- GL11.glPushMatrix();
- GL11.glTranslatef(x, y, 50.0F);
- GL11.glScalef(-scale, scale, scale);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- final float f2 = entity.renderYawOffset;
- final float f3 = entity.rotationYaw;
- final float f4 = entity.rotationPitch;
- final float f5 = entity.prevRotationYawHead;
- final float f6 = entity.rotationYawHead;
- GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
- RenderHelper.enableStandardItemLighting();
- GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
- entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
- entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
- entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
- entity.rotationYawHead = entity.rotationYaw;
- entity.prevRotationYawHead = entity.rotationYaw;
- GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
- RenderManager.instance.playerViewY = 180.0F;
- RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
- entity.renderYawOffset = f2;
- entity.rotationYaw = f3;
- entity.rotationPitch = f4;
- entity.prevRotationYawHead = f5;
- entity.rotationYawHead = f6;
- GL11.glPopMatrix();
- RenderHelper.disableStandardItemLighting();
- GL11.glDisable(GL12.GL_RESCALE_NORMAL);
- OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
- GL11.glDisable(GL11.GL_TEXTURE_2D);
- OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
deleted file mode 100644
index 3b51810e3a..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiBaseGrindle.java
+++ /dev/null
@@ -1,589 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiScreenBook;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.recipe.common.CI;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-
-public class GuiBaseGrindle extends GuiContainer {
-
- /** The FontRenderer used by GuiScreen */
- protected FontRenderer fontRenderer;
-
- private GrindleGuiButton mButtonNextPage;
- private GrindleGuiButton mButtonPreviousPage;
- private String[][] mPageDataArray;
- private short mCurrentPage = 0;
-
- private static final ResourceLocation iconLocation = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiBaseGrindle(final Container_Grindle containerItem) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int par1, final int par2, final float par3) {
- super.drawScreen(par1, par2, par3);
- this.updateButtons();
- }
-
- /**
- * Draw the foreground layer for the GuiContainer (everything in front of the items)
- */
- @Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
-
- try {
-
- // Title
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Gregtech Information Transponder", new Object[0]),
- 0,
- -12,
- Utils.rgbtoHexValue(255, 255, 255));
- ItemStack aStack = this.inventory.getStackInSlot(0);
-
- if (aStack != null) {
-
- GrindleData aDataCurrent = new GrindleData(aStack);
-
- if (aDataCurrent.mValid) {
-
- // Debug NBT Information
- // NBTUtils.tryIterateNBTData(aStack);
-
- this.fontRendererObj
- .drawString(I18n.format(aDataCurrent.mTitle), 10, 8, Utils.rgbtoHexValue(125, 255, 125));
-
- int tTier = aDataCurrent.mExtraInformation;
- if (tTier >= 0) {
- // Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mTierDim + " | Page: " + this.mCurrentPage, new Object[0]),
- 10,
- 18,
- Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 23,
- Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mPosInfo, new Object[0]),
- 10,
- 29,
- Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 35,
- Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
-
- int posOuter = 0;
- int posInner = 0;
-
- mPageDataArray = new String[MathUtils
- .roundToClosestInt(Math.ceil(aDataCurrent.mListData.size() / 9.00))][9];
- for (String e : aDataCurrent.mListData) {
- if (e != null) {
- mPageDataArray[posInner][posOuter] = e;
- if (posOuter < 8) {
- posOuter++;
- } else {
- posOuter = 0;
- posInner++;
- }
- } else {
- continue;
- }
- }
-
- String[] aCurrentPage = mPageDataArray[this.mCurrentPage];
-
- if (aCurrentPage != null) {
- // Logger.INFO("valid Current page " + this.mCurrentPage);
- if (aCurrentPage.length > 0) {
- for (int i = 0; i < aCurrentPage.length; i++) {
- if ((aLastYUsed + 9) <= (68 + 56)) {
- String aCP = aCurrentPage[i];
- // Logger.INFO("Printing "+aCP);
- if (aCP != null && aCP.length() > 0) {
- if (!aCP.toLowerCase().contains("empty")
- && !aCP.toLowerCase().contains("null")) {
- this.fontRendererObj.drawString(
- I18n.format(aCP),
- 10,
- aLastYUsed,
- Utils.rgbtoHexValue(125, 255, 125));
- aLastYUsed += 9;
- }
- }
- }
- }
- }
- }
-
- }
-
- // Non-Prospecting Data
- else {
- // Draw the GUI
- // List prospection
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mTierDim, new Object[0]),
- 10,
- 18,
- Utils.rgbtoHexValue(125, 255, 125));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 23,
- Utils.rgbtoHexValue(125, 125, 255));
- // Pos data
- this.fontRendererObj.drawString(
- I18n.format(aDataCurrent.mPosInfo, new Object[0]),
- 10,
- 29,
- Utils.rgbtoHexValue(125, 125, 255));
- // Divider
- this.fontRendererObj.drawString(
- I18n.format("-------------------", new Object[0]),
- 10,
- 35,
- Utils.rgbtoHexValue(125, 125, 255));
- int aLastYUsed = 41;
- /*
- * for (int i=0;i<aDataCurrent.mListData.size();i++) { if ((aLastYUsed + 9) <= (68 + 56)) {
- * this.fontRendererObj.drawString(I18n.format(aDataCurrent.mListData.get(i), new Object[0]),
- * 10, aLastYUsed, Utils.rgbtoHexValue(125, 255, 125)); aLastYUsed = aLastYUsed + 9; } }
- */
- }
- } else {
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Invalid data item stored in slot.", new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(255, 125, 125));
- }
- } else {
- // Valid Datastick?
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("Insert device into port.", new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(255, 125, 125));
- this.mPageDataArray = new String[][] { {} };
- this.mCurrentPage = 0;
- }
-
- // Inventory Label
- this.fontRendererObj.drawStringWithShadow(
- I18n.format("container.inventory", new Object[0]),
- 8,
- 131,
- Utils.rgbtoHexValue(255, 255, 255));
-
- } catch (Throwable t) {
- Logger.INFO("GUI CRASH - " + t);
- t.printStackTrace();
- }
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @SuppressWarnings("unchecked")
- @Override
- public void initGui() {
- super.initGui();
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
- final int k = (this.width - this.xSize) - (this.width / 16);
- this.mButtonNextPage = new GrindleGuiButton(1, k, 155, true);
- this.mButtonPreviousPage = new GrindleGuiButton(2, k - 20, 155, false);
- this.buttonList.add(this.mButtonNextPage);
- this.buttonList.add(this.mButtonPreviousPage);
- this.mCurrentPage = 0;
- this.updateButtons();
- }
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- this.mCurrentPage = 0;
- super.onGuiClosed();
- }
-
- private void updateButtons() {
- if (this.mCurrentPage >= 0) {
- if (this.mPageDataArray != null) {
- if (this.mCurrentPage < (this.mPageDataArray.length - 1)) {
- this.mButtonNextPage.visible = true;
- } else {
- this.mButtonNextPage.visible = false;
- }
- } else {
- this.mButtonNextPage.visible = false;
- }
- }
- if (this.mCurrentPage > 0) {
- this.mButtonPreviousPage.visible = true;
- } else {
- this.mButtonPreviousPage.visible = false;
- }
- }
-
- /**
- * Scrolling Related
- */
- @Override
- protected void actionPerformed(GuiButton aButton) {
- if (aButton.enabled && aButton.visible) {
- if (aButton.id == 1) {
- if (this.mCurrentPage < this.mPageDataArray.length - 1) {
- ++this.mCurrentPage;
- }
- } else if (aButton.id == 2) {
- if (this.mCurrentPage > 0) {
- --this.mCurrentPage;
- }
- }
- this.updateButtons();
- }
- }
-
- /**
- * Handles mouse input.
- */
- @Override
- public void handleMouseInput() {
- super.handleMouseInput();
- int i = Mouse.getEventDWheel();
- /*
- * if (i != 0) { this.currentScroll = (float) ((double) this.currentScroll - (double) i / (double) j); if
- * (this.currentScroll < 0.0F) { this.currentScroll = 0.0F; } if (this.currentScroll > 1.0F) {
- * this.currentScroll = 1.0F; } this.scrollTo(this.currentScroll); }
- */
- }
-
- /**
- * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is
- * mouseMove, which==0 or which==1 is mouseUp
- */
- @Override
- protected void mouseMovedOrUp(int p_146286_1_, int p_146286_2_, int p_146286_3_) {
- /*
- * if (p_146286_3_ == 0) { int l = p_146286_1_ - this.guiLeft; int i1 = p_146286_2_ - this.guiTop;
- * CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; int j1 = acreativetabs.length; for (int k1 = 0;
- * k1 < j1; ++k1) { CreativeTabs creativetabs = acreativetabs[k1]; if (creativetabs != null &&
- * this.func_147049_a(creativetabs, l, i1)) { this.setCurrentCreativeTab(creativetabs); return; } } }
- */
-
- super.mouseMovedOrUp(p_146286_1_, p_146286_2_, p_146286_3_);
- }
-
- /**
- * Allows Mouseover Tooltips
- */
- @Override
- protected void renderToolTip(ItemStack aStack, int p_146285_2_, int p_146285_3_) {
- super.renderToolTip(aStack, p_146285_2_, p_146285_3_);
- }
-
- /**
- * Custom Buttons
- */
- @SideOnly(Side.CLIENT)
- static class GrindleGuiButton extends GuiButton {
-
- public static final ResourceLocation mBookTexture;
-
- static {
- ResourceLocation r;
- try {
- r = (ResourceLocation) ReflectionUtils.getField(GuiScreenBook.class, "bookGuiTextures").get(null);
-
- } catch (IllegalArgumentException | IllegalAccessException e) {
- r = new ResourceLocation("textures/gui/book.png");
- }
- mBookTexture = r;
- }
-
- private final boolean aPageForward;
-
- public GrindleGuiButton(int aID, int aX, int aY, boolean aForwards) {
- this(aID, aX, aY, 20, 12, aForwards);
- }
-
- public GrindleGuiButton(int aID, int aX, int aY, int aWidth, int aHeight, boolean aForwards) {
- super(aID, aX, aY, aWidth, aHeight, "");
- this.aPageForward = aForwards;
- }
-
- /**
- * Draws this button to the screen.
- */
- @Override
- public void drawButton(Minecraft aGame, int aX, int aY) {
- if (this.visible) {
- boolean flag = aX >= this.xPosition && aY >= this.yPosition
- && aX < this.xPosition + this.width
- && aY < this.yPosition + this.height;
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- aGame.getTextureManager().bindTexture(iconLocation);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.aPageForward) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 22, 12);
- }
- }
- }
-
- public static class GrindleData {
-
- public static enum GrindleMode {
-
- PROSPECTING(0),
- ELEMENT(1);
-
- private final int aModeID;
-
- private GrindleMode(final int aMode) {
- this.aModeID = aMode;
- }
-
- public int getMode() {
- return this.aModeID;
- }
- }
-
- final boolean mValid;
- final ItemStack mStack;
- final String mTitle, mPosInfo, mTierDim;
- final AutoMap<String> mListData;
- final GrindleMode mMode;
- final int mExtraInformation;
-
- public GrindleData(ItemStack iStack) {
-
- if (iStack == null) {
- mValid = false;
- mStack = null;
- mTitle = null;
- mListData = null;
- mMode = null;
- mExtraInformation = 0;
- this.mTierDim = "";
- this.mPosInfo = "";
- } else {
-
- this.mStack = iStack;
-
- int aType = -1;
- boolean isProspecting = false;
-
- // If Input stack is a Data stick/Orb, set a valid type.
- if (GT_Utility.areStacksEqual(iStack, CI.getDataStick(), true)) {
- aType = 0;
- } else if (GT_Utility.areStacksEqual(iStack, CI.getDataOrb(), true)) {
- aType = 1;
- }
-
- NBTTagCompound tNBT = iStack.getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
-
- mTitle = tNBT.hasKey("title") ? tNBT.getString("title")
- : (aType == 0 ? "Empty Data Stick" : (aType == 1 ? "Empty Data Orb" : "Unknown Item"));
- if (mTitle.toLowerCase().contains("raw prospection data")) {
- isProspecting = true;
- }
-
- byte tTier = -1;
- if (isProspecting) {
- if (!tNBT.hasKey("prospection_tier") && tNBT.hasKey("prospection")) {
- tTier = 0;
- } else if (tNBT.hasKey("prospection_tier") && !tNBT.hasKey("prospection")) {
- tTier = tNBT.getByte("prospection_tier");
- }
- }
-
- mExtraInformation = isProspecting ? tTier : -1;
-
- if (tTier >= 0) {
- String xPos, yPos, zPos, aDim;
- String aPositionString, aInfoString;
- Set<String> aOreTypes = new LinkedHashSet<String>();
- Set<String> aOilTypes = new LinkedHashSet<String>();
-
- // Set variables that are shared between prospection types.
- if (tTier == 0) {
- String tData = tNBT.getString("prospection");
- String[] tDataArray = tData.split(",");
- xPos = tDataArray[0];
- yPos = tDataArray[1];
- zPos = tDataArray[2];
- aDim = tDataArray[3];
- aOilTypes.add("Oil Type: " + tDataArray[5]);
- aOilTypes.add("--------------------");
- aOreTypes.add("Ore Types: ");
- for (int i = 6; tDataArray.length > i; i++) {
- aOreTypes.add("-" + tDataArray[i]);
- }
- } else {
- String tPos = tNBT.getString("prospection_pos");
- String[] tPosData = tPos.split(" ");
- xPos = tPosData[1];
- yPos = tPosData[3];
- zPos = tPosData[5];
- aDim = tPosData[7];
- // Oil
- String tOil = tNBT.getString("prospection_oils");
- String[] tOilData = tOil.split("\\|");
- if (tOilData.length > 0) {
- aOilTypes.add("Oil Types:");
- for (String s : tOilData) {
- if (s != null) {
- aOilTypes.add(s);
- }
- }
- aOilTypes.add("--------------------");
- }
-
- // Near
- String tOresNear = tNBT.getString("prospection_near");
- String[] tOresNearData = tOresNear.split("\\|");
- // Middle
- String tOresMid = tNBT.getString("prospection_middle");
- String[] tOresMidData = tOresMid.split("\\|");
- // Far
- String tOresFar = tNBT.getString("prospection_far");
- String[] tOresFarData = tOresFar.split("\\|");
-
- if ((tOresNearData.length + tOresMidData.length + tOresFarData.length) > 0) {
- aOreTypes.add("Ore Types:");
- if (tOresNearData.length > 0) {
- for (String s : tOresNearData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Near");
- }
- }
- }
- if (tOresMidData.length > 0) {
- for (String s : tOresMidData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Mid");
- }
- }
- }
- if (tOresFarData.length > 0) {
- for (String s : tOresFarData) {
- if (s != null) {
- aOreTypes.add("-" + s + " - Far");
- }
- }
- }
- }
- }
-
- mListData = new AutoMap<String>();
- if (aOilTypes.size() > 0) {
- for (String aOils : aOilTypes) {
- if (aOils != null && aOils.length() > 0) {
- mListData.put(aOils);
- }
- }
- }
-
- if (aOreTypes.size() > 0) {
- for (String aOres : aOreTypes) {
- if (aOres != null && aOres.length() > 0) {
- mListData.put(aOres);
- }
- }
- }
-
- // Set Types
- mMode = GrindleMode.PROSPECTING;
- this.mTierDim = (aInfoString = "Tier: " + tTier + " | Dim: " + aDim);
- this.mPosInfo = (aPositionString = "X:" + xPos + ", Y:" + yPos + ", Z:" + zPos);
- this.mValid = true;
- }
-
- // Non-Prospectic Data
- else {
- mValid = true;
- mListData = null;
- mMode = GrindleMode.ELEMENT;
- this.mTierDim = "PLACEHOLDER";
- this.mPosInfo = "PLACEHOLDER";
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java b/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
deleted file mode 100644
index 01bf98d9bf..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/item/GuiScreenGrindle.java
+++ /dev/null
@@ -1,513 +0,0 @@
-package gtPlusPlus.core.gui.item;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-import net.minecraft.network.PacketBuffer;
-import net.minecraft.network.play.client.C17PacketCustomPayload;
-import net.minecraft.util.ChatAllowedCharacters;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.ResourceLocation;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.container.Container_Grindle;
-import gtPlusPlus.core.inventories.BaseInventoryGrindle;
-import gtPlusPlus.core.item.ModItems;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.minecraft.NBTUtils;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
-
-@SideOnly(Side.CLIENT)
-public class GuiScreenGrindle extends GuiContainer {
-
- private static final Logger logger = LogManager.getLogger();
- private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png");
- /** The player editing the book */
- private final EntityPlayer editingPlayer;
-
- private final ItemStack bookObj;
- /** Whether the book is signed or can still be edited */
- private final boolean bookIsUnsigned;
-
- private boolean field_146481_r;
- private boolean field_146480_s;
- /** Update ticks since the gui was opened */
- private int updateCount;
-
- private final int bookImageWidth = 192;
- private final int bookImageHeight = 192;
- private int bookTotalPages = 1;
- private int currPage;
- private NBTTagList bookPages;
- private String bookTitle = "";
- private GuiScreenGrindle.NextPageButton buttonNextPage;
- private GuiScreenGrindle.NextPageButton buttonPreviousPage;
- private GuiButton buttonDone;
- /** The GuiButton to sign this book. */
- private GuiButton buttonSign;
-
- private GuiButton buttonFinalize;
- private GuiButton buttonCancel;
-
- // Texture
- private static final ResourceLocation iconLocation = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/itemGrindle.png");
-
- /** The inventory to render on screen */
- private final BaseInventoryGrindle inventory;
-
- public GuiScreenGrindle(final Container_Grindle containerItem, final EntityPlayer player) {
- super(containerItem);
- this.inventory = containerItem.inventory;
- this.editingPlayer = player;
- this.bookObj = this.inventory.getStackInSlot(0);
- this.bookIsUnsigned = (this.bookObj == null ? true : false);
-
- if (this.bookObj != null) {
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- this.bookPages = nbttagcompound.getTagList("pages", 8);
-
- if (this.bookPages != null) {
- this.bookPages = (NBTTagList) this.bookPages.copy();
- this.bookTotalPages = this.bookPages.tagCount();
-
- if (this.bookTotalPages < 1) {
- this.bookTotalPages = 1;
- }
- }
- }
-
- if ((this.bookPages == null) && this.bookIsUnsigned) {
- this.bookPages = new NBTTagList();
- this.bookPages.appendTag(new NBTTagString(""));
- this.bookTotalPages = 1;
- }
- }
- }
-
- /**
- * Called from the main game loop to update the screen.
- */
- @Override
- public void updateScreen() {
- super.updateScreen();
- ++this.updateCount;
- }
-
- /**
- * Adds the buttons (and other controls) to the screen in question.
- */
- @Override
- @SuppressWarnings("unchecked")
- public void initGui() {
- this.buttonList.clear();
- Keyboard.enableRepeatEvents(true);
-
- if (this.bookIsUnsigned) {
- this.buttonList.add(
- this.buttonSign = new GuiButton(
- 3,
- (this.width / 2) - 100,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("book.signButton", new Object[0])));
- this.buttonList.add(
- this.buttonDone = new GuiButton(
- 0,
- (this.width / 2) + 2,
- this.bookImageHeight - 4,
- 98,
- 20,
- I18n.format("gui.close", new Object[0])));
- this.buttonList.add(
- this.buttonFinalize = new GuiButton(
- 5,
- (this.width / 2) - 100,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("book.finalizeButton", new Object[0])));
- this.buttonList.add(
- this.buttonCancel = new GuiButton(
- 4,
- (this.width / 2) + 2,
- 4 + this.bookImageHeight,
- 98,
- 20,
- I18n.format("gui.cancel", new Object[0])));
- } else {
- this.buttonList.add(
- this.buttonDone = new GuiButton(
- 0,
- (this.width / 2) - 100,
- this.bookImageHeight + 100,
- 200,
- 20,
- I18n.format("gui.done", new Object[0])));
- }
-
- final int i = (this.width - this.bookImageWidth) / 2;
- final byte b0 = 2;
- this.buttonList.add(this.buttonNextPage = new GuiScreenGrindle.NextPageButton(1, i + 120, b0 + 154, true));
- this.buttonList.add(this.buttonPreviousPage = new GuiScreenGrindle.NextPageButton(2, i + 38, b0 + 154, false));
- this.updateButtons();
- }
-
- /**
- * Called when the screen is unloaded. Used to disable keyboard repeat events
- */
- @Override
- public void onGuiClosed() {
- Keyboard.enableRepeatEvents(false);
- }
-
- private void updateButtons() {
- this.buttonNextPage.visible = !this.field_146480_s
- && ((this.currPage < (this.bookTotalPages - 1)) || this.bookIsUnsigned);
- this.buttonPreviousPage.visible = !this.field_146480_s && (this.currPage > 0);
- this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s;
-
- if (this.bookIsUnsigned) {
- this.buttonSign.visible = !this.field_146480_s;
- this.buttonCancel.visible = this.field_146480_s;
- this.buttonFinalize.visible = this.field_146480_s;
- this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0;
- }
- }
-
- private void sendBookToServer(final boolean p_146462_1_) {
- if (this.bookIsUnsigned && this.field_146481_r) {
- if (this.bookPages != null) {
- String s;
-
- while (this.bookPages.tagCount() > 1) {
- s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1);
-
- if (s.length() != 0) {
- break;
- }
-
- this.bookPages.removeTag(this.bookPages.tagCount() - 1);
- }
-
- if (this.bookObj.hasTagCompound()) {
- final NBTTagCompound nbttagcompound = this.bookObj.getTagCompound();
- nbttagcompound.setTag("pages", this.bookPages);
- } else {
- this.bookObj.setTagInfo("pages", this.bookPages);
- }
-
- s = "MC|BEdit";
-
- if (p_146462_1_) {
- s = "MC|BSign";
- this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName()));
- this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim()));
- this.bookObj.func_150996_a(ModItems.itemGrindleTablet);
- }
-
- final ByteBuf bytebuf = Unpooled.buffer();
-
- try {
- (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj);
- this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf));
- } catch (final Exception exception) {
- logger.error("Couldn\'t send book info", exception);
- } finally {
- bytebuf.release();
- }
- }
- }
- }
-
- @Override
- protected void actionPerformed(final GuiButton button) {
- if (button.enabled) {
- if (button.id == 0) {
- this.mc.displayGuiScreen((GuiScreen) null);
- this.sendBookToServer(false);
- } else if ((button.id == 3) && this.bookIsUnsigned) {
- this.field_146480_s = true;
- } else if (button.id == 1) {
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- } else if (this.bookIsUnsigned) {
- this.addNewPage();
-
- if (this.currPage < (this.bookTotalPages - 1)) {
- ++this.currPage;
- }
- }
- } else if (button.id == 2) {
- if (this.currPage > 0) {
- --this.currPage;
- }
- } else if ((button.id == 5) && this.field_146480_s) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- } else if ((button.id == 4) && this.field_146480_s) {
- this.field_146480_s = false;
- }
-
- this.updateButtons();
- }
- }
-
- private void addNewPage() {
- if ((this.bookPages != null) && (this.bookPages.tagCount() < 50)) {
- this.bookPages.appendTag(new NBTTagString(""));
- ++this.bookTotalPages;
- this.field_146481_r = true;
- }
- }
-
- /**
- * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
- */
- @Override
- protected void keyTyped(final char p_73869_1_, final int p_73869_2_) {
- super.keyTyped(p_73869_1_, p_73869_2_);
-
- if (this.bookIsUnsigned) {
- if (this.field_146480_s) {
- this.func_146460_c(p_73869_1_, p_73869_2_);
- } else {
- this.keyTypedInBook(p_73869_1_, p_73869_2_);
- }
- }
- }
-
- /**
- * Processes keystrokes when editing the text of a book
- */
- private void keyTypedInBook(final char p_146463_1_, final int p_146463_2_) {
- switch (p_146463_1_) {
- case 22:
- this.func_146459_b(GuiScreen.getClipboardString());
- return;
- default:
- switch (p_146463_2_) {
- case 14:
- final String s = this.func_146456_p();
-
- if (s.length() > 0) {
- this.func_146457_a(s.substring(0, s.length() - 1));
- }
-
- return;
- case 28:
- case 156:
- this.func_146459_b("\n");
- return;
- default:
- if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) {
- this.func_146459_b(Character.toString(p_146463_1_));
- }
- }
- }
- }
-
- private void func_146460_c(final char p_146460_1_, final int p_146460_2_) {
- switch (p_146460_2_) {
- case 14:
- if (!this.bookTitle.isEmpty()) {
- this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1);
- this.updateButtons();
- }
-
- return;
- case 28:
- case 156:
- if (!this.bookTitle.isEmpty()) {
- this.sendBookToServer(true);
- this.mc.displayGuiScreen((GuiScreen) null);
- }
-
- return;
- default:
- if ((this.bookTitle.length() < 16) && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) {
- this.bookTitle = this.bookTitle + Character.toString(p_146460_1_);
- this.updateButtons();
- this.field_146481_r = true;
- }
- }
- }
-
- private String func_146456_p() {
- return (this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())
- ? this.bookPages.getStringTagAt(this.currPage)
- : "";
- }
-
- private void func_146457_a(final String p_146457_1_) {
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_));
- this.field_146481_r = true;
- }
- }
-
- private void func_146459_b(final String p_146459_1_) {
- final String s1 = this.func_146456_p();
- final String s2 = s1 + p_146459_1_;
- final int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118);
-
- if ((i <= 118) && (s2.length() < 256)) {
- this.func_146457_a(s2);
- }
- }
-
- /**
- * Draws the screen and all the components in it.
- */
- @Override
- public void drawScreen(final int p_73863_1_, final int p_73863_2_, final float p_73863_3_) {
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l2 = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l2, 0, 0, this.xSize, this.ySize);
-
- // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- // this.mc.getTextureManager().bindTexture(iconLocation);
- // final int k = (this.width - this.bookImageWidth) / 2;
- // this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth,
- // this.bookImageHeight);
-
- String s;
- String s1;
- int l;
- final byte b0 = 2;
-
- if (this.inventory.getStackInSlot(0) != null) {
- this.fontRendererObj.drawString(
- I18n.format("" + NBTUtils.getBookTitle(this.inventory.getStackInSlot(0)), new Object[0]),
- 10,
- 8,
- Utils.rgbtoHexValue(125, 255, 125));
- }
-
- if (this.field_146480_s) {
- s = this.bookTitle;
-
- if (this.bookIsUnsigned) {
- if (((this.updateCount / 6) % 2) == 0) {
- s = s + "" + EnumChatFormatting.BLACK + "_";
- } else {
- s = s + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- s1 = I18n.format("book.editTitle", new Object[0]);
- l = this.fontRendererObj.getStringWidth(s1);
- this.fontRendererObj.drawString(s1, k + 36 + ((116 - l) / 2), b0 + 16 + 16, 0);
- final int i1 = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, k + 36 + ((116 - i1) / 2), b0 + 48, 0);
- final String s2 = I18n.format("book.byAuthor", new Object[] { this.editingPlayer.getCommandSenderName() });
- final int j1 = this.fontRendererObj.getStringWidth(s2);
- this.fontRendererObj
- .drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + ((116 - j1) / 2), b0 + 48 + 10, 0);
- final String s3 = I18n.format("book.finalizeWarning", new Object[0]);
- this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0);
- } else {
- s = I18n.format(
- "book.pageIndicator",
- new Object[] { Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages) });
- s1 = "";
-
- if ((this.bookPages != null) && (this.currPage >= 0) && (this.currPage < this.bookPages.tagCount())) {
- s1 = this.bookPages.getStringTagAt(this.currPage);
- }
-
- if (this.bookIsUnsigned) {
- if (this.fontRendererObj.getBidiFlag()) {
- s1 = s1 + "_";
- } else if (((this.updateCount / 6) % 2) == 0) {
- s1 = s1 + "" + EnumChatFormatting.BLACK + "_";
- } else {
- s1 = s1 + "" + EnumChatFormatting.GRAY + "_";
- }
- }
-
- l = this.fontRendererObj.getStringWidth(s);
- this.fontRendererObj.drawString(s, ((k - l) + this.bookImageWidth) - 44, b0 + 16, 0);
- // this.fontRendererObj.drawString(s, k+36, b0 + 16, 0);
- this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0);
- // this.fontRendererObj.drawSplitString(s1, k, b0 + 16 + 16, 116, 0);
- }
-
- super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
- }
-
- @SideOnly(Side.CLIENT)
- static class NextPageButton extends GuiButton {
-
- private final boolean field_146151_o;
-
- public NextPageButton(final int p_i1079_1_, final int p_i1079_2_, final int p_i1079_3_,
- final boolean p_i1079_4_) {
- super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, "");
- this.field_146151_o = p_i1079_4_;
- }
-
- /**
- * Draws this button to the screen.
- */
- @Override
- public void drawButton(final Minecraft p_146112_1_, final int p_146112_2_, final int p_146112_3_) {
- if (this.visible) {
- final boolean flag = (p_146112_2_ >= this.xPosition) && (p_146112_3_ >= this.yPosition)
- && (p_146112_2_ < (this.xPosition + this.width))
- && (p_146112_3_ < (this.yPosition + this.height));
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- p_146112_1_.getTextureManager().bindTexture(GuiScreenGrindle.bookGuiTextures);
- int k = 0;
- int l = 192;
-
- if (flag) {
- k += 23;
- }
-
- if (!this.field_146151_o) {
- l += 13;
- }
-
- this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13);
- }
- }
- }
-
- /**
- * Draw the background layer for the GuiContainer (everything behind the items)
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.mc.getTextureManager().bindTexture(iconLocation);
- final int k = (this.width - this.xSize) / 2;
- final int l = (this.height - this.ySize) / 2;
- this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
- final int i1;
- // drawPlayerModel(k + 51, l + 75, 30, k + 51 - this.xSize_lo, (l + 75)
- // - 50 - this.ySize_lo, this.mc.thePlayer);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
deleted file mode 100644
index 20f87bf31e..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_EggBox.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.container.Container_EggBox;
-import gtPlusPlus.core.tileentities.general.TileEntityEggBox;
-
-@SideOnly(Side.CLIENT)
-public class GUI_EggBox extends GuiContainer {
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/FishTrap.png");
-
- public GUI_EggBox(final InventoryPlayer player_inventory, final TileEntityEggBox te) {
- super(new Container_EggBox(player_inventory, te));
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- // this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752);
- this.fontRendererObj
- .drawString(I18n.format("container.EggBox", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- 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);
- }
-
- // This method is called when the Gui is first called!
- @Override
- public void initGui() {
- // You have to add this line for the Gui to function properly!
- super.initGui();
-
- // The parameters of GuiButton are(id, x, y, width, height, text);
- // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- // NOTE: the id always has to be different or else it might get called twice or never!
-
- // Add any other buttons here too!
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
deleted file mode 100644
index 4f050250df..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_HeliumGenerator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.container.Container_HeliumGenerator;
-import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator;
-
-@SideOnly(Side.CLIENT)
-public class GUI_HeliumGenerator extends GuiContainer {
-
- private static final ResourceLocation guiTexture = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/helium_collector_gui.png");
-
- public GUI_HeliumGenerator(final InventoryPlayer player_inventory, final TileEntityHeliumGenerator te) {
- super(new Container_HeliumGenerator(player_inventory, te));
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- // this.fontRendererObj.drawString(I18n.format("", new Object[0]), 28, 6, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(guiTexture);
- 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);
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
deleted file mode 100644
index 4ddb7105f2..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_ModularityTable.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.GuiButton;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.core.container.Container_ModularityTable;
-import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable;
-
-@SideOnly(Side.CLIENT)
-public class GUI_ModularityTable extends GuiContainer {
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/ModularityTable.png");
- private Container_ModularityTable mThisContainer;
- private TileEntityModularityTable mThisTile;
- private int mRecipeTime = -1;
-
- public GUI_ModularityTable(final InventoryPlayer player_inventory, final TileEntityModularityTable tile) {
- super(new Container_ModularityTable(player_inventory, tile));
- this.mThisContainer = tile.getContainer();
- this.mThisTile = tile;
- if (this.mThisTile.getRecipeTime() > -1) {
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- if (this.mThisTile.getRecipeTime() > -1) {
- this.mRecipeTime = this.mThisTile.getRecipeTime();
- }
- // Utils.LOG_INFO("Container: "+this.mRecipeTime);
- this.fontRendererObj.drawString(I18n.format("Modularity Table", new Object[0]), 8, 6, 4210752);
- if (mRecipeTime > -1) {
- this.fontRendererObj.drawString(I18n.format("Time", new Object[0]), 84, 42, 4210752);
- this.fontRendererObj.drawString(I18n.format("Remaining", new Object[0]), 84, 50, 4210752);
- this.fontRendererObj
- .drawString(I18n.format("" + this.mRecipeTime + " Ticks", new Object[0]), 84, 58, 4210752);
- }
- this.fontRendererObj
- .drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- 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);
- }
-
- // This method is called when the Gui is first called!
- @Override
- public void initGui() {
- // You have to add this line for the Gui to function properly!
- super.initGui();
-
- // The parameters of GuiButton are(id, x, y, width, height, text);
- // this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X"));
- // this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y"));
- // NOTE: the id always has to be different or else it might get called twice or never!
-
- // Add any other buttons here too!
- }
-
- @Override
- protected void actionPerformed(final GuiButton B) {}
-}
diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
deleted file mode 100644
index 32ae7fa222..0000000000
--- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_TradeTable.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package gtPlusPlus.core.gui.machine;
-
-import static gregtech.api.enums.Mods.GTPlusPlus;
-
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.container.Container_TradeTable;
-import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable;
-
-@SideOnly(Side.CLIENT)
-public class GUI_TradeTable extends GuiContainer {
-
- TileEntityTradeTable mThisTable;
- String mOwnerName;
-
- private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(
- GTPlusPlus.ID,
- "textures/gui/ProjectTable.png");
-
- public GUI_TradeTable(final InventoryPlayer player_inventory, final TileEntityTradeTable te,
- final String mOwnerName) {
- super(new Container_TradeTable(player_inventory, te));
- if (te.isServerSide()) {
- mThisTable = te;
- this.mOwnerName = mOwnerName;
- Logger.INFO("Set valid TE in GUI");
- }
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(final int i, final int j) {
- this.fontRendererObj.drawString(I18n.format("Owner - " + this.mOwnerName, new Object[0]), 28, 66, 4210752);
- // this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
- // 4210752);
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j) {
- GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- this.mc.renderEngine.bindTexture(craftingTableGuiTextures);
- 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);
- }
-}