From 8ac58626bd4caa9e49f58acc6b97ac031f6c2107 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Mon, 10 Apr 2023 17:49:16 +0100 Subject: Update spotless config to 0.2.2 --- src/main/java/gregtech/api/gui/GT_Container.java | 96 ++- .../api/gui/GT_ContainerMetaTile_Machine.java | 19 +- .../api/gui/GT_Container_BasicMachine.java | 12 +- .../gregtech/api/gui/GT_Container_BasicTank.java | 10 +- .../api/gui/GT_Container_MultiMachine.java | 2 +- .../java/gregtech/api/gui/GT_GUIColorOverride.java | 37 +- .../api/gui/GT_GUIContainerMetaTile_Machine.java | 60 +- .../gregtech/api/gui/GT_GUIContainer_1by1.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_2by2.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_3by3.java | 10 +- .../gregtech/api/gui/GT_GUIContainer_4by4.java | 10 +- .../api/gui/GT_GUIContainer_BasicMachine.java | 137 ++-- .../api/gui/GT_GUIContainer_BasicTank.java | 23 +- .../api/gui/GT_GUIContainer_MultiMachine.java | 98 +-- src/main/java/gregtech/api/gui/GT_GUICover.java | 14 +- .../gregtech/api/gui/GT_GUIDialogSelectItem.java | 32 +- src/main/java/gregtech/api/gui/GT_Slot_Armor.java | 4 +- src/main/java/gregtech/api/gui/GT_Slot_Holo.java | 2 +- .../gui/modularui/FallbackableSteamTexture.java | 4 +- .../api/gui/modularui/GT_CoverUIBuildContext.java | 2 +- .../gregtech/api/gui/modularui/GT_UIInfos.java | 173 ++--- .../gregtech/api/gui/modularui/GT_UITextures.java | 855 ++++++++------------- .../gregtech/api/gui/modularui/GUITextureSet.java | 66 +- .../gregtech/api/gui/modularui/SteamTexture.java | 32 +- .../api/gui/widgets/GT_GuiCoverTabLine.java | 42 +- .../api/gui/widgets/GT_GuiFakeItemButton.java | 14 +- .../java/gregtech/api/gui/widgets/GT_GuiIcon.java | 8 +- .../gregtech/api/gui/widgets/GT_GuiIconButton.java | 4 +- .../api/gui/widgets/GT_GuiIconCheckButton.java | 2 +- .../api/gui/widgets/GT_GuiIntegerTextBox.java | 18 +- .../java/gregtech/api/gui/widgets/GT_GuiTab.java | 32 +- .../gregtech/api/gui/widgets/GT_GuiTabLine.java | 24 +- .../api/gui/widgets/GT_GuiTooltipManager.java | 6 +- 33 files changed, 793 insertions(+), 1075 deletions(-) (limited to 'src/main/java/gregtech/api/gui') diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java index 819171ae02..e2ef6fd658 100644 --- a/src/main/java/gregtech/api/gui/GT_Container.java +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -140,9 +140,9 @@ public class GT_Container extends Container { } if (aMouseclick == 1) { aPlayer.dropPlayerItemWithRandomChoice( - aPlayerInventory.getItemStack() - .splitStack(1), - true); + aPlayerInventory.getItemStack() + .splitStack(1), + true); if (aPlayerInventory.getItemStack().stackSize == 0) { aPlayerInventory.setItemStack(null); } @@ -155,8 +155,7 @@ public class GT_Container extends Container { if (tTempStack != null) { rStack = GT_Utility.copyOrNull(tTempStack); if (aSlot.getStack() != null && aSlot.getStack() - .getItem() - == tTempStack.getItem()) { + .getItem() == tTempStack.getItem()) { slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } } @@ -195,8 +194,8 @@ public class GT_Container extends Container { aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); } else if (aSlot.isItemValid(mouseStack)) { if (tTempStack.getItem() == mouseStack.getItem() - && tTempStack.getItemDamage() == mouseStack.getItemDamage() - && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { + && tTempStack.getItemDamage() == mouseStack.getItemDamage() + && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { tTempStackSize = aMouseclick == 0 ? mouseStack.stackSize : 1; if (tTempStackSize > aSlot.getSlotStackLimit() - tTempStack.stackSize) { tTempStackSize = aSlot.getSlotStackLimit() - tTempStack.stackSize; @@ -214,23 +213,23 @@ public class GT_Container extends Container { aPlayerInventory.setItemStack(tTempStack); } } else if (tTempStack.getItem() == mouseStack.getItem() && mouseStack.getMaxStackSize() > 1 - && (!tTempStack.getHasSubtypes() - || tTempStack.getItemDamage() == mouseStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { - tTempStackSize = tTempStack.stackSize; - - if (tTempStackSize > 0 - && tTempStackSize + mouseStack.stackSize <= mouseStack.getMaxStackSize()) { - mouseStack.stackSize += tTempStackSize; - tTempStack = aSlot.decrStackSize(tTempStackSize); - - if (tTempStack.stackSize == 0) { - aSlot.putStack(null); - } - - aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); + && (!tTempStack.getHasSubtypes() + || tTempStack.getItemDamage() == mouseStack.getItemDamage()) + && ItemStack.areItemStackTagsEqual(tTempStack, mouseStack)) { + tTempStackSize = tTempStack.stackSize; + + if (tTempStackSize > 0 + && tTempStackSize + mouseStack.stackSize <= mouseStack.getMaxStackSize()) { + mouseStack.stackSize += tTempStackSize; + tTempStack = aSlot.decrStackSize(tTempStackSize); + + if (tTempStack.stackSize == 0) { + aSlot.putStack(null); } + + aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); } + } } aSlot.onSlotChanged(); } @@ -245,7 +244,7 @@ public class GT_Container extends Container { // get the stack at the specified hotbar slot. tTempStack = aPlayerInventory.getStackInSlot(aMouseclick); boolean canSwap = tTempStack == null - || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack); + || aSlot.inventory == aPlayerInventory && aSlot.isItemValid(tTempStack); tTempStackSize = -1; if (!canSwap) { @@ -275,15 +274,15 @@ public class GT_Container extends Container { } } } else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode - && aPlayerInventory.getItemStack() == null - && aSlotIndex >= 0) { - aSlot = this.inventorySlots.get(aSlotIndex); - if (aSlot != null && aSlot.getHasStack()) { - tTempStack = GT_Utility.copyOrNull(aSlot.getStack()); - tTempStack.stackSize = tTempStack.getMaxStackSize(); - aPlayerInventory.setItemStack(tTempStack); - } + && aPlayerInventory.getItemStack() == null + && aSlotIndex >= 0) { + aSlot = this.inventorySlots.get(aSlotIndex); + if (aSlot != null && aSlot.getHasStack()) { + tTempStack = GT_Utility.copyOrNull(aSlot.getStack()); + tTempStack.stackSize = tTempStack.getMaxStackSize(); + aPlayerInventory.setItemStack(tTempStack); } + } return rStack; } @@ -296,8 +295,8 @@ public class GT_Container extends Container { // null checks and checks if the item can be stacked (maxStackSize > 1) if (getSlotCount() > 0 && slotObject != null - && slotObject.getHasStack() - && !(slotObject instanceof GT_Slot_Holo)) { + && slotObject.getHasStack() + && !(slotObject instanceof GT_Slot_Holo)) { ItemStack stackInSlot = slotObject.getStack(); stack = GT_Utility.copyOrNull(stackInSlot); @@ -309,12 +308,12 @@ public class GT_Container extends Container { } // Player -> TileEntity } else if (!mergeItemStack( - stackInSlot, - getShiftClickStartIndex(), - getShiftClickStartIndex() + getShiftClickSlotCount(), - false)) { - return null; - } + stackInSlot, + getShiftClickStartIndex(), + getShiftClickStartIndex() + getShiftClickSlotCount(), + false)) { + return null; + } if (stackInSlot.stackSize == 0) { slotObject.putStack(null); @@ -344,15 +343,15 @@ public class GT_Container extends Container { if (aStack.isStackable()) { while (aStack.stackSize > 0 - && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) { + && (!reverseOrder && slotIndex < aSlotCount || reverseOrder && slotIndex >= aStartIndex)) { slot = this.inventorySlots.get(slotIndex); itemStack = slot.getStack(); if (!(slot instanceof GT_Slot_Holo) && !(slot instanceof GT_Slot_Output) - && slot.isItemValid(aStack) - && itemStack != null - && itemStack.getItem() == aStack.getItem() - && (!aStack.getHasSubtypes() || aStack.getItemDamage() == itemStack.getItemDamage()) - && ItemStack.areItemStackTagsEqual(aStack, itemStack)) { + && slot.isItemValid(aStack) + && itemStack != null + && itemStack.getItem() == aStack.getItem() + && (!aStack.getHasSubtypes() || aStack.getItemDamage() == itemStack.getItemDamage()) + && ItemStack.areItemStackTagsEqual(aStack, itemStack)) { int combinedStackSize = itemStack.stackSize + aStack.stackSize; if (itemStack.stackSize < mTileEntity.getInventoryStackLimit()) { if (combinedStackSize <= aStack.getMaxStackSize()) { @@ -598,7 +597,7 @@ public class GT_Container extends Container { } protected static ItemStack handleFluidSlotClick(IFluidAccess aFluidAccess, EntityPlayer aPlayer, - boolean aProcessFullStack, boolean aCanDrain, boolean aCanFill) { + boolean aProcessFullStack, boolean aCanDrain, boolean aCanFill) { ItemStack tStackHeld = aPlayer.inventory.getItemStack(); ItemStack tStackSizedOne = GT_Utility.copyAmount(1, tStackHeld); if (tStackSizedOne == null || tStackHeld.stackSize == 0) return null; @@ -669,11 +668,10 @@ public class GT_Container extends Container { } protected static ItemStack fillFluid(IFluidAccess aFluidAccess, EntityPlayer aPlayer, FluidStack aFluidHeld, - boolean aProcessFullStack) { + boolean aProcessFullStack) { // we are not using aMachine.fill() here any more, so we need to check for fluid type here ourselves if (aFluidAccess.get() != null && !aFluidAccess.get() - .isFluidEqual(aFluidHeld)) - return null; + .isFluidEqual(aFluidHeld)) return null; ItemStack tStackHeld = aPlayer.inventory.getItemStack(); ItemStack tStackSizedOne = GT_Utility.copyAmount(1, tStackHeld); if (tStackSizedOne == null) return null; diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java index 3f2b45064d..af1393cbfb 100644 --- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -22,10 +22,10 @@ import gregtech.api.util.GT_Utility; public class GT_ContainerMetaTile_Machine extends GT_Container { public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, - mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; + mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; public long mEnergyLong = 0, mStorageLong = 0; private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, - oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0; + oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0; private long oEnergyLong = 0, oStorageLong = 0; protected int mTimer = 0; protected Runnable circuitSlotClickCallback; @@ -45,7 +45,7 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { } public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - boolean doesBindInventory) { + boolean doesBindInventory) { super(aInventoryPlayer, aTileEntity); mTileEntity = aTileEntity; @@ -61,10 +61,10 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { protected void addCircuitSlot() { if (mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { GT_Slot_Render slotCircuit = new GT_Slot_Render( - mTileEntity, - ccs.getCircuitSlot(), - ccs.getCircuitSlotX(), - ccs.getCircuitSlotY()); + mTileEntity, + ccs.getCircuitSlot(), + ccs.getCircuitSlotX(), + ccs.getCircuitSlotY()); addSlotToContainer(slotCircuit); slotCircuit.setEnabled(ccs.allowSelectCircuit()); } @@ -222,9 +222,8 @@ public class GT_ContainerMetaTile_Machine extends GT_Container { List tCircuits = ccs.getConfigurationCircuits(); int index = GT_Utility.findMatchingStackInList(tCircuits, cursorStack); if (index < 0) { - int curIndex = GT_Utility.findMatchingStackInList( - tCircuits, - machine.getStackInSlot(ccs.getCircuitSlot())) + 1; + int curIndex = GT_Utility + .findMatchingStackInList(tCircuits, machine.getStackInSlot(ccs.getCircuitSlot())) + 1; if (aMouseclick == 0) { curIndex += 1; } else { diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java index 976d7e8127..479c021d89 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicMachine.java @@ -217,7 +217,7 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { } default -> { if (aSlotNumber == OTHER_SLOT_COUNT + 1 + machine.mInputSlotCount + machine.mOutputItems.length - && aMouseclick < 2) { + && aMouseclick < 2) { GT_MetaTileEntity_BasicTank tTank = (GT_MetaTileEntity_BasicTank) mTileEntity.getMetaTileEntity(); if (mTileEntity.isClientSide()) { // see parent class slotClick for an explanation on why doing this @@ -228,11 +228,11 @@ public class GT_Container_BasicMachine extends GT_Container_BasicTank { GT_Recipe_Map recipes = machine.getRecipeList(); // If the machine has recipes but no fluid inputs, disallow filling this slot with fluids. ItemStack tToken = handleFluidSlotClick( - tFillableAccess, - aPlayer, - aMouseclick == 0, - true, - (recipes == null || recipes.hasFluidInputs())); + tFillableAccess, + aPlayer, + aMouseclick == 0, + true, + (recipes == null || recipes.hasFluidInputs())); if (mTileEntity.isServerSide() && tToken != null) mTileEntity.markInventoryBeenModified(); return tToken; } else { diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java index f463b35f7c..08e8e6eb00 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java @@ -56,11 +56,11 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine { } IFluidAccess tDrainableAccess = constructFluidAccess(tTank, false); return handleFluidSlotClick( - tDrainableAccess, - aPlayer, - aMouseclick == 0, - true, - !tTank.isDrainableStackSeparate()); + tDrainableAccess, + aPlayer, + aMouseclick == 0, + true, + !tTank.isDrainableStackSeparate()); } return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); } diff --git a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java index bcc9219d5e..142b84e008 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java @@ -18,7 +18,7 @@ public class GT_Container_MultiMachine extends GT_ContainerMetaTile_Machine { } public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - boolean bindInventory) { + boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } diff --git a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java index 7c6328bb34..85e56d9b52 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java +++ b/src/main/java/gregtech/api/gui/GT_GUIColorOverride.java @@ -22,27 +22,22 @@ public class GT_GUIColorOverride { private static final Object NOT_FOUND = new Object(); private static final LoadingCache cache = CacheBuilder.newBuilder() - .softValues() - .build(new CacheLoader<>() { - - @Override - public Object load( - @Nonnull ResourceLocation key) - throws Exception { - IResource ir = Minecraft.getMinecraft() - .getResourceManager() - .getResource( - key); - if (ir.hasMetadata()) - return ir.getMetadata( - "colors"); - // return a dummy - // object because - // LoadingCache - // doesn't like null - return NOT_FOUND; - } - }); + .softValues() + .build(new CacheLoader<>() { + + @Override + public Object load(@Nonnull ResourceLocation key) throws Exception { + IResource ir = Minecraft.getMinecraft() + .getResourceManager() + .getResource(key); + if (ir.hasMetadata()) return ir.getMetadata("colors"); + // return a dummy + // object because + // LoadingCache + // doesn't like null + return NOT_FOUND; + } + }); private static final GT_GUIColorOverride FALLBACK = new GT_GUIColorOverride(); private ColorsMetadataSection cmSection; diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index cbccdc5385..a72e9737ee 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -47,20 +47,20 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements // Cover Tabs support. Subclasses can override display position, style and visuals by overriding setupCoverTabs public GT_GuiCoverTabLine coverTabs; private static final int COVER_TAB_LEFT = -16, COVER_TAB_TOP = 1, COVER_TAB_HEIGHT = 20, COVER_TAB_WIDTH = 18, - COVER_TAB_SPACING = 2; + COVER_TAB_SPACING = 2; private static final DisplayStyle COVER_TAB_X_DIR = DisplayStyle.NONE, COVER_TAB_Y_DIR = DisplayStyle.NORMAL; private static final GT_GuiTabIconSet TAB_ICONSET = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL, - GT_GuiIcon.TAB_HIGHLIGHT, - GT_GuiIcon.TAB_DISABLED); + GT_GuiIcon.TAB_NORMAL, + GT_GuiIcon.TAB_HIGHLIGHT, + GT_GuiIcon.TAB_DISABLED); public GT_GUIContainerMetaTile_Machine(GT_ContainerMetaTile_Machine aContainer, String aGUIbackground) { super(aContainer, aGUIbackground); mContainer = aContainer; DisplayStyle preferredDisplayStyle = GT_Mod.gregtechproxy.mCoverTabsVisible - ? (GT_Mod.gregtechproxy.mCoverTabsFlipped ? DisplayStyle.INVERSE : DisplayStyle.NORMAL) - : DisplayStyle.NONE; + ? (GT_Mod.gregtechproxy.mCoverTabsFlipped ? DisplayStyle.INVERSE : DisplayStyle.NORMAL) + : DisplayStyle.NONE; setupCoverTabs(preferredDisplayStyle); // Only setup tooltips if they're currently enabled. @@ -73,7 +73,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements } public GT_GUIContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, - String aGUIbackground) { + String aGUIbackground) { this(new GT_ContainerMetaTile_Machine(aInventoryPlayer, aTileEntity), aGUIbackground); } @@ -82,18 +82,18 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements */ protected void setupCoverTabs(DisplayStyle preferredDisplayStyle) { coverTabs = new GT_GuiCoverTabLine( - this, - COVER_TAB_LEFT, - COVER_TAB_TOP, - COVER_TAB_HEIGHT, - COVER_TAB_WIDTH, - COVER_TAB_SPACING, - COVER_TAB_X_DIR, - COVER_TAB_Y_DIR, - preferredDisplayStyle, - getTabBackground(), - getMachine().getBaseMetaTileEntity(), - getColorization()); + this, + COVER_TAB_LEFT, + COVER_TAB_TOP, + COVER_TAB_HEIGHT, + COVER_TAB_WIDTH, + COVER_TAB_SPACING, + COVER_TAB_X_DIR, + COVER_TAB_Y_DIR, + preferredDisplayStyle, + getTabBackground(), + getMachine().getBaseMetaTileEntity(), + getColorization()); } @Override @@ -182,9 +182,9 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements protected void setupTooltips() { if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { if (ccs.allowSelectCircuit()) addToolTip( - new GT_GuiSlotTooltip( - mContainer.getSlot(ccs.getCircuitGUISlot()), - mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP))); + new GT_GuiSlotTooltip( + mContainer.getSlot(ccs.getCircuitGUISlot()), + mTooltipCache.getData(GHOST_CIRCUIT_TOOLTIP))); } } @@ -234,7 +234,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements if (mContainer.mTileEntity.getMetaTileEntity() instanceof IConfigurationCircuitSupport ccs) { Slot slotCircuit = mContainer.getSlot(ccs.getCircuitGUISlot()); if (slotCircuit != null - && func_146978_c(slotCircuit.xDisplayPosition, slotCircuit.yDisplayPosition, 16, 16, mx, my)) { + && func_146978_c(slotCircuit.xDisplayPosition, slotCircuit.yDisplayPosition, 16, 16, mx, my)) { // emulate click handleMouseClick(slotCircuit, -1, delta > 0 ? 1 : 0, 0); return; @@ -248,13 +248,13 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer implements IConfigurationCircuitSupport ccs = (IConfigurationCircuitSupport) machine; List circuits = ccs.getConfigurationCircuits(); mc.displayGuiScreen( - new GT_GUIDialogSelectItem( - StatCollector.translateToLocal("GT5U.machines.select_circuit"), - machine.getStackForm(0), - this, - this::onCircuitSelected, - circuits, - GT_Utility.findMatchingStackInList(circuits, machine.getStackInSlot(ccs.getCircuitSlot())))); + new GT_GUIDialogSelectItem( + StatCollector.translateToLocal("GT5U.machines.select_circuit"), + machine.getStackForm(0), + this, + this::onCircuitSelected, + circuits, + GT_Utility.findMatchingStackInList(circuits, machine.getStackInSlot(ccs.getCircuitSlot())))); } private void onCircuitSelected(ItemStack selected) { diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java index 1d82fa8274..5bd44668c5 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_1by1(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "1by1.png")); + new GT_Container_1by1(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "1by1.png")); mName = aName; } public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_1by1(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "1by1.png")); + new GT_Container_1by1(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "1by1.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java index 5d65ca1344..107bcc3859 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_2by2(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "2by2.png")); + new GT_Container_2by2(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "2by2.png")); mName = aName; } public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_2by2(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "2by2.png")); + new GT_Container_2by2(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "2by2.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java index 2ba68decf6..0c8b63664a 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_3by3(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "3by3.png")); + new GT_Container_3by3(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "3by3.png")); mName = aName; } public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_3by3(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "3by3.png")); + new GT_Container_3by3(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "3by3.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java index f1933897c7..9e5d7f7155 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java @@ -14,16 +14,16 @@ public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine { public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_4by4(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "4by4.png")); + new GT_Container_4by4(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "4by4.png")); mName = aName; } public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aBackground) { + String aBackground) { super( - new GT_Container_4by4(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", aBackground + "4by4.png")); + new GT_Container_4by4(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", aBackground + "4by4.png")); mName = aName; } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java index 6e6ce4c1d0..f610f6cf14 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java @@ -28,40 +28,39 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin private static final int NEEDS_STEAM_VENTING = 64; private static final GT_GuiTabIconSet TAB_ICONSET_BRONZE = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL_BRONZE, - GT_GuiIcon.TAB_HIGHLIGHT_BRONZE, - GT_GuiIcon.TAB_DISABLED_BRONZE); + GT_GuiIcon.TAB_NORMAL_BRONZE, + GT_GuiIcon.TAB_HIGHLIGHT_BRONZE, + GT_GuiIcon.TAB_DISABLED_BRONZE); private static final GT_GuiTabIconSet TAB_ICONSET_STEEL = new GT_GuiTabIconSet( - GT_GuiIcon.TAB_NORMAL_STEEL, - GT_GuiIcon.TAB_HIGHLIGHT_STEEL, - GT_GuiIcon.TAB_DISABLED_STEEL); + GT_GuiIcon.TAB_NORMAL_STEEL, + GT_GuiIcon.TAB_HIGHLIGHT_STEEL, + GT_GuiIcon.TAB_DISABLED_STEEL); private final int textColor = this.getTextColorOrDefault("title", 0x404040); public final String mName, mNEI; public final byte mProgressBarDirection, mProgressBarAmount; // Tooltip localization keys private static final String BATTERY_SLOT_TOOLTIP = "GT5U.machines.battery_slot.tooltip", - BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", - UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", - SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", - FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", - FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", - STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", - STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", - FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", - ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", - POWER_SOURCE_KEY = "GT5U.machines.powersource."; + BATTERY_SLOT_TOOLTIP_ALT = "GT5U.machines.battery_slot.tooltip.alternative", + UNUSED_SLOT_TOOLTIP = "GT5U.machines.unused_slot.tooltip", + SPECIAL_SLOT_TOOLTIP = "GT5U.machines.special_slot.tooltip", + FLUID_INPUT_TOOLTIP = "GT5U.machines.fluid_input_slot.tooltip", + FLUID_OUTPUT_TOOLTIP = "GT5U.machines.fluid_output_slot.tooltip", + STALLED_STUTTERING_TOOLTIP = "GT5U.machines.stalled_stuttering.tooltip", + STALLED_VENT_TOOLTIP = "GT5U.machines.stalled_vent.tooltip", + FLUID_TRANSFER_TOOLTIP = "GT5U.machines.fluid_transfer.tooltip", + ITEM_TRANSFER_TOOLTIP = "GT5U.machines.item_transfer.tooltip", POWER_SOURCE_KEY = "GT5U.machines.powersource."; public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile, String aNEI) { + String aTextureFile, String aNEI) { this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1); } public GT_GUIContainer_BasicMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { + String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) { super( - new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "basicmachines", aTextureFile)); + new GT_Container_BasicMachine(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "basicmachines", aTextureFile)); mProgressBarDirection = aProgressBarDirection; mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount); mName = aName; @@ -84,10 +83,10 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin batterySlotTooltipKey = UNUSED_SLOT_TOOLTIP; batterySlotTooltipArgs = new String[0]; addToolTip( - new GT_GuiSmartTooltip( - tProblemArea, - () -> hasErrorCode(NEEDS_STEAM_VENTING), - mTooltipCache.getData(STALLED_VENT_TOOLTIP))); + new GT_GuiSmartTooltip( + tProblemArea, + () -> hasErrorCode(NEEDS_STEAM_VENTING), + mTooltipCache.getData(STALLED_VENT_TOOLTIP))); } else { String pTier1 = powerTierName(machine.mTier); if (machine.mTier == GT_Values.VN.length - 1) { @@ -98,44 +97,41 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin batterySlotTooltipArgs = new String[] { pTier1, powerTierName((byte) (machine.mTier + 1)) }; } addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidTransferToggle, - mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))); + new GT_GuiSlotTooltip( + container.slotFluidTransferToggle, + mTooltipCache.getData(FLUID_TRANSFER_TOOLTIP))); addToolTip( - new GT_GuiSlotTooltip( - container.slotItemTransferToggle, - mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); + new GT_GuiSlotTooltip(container.slotItemTransferToggle, mTooltipCache.getData(ITEM_TRANSFER_TOOLTIP))); } if (recipes != null && recipes.hasFluidInputs()) { addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidInput, - mTooltipCache.getData(FLUID_INPUT_TOOLTIP, machine.getCapacity()))); + new GT_GuiSlotTooltip( + container.slotFluidInput, + mTooltipCache.getData(FLUID_INPUT_TOOLTIP, machine.getCapacity()))); } if (recipes != null && recipes.hasFluidOutputs()) { addToolTip( - new GT_GuiSlotTooltip( - container.slotFluidOutput, - mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, machine.getCapacity()))); + new GT_GuiSlotTooltip( + container.slotFluidOutput, + mTooltipCache.getData(FLUID_OUTPUT_TOOLTIP, machine.getCapacity()))); } addToolTip( - new GT_GuiSlotTooltip( - getContainer().slotBattery, - mTooltipCache.getData(batterySlotTooltipKey, batterySlotTooltipArgs))); + new GT_GuiSlotTooltip( + getContainer().slotBattery, + mTooltipCache.getData(batterySlotTooltipKey, batterySlotTooltipArgs))); addToolTip( - new GT_GuiSlotTooltip( - container.slotSpecial, - mTooltipCache.getData( - recipes != null && recipes.usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP - : UNUSED_SLOT_TOOLTIP))); + new GT_GuiSlotTooltip( + container.slotSpecial, + mTooltipCache.getData( + recipes != null && recipes.usesSpecialSlot() ? SPECIAL_SLOT_TOOLTIP : UNUSED_SLOT_TOOLTIP))); addToolTip( - new GT_GuiSmartTooltip( - tProblemArea, - () -> container.mStuttering && !hasErrorCode(NEEDS_STEAM_VENTING), - mTooltipCache.getData( - STALLED_STUTTERING_TOOLTIP, - StatCollector.translateToLocal( - POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power"))))); + new GT_GuiSmartTooltip( + tProblemArea, + () -> container.mStuttering && !hasErrorCode(NEEDS_STEAM_VENTING), + mTooltipCache.getData( + STALLED_STUTTERING_TOOLTIP, + StatCollector + .translateToLocal(POWER_SOURCE_KEY + (machine.isSteampowered() ? "steam" : "power"))))); } /** @@ -174,31 +170,30 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin if (mContainer.mMaxProgressTime > 0) { int tSize = mProgressBarDirection < 2 ? 20 : 18; int tProgress = Math.max( - 1, - Math.min( - tSize * mProgressBarAmount, - (mContainer.mProgressTime > 0 ? 1 : 0) + mContainer.mProgressTime * tSize - * mProgressBarAmount - / mContainer.mMaxProgressTime)) - % (tSize + 1); + 1, + Math.min( + tSize * mProgressBarAmount, + (mContainer.mProgressTime > 0 ? 1 : 0) + + mContainer.mProgressTime * tSize * mProgressBarAmount / mContainer.mMaxProgressTime)) + % (tSize + 1); switch (mProgressBarDirection) { // yes, my OCD was mad at me before I did the Tabs. case 0 -> drawTexturedModalRect(x + 78, y + 24, 176, 0, tProgress, 18); case 1 -> drawTexturedModalRect( - x + 78 + 20 - tProgress, - y + 24, - 176 + 20 - tProgress, - 0, - tProgress, - 18); + x + 78 + 20 - tProgress, + y + 24, + 176 + 20 - tProgress, + 0, + tProgress, + 18); case 2 -> drawTexturedModalRect(x + 78, y + 24, 176, 0, 20, tProgress); case 3 -> drawTexturedModalRect( - x + 78, - y + 24 + 18 - tProgress, - 176, - 18 - tProgress, - 20, - tProgress); + x + 78, + y + 24 + 18 - tProgress, + 176, + 18 - tProgress, + 20, + tProgress); case 4 -> { tProgress = 20 - tProgress; drawTexturedModalRect(x + 78, y + 24, 176, 0, tProgress, 18); @@ -224,7 +219,7 @@ public class GT_GUIContainer_BasicMachine extends GT_GUIContainerMetaTile_Machin protected GT_GuiTabIconSet getTabBackground() { if (getMachine().isSteampowered()) { return getMachine() instanceof GT_MetaTileEntity_BasicMachine_Steel ? TAB_ICONSET_STEEL - : TAB_ICONSET_BRONZE; + : TAB_ICONSET_BRONZE; } return super.getTabBackground(); } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java index a8e965cf28..54aa42d2a3 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_BasicTank.java @@ -12,31 +12,28 @@ public class GT_GUIContainer_BasicTank extends GT_GUIContainerMetaTile_Machine { private final String mName; private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0x404040), - textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); + textColorTitle = this.getTextColorOrDefault("title", 0x404040), + textColorValue = this.getTextColorOrDefault("value", 0xFAFAFF); public GT_GUIContainer_BasicTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super( - new GT_Container_BasicTank(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath("textures", "gui", "BasicTank.png")); + new GT_Container_BasicTank(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath("textures", "gui", "BasicTank.png")); mName = aName; } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { - fontRendererObj.drawString( - StatCollector.translateToLocal("container.inventory"), - 8, - ySize - 96 + 2, - textColorTitle); + fontRendererObj + .drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, textColorTitle); fontRendererObj.drawString(mName, 8, 6, textColorTitle); if (mContainer != null) { fontRendererObj.drawString("Liquid Amount", 10, 20, textColor); fontRendererObj.drawString( - GT_Utility.parseNumberToString(((GT_Container_BasicTank) mContainer).mContent), - 10, - 30, - textColorValue); + GT_Utility.parseNumberToString(((GT_Container_BasicTank) mContainer).mContent), + 10, + 30, + textColorValue); } } diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java index 8378c5e8cf..66c5156190 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java @@ -22,17 +22,17 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin String mName; private final int textColor = this.getTextColorOrDefault("text", 0xFAFAFF), - textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); + textColorTitle = this.getTextColorOrDefault("title", 0xFAFAFF); public GT_GUIContainer_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, - String aTextureFile) { + String aTextureFile) { super( - new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), - GregTech.getResourcePath( - "textures", - "gui", - "multimachines", - aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); + new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity), + GregTech.getResourcePath( + "textures", + "gui", + "multimachines", + aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); mName = aName; } @@ -69,7 +69,7 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin current_line.append(str); } else { current_line.append(" ") - .append(str); + .append(str); } index++; } @@ -98,90 +98,60 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin } if ((mContainer.mDisplayErrorCode & 8) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("135", "Platings are dented."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("135", "Platings are dented."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 16) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("136", "Circuitry burned out."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("136", "Circuitry burned out."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 32) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("137", "That doesn't belong there."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("137", "That doesn't belong there."), 10, line_counter, textColor); line_counter += 8; } if ((mContainer.mDisplayErrorCode & 64) != 0) { - fontRendererObj.drawString( - GT_Utility.trans("138", "Incomplete Structure."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("138", "Incomplete Structure."), 10, line_counter, textColor); line_counter += 8; } if (mContainer.mDisplayErrorCode == 0) { if (mContainer.mActive == 0) { - fontRendererObj.drawString( - GT_Utility.trans("139", "Hit with Soft Mallet"), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("139", "Hit with Soft Mallet"), 10, line_counter, textColor); line_counter += 8; - fontRendererObj.drawString( - GT_Utility.trans("140", "to (re-)start the Machine"), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("140", "to (re-)start the Machine"), 10, line_counter, textColor); line_counter += 8; - fontRendererObj.drawString( - GT_Utility.trans("141", "if it doesn't start."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("141", "if it doesn't start."), 10, line_counter, textColor); } else { - fontRendererObj.drawString( - GT_Utility.trans("142", "Running perfectly."), - 10, - line_counter, - textColor); + fontRendererObj + .drawString(GT_Utility.trans("142", "Running perfectly."), 10, line_counter, textColor); } line_counter += 8; if (mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DrillerBase) { ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity() - .getStackInSlot(1); + .getStackInSlot(1); if (tItem == null - || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) { - fontRendererObj.drawString( - GT_Utility.trans("143", "Missing Mining Pipe"), - 10, - line_counter, - textColor); + || !GT_Utility.areStacksEqual(tItem, GT_ModHandler.getIC2Item("miningPipe", 1L))) { + fontRendererObj + .drawString(GT_Utility.trans("143", "Missing Mining Pipe"), 10, line_counter, textColor); } } else if (mContainer.mTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_LargeTurbine) { ItemStack tItem = mContainer.mTileEntity.getMetaTileEntity() - .getStackInSlot(1); + .getStackInSlot(1); if (tItem == null - || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 - && tItem.getItemDamage() <= 177)) { - fontRendererObj.drawString( - GT_Utility.trans("144", "Missing Turbine Rotor"), - 10, - line_counter, - textColor); + || !(tItem.getItem() == GT_MetaGenerated_Tool_01.INSTANCE && tItem.getItemDamage() >= 170 + && tItem.getItemDamage() <= 177)) { + fontRendererObj + .drawString(GT_Utility.trans("144", "Missing Turbine Rotor"), 10, line_counter, textColor); } } } diff --git a/src/main/java/gregtech/api/gui/GT_GUICover.java b/src/main/java/gregtech/api/gui/GT_GUICover.java index 2bd981c6b1..791bcc0c73 100644 --- a/src/main/java/gregtech/api/gui/GT_GUICover.java +++ b/src/main/java/gregtech/api/gui/GT_GUICover.java @@ -40,13 +40,13 @@ public abstract class GT_GUICover extends GT_GUIScreen { // If this cover was given a guiId, tell the server to open it for us when this GUI closes. if (parentGuiId != -1 && tile.isUseableByPlayer(mc.thePlayer)) { GT_Values.NW.sendToServer( - new GT_Packet_GtTileEntityGuiRequest( - tile.getXCoord(), - tile.getYCoord(), - tile.getZCoord(), - parentGuiId, - tile.getWorld().provider.dimensionId, - mc.thePlayer.getEntityId())); + new GT_Packet_GtTileEntityGuiRequest( + tile.getXCoord(), + tile.getYCoord(), + tile.getZCoord(), + parentGuiId, + tile.getWorld().provider.dimensionId, + mc.thePlayer.getEntityId())); } else { this.mc.displayGuiScreen(null); this.mc.setIngameFocus(); diff --git a/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java b/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java index 1f95def197..03a6fb2a70 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java +++ b/src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java @@ -28,11 +28,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { // all slots not including btnCurrent private final List slots = new ArrayList<>(); // the currently selected slot content - private final GT_GuiFakeItemButton btnCurrent = new GT_GuiFakeItemButton( - this, - 8, - 25, - GT_GuiIcon.SLOT_DARKGRAY).setMimicSlot(true); + private final GT_GuiFakeItemButton btnCurrent = new GT_GuiFakeItemButton(this, 8, 25, GT_GuiIcon.SLOT_DARKGRAY) + .setMimicSlot(true); private final boolean noDeselect; private int selected; private int scroll = 0; @@ -40,12 +37,12 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { private GT_GuiIconButton btnDown; public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks) { + Consumer selectedCallback, List stacks) { this(header, headerItem, parent, selectedCallback, stacks, UNSELECTED); } public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks, int selected) { + Consumer selectedCallback, List stacks, int selected) { this(header, headerItem, parent, selectedCallback, stacks, selected, false); } @@ -64,7 +61,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { * is guaranteed to be called with a nonnull stack */ public GT_GUIDialogSelectItem(String header, ItemStack headerItem, GuiScreen parent, - Consumer selectedCallback, List stacks, int selected, boolean noDeselect) { + Consumer selectedCallback, List stacks, int selected, boolean noDeselect) { super(176, 107, header); this.noDeselect = noDeselect; if (headerItem != null) this.headerIcon.setItem(headerItem); @@ -80,8 +77,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { slots.add( - new GT_GuiFakeItemButton(this, 8 + 18 * j, 44 + 18 * i, GT_GuiIcon.SLOT_GRAY).setMimicSlot( - true)); + new GT_GuiFakeItemButton(this, 8 + 18 * j, 44 + 18 * i, GT_GuiIcon.SLOT_GRAY).setMimicSlot(true)); } } @@ -91,8 +87,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { @Override protected void onInitGui(int guiLeft, int guiTop, int gui_width, int gui_height) { - btnCurrent.setX( - 8 + 2 + fontRendererObj.getStringWidth(StatCollector.translateToLocal("GT5U.gui.select.current"))); + btnCurrent + .setX(8 + 2 + fontRendererObj.getStringWidth(StatCollector.translateToLocal("GT5U.gui.select.current"))); } @Override @@ -129,7 +125,7 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { int mx = x - guiLeft, my = y - guiTop; if (button == 0) { if (btnCurrent.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { ensureSelectedDisplayed(); return; } @@ -137,20 +133,20 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { for (int i = 0, slotsSize = slots.size(); i < slotsSize; i++) { GT_GuiFakeItemButton slot = slots.get(i); if (slot.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(slotIndexToListIndex(i)); return; } } } else if (button == 1 && getSelected() >= 0) { if (btnCurrent.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(UNSELECTED); return; } GT_GuiFakeItemButton slot = getSlot(listIndexToSlotIndex(getSelected())); if (slot != null && slot.getBounds() - .contains(mx, my)) { + .contains(mx, my)) { setSelected(UNSELECTED); } } @@ -166,8 +162,8 @@ public class GT_GUIDialogSelectItem extends GT_GUIScreen { private void fillSlots() { for (int i = 0, j = scroll * cols; i < slots.size(); i++, j++) { slots.get(i) - .setItem(getCandidate(j)) - .setBgIcon(j == getSelected() ? GT_GuiIcon.SLOT_DARKGRAY : GT_GuiIcon.SLOT_GRAY); + .setItem(getCandidate(j)) + .setBgIcon(j == getSelected() ? GT_GuiIcon.SLOT_DARKGRAY : GT_GuiIcon.SLOT_GRAY); } } diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Armor.java b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java index 9b4b81a31d..1c48b01430 100644 --- a/src/main/java/gregtech/api/gui/GT_Slot_Armor.java +++ b/src/main/java/gregtech/api/gui/GT_Slot_Armor.java @@ -24,7 +24,7 @@ public class GT_Slot_Armor extends Slot { @Override public boolean isItemValid(ItemStack aStack) { return aStack != null && aStack.getItem() != null - && aStack.getItem() - .isValidArmor(aStack, mArmorType, mPlayer); + && aStack.getItem() + .isValidArmor(aStack, mArmorType, mPlayer); } } diff --git a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java index a01b91cefb..47bd5ceef3 100644 --- a/src/main/java/gregtech/api/gui/GT_Slot_Holo.java +++ b/src/main/java/gregtech/api/gui/GT_Slot_Holo.java @@ -16,7 +16,7 @@ public class GT_Slot_Holo extends Slot { public int mMaxStacksize = 127; public GT_Slot_Holo(IInventory inventory, int slotIndex, int xPos, int yPos, boolean aCanInsertItem, - boolean aCanStackItem, int aMaxStacksize) { + boolean aCanStackItem, int aMaxStacksize) { super(inventory, slotIndex, xPos, yPos); mCanInsertItem = aCanInsertItem; mCanStackItem = aCanStackItem; diff --git a/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java b/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java index 43b7210758..83a9d0f725 100644 --- a/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java +++ b/src/main/java/gregtech/api/gui/modularui/FallbackableSteamTexture.java @@ -56,8 +56,8 @@ public class FallbackableSteamTexture { } else { try { Minecraft.getMinecraft() - .getResourceManager() - .getResource(candidate.get(steamVariant).location); + .getResourceManager() +