diff options
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
109 files changed, 8276 insertions, 9730 deletions
diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java index f1641bda0b..1711529de2 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java @@ -22,53 +22,53 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer impl public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 28, - new String[] { "Buffers up to 27 Item Stacks", "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item", getTickRateDesc(aTier) }); + aID, + aName, + aNameRegional, + aTier, + 28, + new String[] { "Buffers up to 27 Item Stacks", "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", getTickRateDesc(aTier) }); } public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String[] aDescription) { + String[] aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ChestBuffer( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_CHESTBUFFER), - TextureFactory.builder() - .addIcon(AUTOMATION_CHESTBUFFER_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_CHESTBUFFER), + TextureFactory.builder() + .addIcon(AUTOMATION_CHESTBUFFER_GLOW) + .glow() + .build()); } @Override @@ -125,9 +125,9 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer impl addInvertRedstoneButton(builder); addStockingModeButton(builder); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(69, true)) - .setPos(80, 60) - .setSize(69, 22)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(69, true)) + .setPos(80, 60) + .setSize(69, 22)); addMainUI(builder); } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java index 6fc2b45289..c6c73cb02f 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java @@ -28,43 +28,43 @@ public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer implement public GT_MetaTileEntity_Filter(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 19, - new String[] { "Filters up to 9 different Items", "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item" }); + aID, + aName, + aNameRegional, + aTier, + 19, + new String[] { "Filters up to 9 different Items", "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" }); } public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Filter( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_FILTER), - TextureFactory.builder() - .addIcon(AUTOMATION_FILTER_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_FILTER), + TextureFactory.builder() + .addIcon(AUTOMATION_FILTER_GLOW) + .glow() + .build()); } @Override @@ -123,69 +123,67 @@ public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer implement bInvertFilter = !bInvertFilter; if (bInvertFilter) { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("124", "Invert Filter")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("124", "Invert Filter")); } else { GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("125", "Don't invert Filter")); + widget.getContext() + .getPlayer(), + GT_Utility.trans("125", "Don't invert Filter")); } }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER) - .setPos(61, 62) - .setSize(18, 18)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - bIgnoreNBT = !bIgnoreNBT; - if (bIgnoreNBT) { - GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("126", "Ignore NBT")); - } else { - GT_Utility.sendChatToPlayer( - widget.getContext() - .getPlayer(), - GT_Utility.trans("127", "NBT has to match")); - } - }) - .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT) - .setPos(79, 62) - .setSize(18, 18)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(9, false)) - .setPos(6, 19) - .setSize(9, 24)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(24, true)) - .setPos(71, 19) - .setSize(24, 24)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true)) - .setPos(152, 19) - .setSize(19, 24)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) - .setPos(16, 4) - .setSize(54, 54)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(9) - .endAtSlot(17) - .phantom(true) - .applyForWidget( - widget -> widget.disableShiftInsert() - .setBackground(GT_UITextures.TRANSPARENT)) - .build() - .setPos(16, 4)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(0) - .endAtSlot(8) - .build() - .setPos(97, 4)); + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_INVERT_FILTER) + .setPos(61, 62) + .setSize(18, 18)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + bIgnoreNBT = !bIgnoreNBT; + if (bIgnoreNBT) { + GT_Utility.sendChatToPlayer( + widget.getContext() + .getPlayer(), + GT_Utility.trans("126", "Ignore NBT")); + } else { + GT_Utility.sendChatToPlayer( + widget.getContext() + .getPlayer(), + GT_Utility.trans("127", "NBT has to match")); + } + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NBT) + .setPos(79, 62) + .setSize(18, 18)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_WHITE.apply(9, false)) + .setPos(6, 19) + .setSize(9, 24)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_BLUE.apply(24, true)) + .setPos(71, 19) + .setSize(24, 24)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_24_RED.apply(19, true)) + .setPos(152, 19) + .setSize(19, 24)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) + .setPos(16, 4) + .setSize(54, 54)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(9) + .endAtSlot(17) + .phantom(true) + .applyForWidget( + widget -> widget.disableShiftInsert() + .setBackground(GT_UITextures.TRANSPARENT)) + .build() + .setPos(16, 4)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(0) + .endAtSlot(8) + .build() + .setPos(97, 4)); } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java index 97bf8190b0..7b2978d701 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java @@ -29,49 +29,48 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 28, - new String[] { "Distributes Items between different Machine Sides", "Default Items per Machine Side: 0", - "Use Screwdriver to increase/decrease Items per Side", - "Does not consume energy to move Item" }); + aID, + aName, + aNameRegional, + aTier, + 28, + new String[] { "Distributes Items between different Machine Sides", "Default Items per Machine Side: 0", + "Use Screwdriver to increase/decrease Items per Side", "Does not consume energy to move Item" }); } public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ItemDistributor( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_ITEMDISTRIBUTOR), - TextureFactory.builder() - .addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_ITEMDISTRIBUTOR), + TextureFactory.builder() + .addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW) + .glow() + .build()); } @Override @@ -81,7 +80,7 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return mTextures[0][aColorIndex + 1]; } else { @@ -142,16 +141,16 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer } } movedItems = GT_Utility.moveOneItemStack( - aBaseMetaTileEntity, - adjacentTileEntity, - currentSide, - GT_Utility.getOppositeSide(currentSide), - null, - false, - (byte) 64, - (byte) 1, - (byte) (itemsPerSide[currentSide] - currentSideItemCount), - (byte) 1); + aBaseMetaTileEntity, + adjacentTileEntity, + currentSide, + GT_Utility.getOppositeSide(currentSide), + null, + false, + (byte) 64, + (byte) 1, + (byte) (itemsPerSide[currentSide] - currentSideItemCount), + (byte) 1); currentSideItemCount += movedItems; if (currentSideItemCount >= itemsPerSide[currentSide]) { currentSide = (byte) ((currentSide + 1) % 6); @@ -191,9 +190,9 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer addEmitRedstoneButton(builder); addInvertRedstoneButton(builder); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(87, true)) - .setPos(62, 60) - .setSize(87, 22)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(87, true)) + .setPos(62, 60) + .setSize(87, 22)); addInventorySlots(builder); } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java index 60500310e0..f8e54f9edf 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java @@ -26,21 +26,21 @@ public class GT_MetaTileEntity_RecipeFilter extends GT_MetaTileEntity_SpecialFil public GT_MetaTileEntity_RecipeFilter(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Filters 1 Recipe Type", "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Filters 1 Recipe Type", "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" }); } public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -64,21 +64,21 @@ public class GT_MetaTileEntity_RecipeFilter extends GT_MetaTileEntity_SpecialFil @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_RecipeFilter( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_RECIPEFILTER), - TextureFactory.builder() - .addIcon(AUTOMATION_RECIPEFILTER_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_RECIPEFILTER), + TextureFactory.builder() + .addIcon(AUTOMATION_RECIPEFILTER_GLOW) + .glow() + .build()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java index e743dd47e4..9b0824aed1 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java @@ -33,43 +33,43 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem public GT_MetaTileEntity_Regulator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 20, - new String[] { "Filters up to 9 different Items", "Allows Item-specific output stack size", - "Allows Item-specific output slot", "Does not consume energy to move Item" }); + aID, + aName, + aNameRegional, + aTier, + 20, + new String[] { "Filters up to 9 different Items", "Allows Item-specific output stack size", + "Allows Item-specific output slot", "Does not consume energy to move Item" }); } public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Regulator( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_REGULATOR), - TextureFactory.builder() - .addIcon(AUTOMATION_REGULATOR_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_REGULATOR), + TextureFactory.builder() + .addIcon(AUTOMATION_REGULATOR_GLOW) + .glow() + .build()); } @Override @@ -115,16 +115,16 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem for (int i = 0, tCosts; i < 9; i++) { if (this.mInventory[(i + 9)] != null) { tCosts = GT_Utility.moveOneItemStackIntoSlot( - getBaseMetaTileEntity(), - getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), - getBaseMetaTileEntity().getBackFacing(), - this.mTargetSlots[i], - Collections.singletonList(this.mInventory[(i + 9)]), - false, - (byte) this.mInventory[(i + 9)].stackSize, - (byte) this.mInventory[(i + 9)].stackSize, - (byte) 64, - (byte) 1) * 3; + getBaseMetaTileEntity(), + getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing()), + getBaseMetaTileEntity().getBackFacing(), + this.mTargetSlots[i], + Collections.singletonList(this.mInventory[(i + 9)]), + false, + (byte) this.mInventory[(i + 9)].stackSize, + (byte) this.mInventory[(i + 9)].stackSize, + (byte) 64, + (byte) 1) * 3; if (tCosts > 0) { this.mSuccess = 50; break; @@ -136,8 +136,8 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && aIndex >= 0 - && aIndex <= 8 - && GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]); + && aIndex <= 8 + && GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]); } @Override @@ -174,33 +174,33 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem addEmitEnergyButton(builder); builder.widget(createChargerSlot(43, 62)); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(84, true)) - .setPos(65, 60) - .setSize(84, 22)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(0) - .endAtSlot(8) - .build() - .setPos(7, 5)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) - .setPos(62, 5) - .setSize(54, 54)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 3) - .phantom(true) - .startFromSlot(9) - .endAtSlot(17) - .applyForWidget( - widget -> widget.setControlsAmount(true) - .setBackground(GT_UITextures.TRANSPARENT)) - .build() - .setPos(62, 5)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) - .setPos(117, 5) - .setSize(54, 54)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(84, true)) + .setPos(65, 60) + .setSize(84, 22)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .startFromSlot(0) + .endAtSlot(8) + .build() + .setPos(7, 5)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) + .setPos(62, 5) + .setSize(54, 54)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3) + .phantom(true) + .startFromSlot(9) + .endAtSlot(17) + .applyForWidget( + widget -> widget.setControlsAmount(true) + .setBackground(GT_UITextures.TRANSPARENT)) + .build() + .setPos(62, 5)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) + .setPos(117, 5) + .setSize(54, 54)); int xBase = 117, yBase = 5; for (int i = 0; i < mTargetSlots.length; i++) { @@ -211,18 +211,17 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem @Override protected void phantomClick(ClickData clickData, ItemStack cursorStack) { mTargetSlots[index] = Math.min( - 99, - Math.max( - 0, - mTargetSlots[index] - + (clickData.mouseButton == 0 ? -1 : 1) * (clickData.shift ? 16 : 1))); + 99, + Math.max( + 0, + mTargetSlots[index] + (clickData.mouseButton == 0 ? -1 : 1) * (clickData.shift ? 16 : 1))); } }.setBackground(GT_UITextures.TRANSPARENT) - .setPos(xPos, yPos)) - .widget( - TextWidget.dynamicString(() -> String.valueOf(mTargetSlots[index])) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(xPos + 2 + (i % 3 == 0 ? 1 : 0), yPos + 3 + (i / 3 == 0 ? 1 : 0))); + .setPos(xPos, yPos)) + .widget( + TextWidget.dynamicString(() -> String.valueOf(mTargetSlots[index])) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(xPos + 2 + (i % 3 == 0 ? 1 : 0), yPos + 3 + (i / 3 == 0 ? 1 : 0))); } } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java index 1b913af896..4687b62fa1 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java @@ -24,43 +24,43 @@ public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer public GT_MetaTileEntity_SuperBuffer(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 257, - new String[] { "Buffers up to 256 Item Stacks", "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item", getTickRateDesc(aTier) }); + aID, + aName, + aNameRegional, + aTier, + 257, + new String[] { "Buffers up to 256 Item Stacks", "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item", getTickRateDesc(aTier) }); } public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SuperBuffer( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_SUPERBUFFER), - TextureFactory.builder() - .addIcon(AUTOMATION_SUPERBUFFER_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_SUPERBUFFER), + TextureFactory.builder() + .addIcon(AUTOMATION_SUPERBUFFER_GLOW) + .glow() + .build()); } @Override @@ -86,7 +86,7 @@ public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer do { int slot = validSlots.get(i); mInventory[slot] = stacks.get(entry.getKey()) - .copy(); + .copy(); int toSet = Math.min(entry.getValue(), mInventory[slot].getMaxStackSize()); mInventory[slot].stackSize = toSet; entry.setValue(entry.getValue() - toSet); @@ -98,8 +98,8 @@ public class GT_MetaTileEntity_SuperBuffer extends GT_MetaTileEntity_ChestBuffer @Override protected void addMainUI(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SUPER_BUFFER) - .setPos(61, 4) - .setSize(54, 54)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SUPER_BUFFER) + .setPos(61, 4) + .setSize(54, 54)); } } diff --git a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java index 609342ed82..ee79766e30 100644 --- a/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java +++ b/src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java @@ -30,58 +30,58 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte public OrePrefixes mPrefix = OrePrefixes.ore; public static ImmutableList<OrePrefixes> OREBLOCK_PREFIXES = ImmutableList.of( - OrePrefixes.oreBlackgranite, - OrePrefixes.oreDense, - OrePrefixes.oreEnd, - OrePrefixes.oreEndstone, - OrePrefixes.oreNether, - OrePrefixes.oreNetherrack, - OrePrefixes.oreNormal, - OrePrefixes.orePoor, - OrePrefixes.oreRedgranite, - OrePrefixes.oreRich, - OrePrefixes.oreSmall, - OrePrefixes.oreBasalt, - OrePrefixes.oreMarble); + OrePrefixes.oreBlackgranite, + OrePrefixes.oreDense, + OrePrefixes.oreEnd, + OrePrefixes.oreEndstone, + OrePrefixes.oreNether, + OrePrefixes.oreNetherrack, + OrePrefixes.oreNormal, + OrePrefixes.orePoor, + OrePrefixes.oreRedgranite, + OrePrefixes.oreRich, + OrePrefixes.oreSmall, + OrePrefixes.oreBasalt, + OrePrefixes.oreMarble); public GT_MetaTileEntity_TypeFilter(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Filters 1 Item Type", "Use Screwdriver to regulate output stack size", - "Does not consume energy to move Item" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Filters 1 Item Type", "Use Screwdriver to regulate output stack size", + "Does not consume energy to move Item" }); } public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_TypeFilter( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture getOverlayIcon() { return TextureFactory.of( - TextureFactory.of(AUTOMATION_TYPEFILTER), - TextureFactory.builder() - .addIcon(AUTOMATION_TYPEFILTER_GLOW) - .glow() - .build()); + TextureFactory.of(AUTOMATION_TYPEFILTER), + TextureFactory.builder() + .addIcon(AUTOMATION_TYPEFILTER_GLOW) + .glow() + .build()); } @Override @@ -112,7 +112,7 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte } while (OrePrefixes.values()[i].mPrefixedItems.isEmpty()); } if (!OrePrefixes.values()[i].mPrefixedItems.isEmpty() - && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) + && OrePrefixes.values()[i].mPrefixInto == OrePrefixes.values()[i]) mPrefix = OrePrefixes.values()[i]; } } @@ -130,9 +130,9 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte return; } this.mInventory[SPECIAL_SLOT_INDEX] = GT_Utility.copyAmount( - 1L, - this.mPrefix.mPrefixedItems.get( - this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); + 1L, + this.mPrefix.mPrefixedItems + .get(this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size())); if (this.mInventory[SPECIAL_SLOT_INDEX] == null) return; if (this.mInventory[SPECIAL_SLOT_INDEX].getItemDamage() == W) this.mInventory[9].setItemDamage(0); this.mInventory[SPECIAL_SLOT_INDEX].setStackDisplayName(this.mPrefix.toString()); @@ -164,9 +164,9 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte @Override protected List<String> getItemExtraTooltip() { return Arrays.asList( - EnumChatFormatting.DARK_GRAY - + StatCollector.translateToLocal("GT5U.type_filter.representation_slot.tooltip.0"), - EnumChatFormatting.DARK_GRAY - + StatCollector.translateToLocal("GT5U.type_filter.representation_slot.tooltip.1")); + EnumChatFormatting.DARK_GRAY + + StatCollector.translateToLocal("GT5U.type_filter.representation_slot.tooltip.0"), + EnumChatFormatting.DARK_GRAY + + StatCollector.translateToLocal("GT5U.type_filter.representation_slot.tooltip.1")); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index ed22d41f70..fbcc8f62ce 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -41,7 +41,7 @@ import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; import gregtech.common.GT_Pollution; public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank - implements IGetTitleColor, IAddUIWidgets { + implements IGetTitleColor, IAddUIWidgets { public static final byte SOUND_EVENT_LET_OFF_EXCESS_STEAM = 1; public int mTemperature = 20; @@ -52,12 +52,12 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa private int mExcessWater = 0; public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String[] aDescription, - ITexture... aTextures) { + ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } @@ -71,9 +71,9 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex - + 1]; + + 1]; if (aSide != aFacing && tmp.length == 2) { tmp = new ITexture[] { tmp[0] }; } @@ -136,7 +136,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa if (!aPlayer.capabilities.isCreativeMode) { aPlayer.getCurrentEquippedItem() - .func_150996_a(Items.bucket); + .func_150996_a(Items.bucket); } } else { GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); @@ -199,7 +199,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCover) { return GregTech_API.getCoverBehaviorNew(aCover.toStack()) - .isSimpleCover(); + .isSimpleCover(); } @Override @@ -275,7 +275,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa private void calculateHeatUp(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0) - && (aTick % getHeatUpRate() == 0L)) { + && (aTick % getHeatUpRate() == 0L)) { this.mProcessingEnergy -= getEnergyConsumption(); this.mTemperature += getHeatUpAmount(); } @@ -330,22 +330,20 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa if (mSteam == null || mSteam.amount == 0) return; IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide((byte) aSide); if (tTileEntity == null) return; - FluidStack tDrained = aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(aSide), - Math.max(1, this.mSteam.amount / 2), - false); + FluidStack tDrained = aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(aSide), Math.max(1, this.mSteam.amount / 2), false); if (tDrained == null) return; int tFilledAmount = tTileEntity.fill( - ForgeDirection.getOrientation(aSide) - .getOpposite(), - tDrained, - false); + ForgeDirection.getOrientation(aSide) + .getOpposite(), + tDrained, + false); if (tFilledAmount <= 0) return; tTileEntity.fill( - ForgeDirection.getOrientation(aSide) - .getOpposite(), - aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), - true); + ForgeDirection.getOrientation(aSide) + .getOpposite(), + aBaseMetaTileEntity.drain(ForgeDirection.getOrientation(aSide), tFilledAmount, true), + true); } /** @@ -388,15 +386,12 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa GT_Utility.doSoundAtClient(SoundResource.RANDOM_FIZZ, 2, 1.0F, aX, aY, aZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) - .setWorld(getBaseMetaTileEntity().getWorld()) - .setMotion(0D, 0D, 0D) - .<ParticleEventBuilder>times( - 8, - x -> x.setPosition( - aX - 0.5D + XSTR_INSTANCE.nextFloat(), - aY, - aZ - 0.5D + XSTR_INSTANCE.nextFloat()) - .run()); + .setWorld(getBaseMetaTileEntity().getWorld()) + .setMotion(0D, 0D, 0D) + .<ParticleEventBuilder>times( + 8, + x -> x.setPosition(aX - 0.5D + XSTR_INSTANCE.nextFloat(), aY, aZ - 0.5D + XSTR_INSTANCE.nextFloat()) + .run()); } } @@ -437,12 +432,12 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa protected IDrawable[] getFuelSlotBackground() { return new IDrawable[] { getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_COAL_STEAM.get(getSteamVariant()) }; + GT_UITextures.OVERLAY_SLOT_COAL_STEAM.get(getSteamVariant()) }; } protected IDrawable[] getAshSlotBackground() { return new IDrawable[] { getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant()) }; + GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant()) }; } @Override @@ -453,59 +448,54 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inventoryHandler, 0).setPos(43, 25) - .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotIn())) - .widget( - new SlotWidget(inventoryHandler, 1).setPos(43, 61) - .setBackground( - getGUITextureSet().getItemSlot(), - getOverlaySlotOut())) - .widget(createFuelSlot()) - .widget(createAshSlot()) - .widget( - new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(70, 25) - .setSize(10, 54)) - .widget( - new ProgressBar().setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_WATER, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(83, 25) - .setSize(10, 54)) - .widget( - new ProgressBar().setProgress(() -> (float) mTemperature / maxProgresstime()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_HEAT, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(96, 25) - .setSize(10, 54)) - .widget( - new ProgressBar() - // cap minimum so that one can easily see there's fuel remaining - .setProgress( - () -> mProcessingEnergy > 0 - ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) - : 0) - .setTexture(getProgressbarFuel(), 14) - .setDirection(ProgressBar.Direction.UP) - .setPos(116, 45) - .setSize(14, 14)) - .widget( - new DrawableWidget().setDrawable(getOverlaySlotCanister()) - .setPos(43, 43) - .setSize(18, 18)); + new SlotWidget(inventoryHandler, 0).setPos(43, 25) + .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotIn())) + .widget( + new SlotWidget(inventoryHandler, 1).setPos(43, 61) + .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotOut())) + .widget(createFuelSlot()) + .widget(createAshSlot()) + .widget( + new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(70, 25) + .setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_WATER, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(83, 25) + .setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) mTemperature / maxProgresstime()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_HEAT, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(96, 25) + .setSize(10, 54)) + .widget( + new ProgressBar() + // cap minimum so that one can easily see there's fuel remaining + .setProgress(() -> mProcessingEnergy > 0 ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) : 0) + .setTexture(getProgressbarFuel(), 14) + .setDirection(ProgressBar.Direction.UP) + .setPos(116, 45) + .setSize(14, 14)) + .widget( + new DrawableWidget().setDrawable(getOverlaySlotCanister()) + .setPos(43, 43) + .setSize(18, 18)); } protected SlotWidget createFuelSlot() { return (SlotWidget) new SlotWidget(inventoryHandler, 2).setPos(115, 61) - .setBackground(getFuelSlotBackground()); + .setBackground(getFuelSlotBackground()); } protected SlotWidget createAshSlot() { return (SlotWidget) new SlotWidget(inventoryHandler, 3).setAccess(true, false) - .setPos(115, 25) - .setBackground(getAshSlotBackground()); + .setPos(115, 25) + .setBackground(getAshSlotBackground()); } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java index 0e617312df..d375d285d2 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java @@ -35,12 +35,11 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - new String[] { "An early way to get Steam Power", "Produces 120L of Steam per second", - "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond - + " Pollution per second" }); + aID, + aName, + aNameRegional, + new String[] { "An early way to get Steam Power", "Produces 120L of Steam per second", + "Causes " + GT_Mod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond + " Pollution per second" }); } public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) { @@ -59,18 +58,18 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; final ITexture[] texBottom = { TextureFactory.of(MACHINE_BRONZEBRICKS_BOTTOM) }, - texTop = { TextureFactory.of(MACHINE_BRONZEBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE) }, - texSide = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE) }, - texFront = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(BOILER_FRONT), - TextureFactory.builder() - .addIcon(BOILER_FRONT_GLOW) - .glow() - .build() }, - texFrontActive = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(BOILER_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + texTop = { TextureFactory.of(MACHINE_BRONZEBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE) }, + texSide = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE) }, + texFront = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() }, + texFrontActive = { TextureFactory.of(MACHINE_BRONZEBRICKS_SIDE), TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; @@ -104,7 +103,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { final byte frontFacing = aBaseMetaTileEntity.getFrontFacing(); if (frontFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 8D / 16D; final double oY = aBaseMetaTileEntity.getOffsetY(frontFacing, 1); @@ -132,13 +131,12 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.SMOKE) - .run(); + .run(); particleEventBuilder.setIdentifier(ParticleFX.FLAME) - .run(); + .run(); } } } @@ -147,8 +145,8 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L) - && this.mProcessingEnergy > 0 - && (aTick % 20L == 0L)) { + && this.mProcessingEnergy > 0 + && (aTick % 20L == 0L)) { GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution()); } } @@ -182,142 +180,127 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler { protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (this.mInventory[2] == null) return; if ((GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) - || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) - && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) - || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) - && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) - || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Diamond) - && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) - || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") - || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") - || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") - || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") - || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke")) { + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Diamond) + && !GT_Utility.isPartOfOrePrefix(this.mInventory[2], OrePrefixes.block)) + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCactusCoke") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCharcoal") + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelSugarCoke")) { if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); aBaseMetaTileEntity.decrStackSize(2, 1); if (XSTR.XSTR_INSTANCE.nextInt( - GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) - || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) ? 3 - : GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) ? 8 : 2) - == 0) { + GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) ? 3 + : GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) ? 8 : 2) + == 0) { aBaseMetaTileEntity.addStackToSlot( - 3, - GT_OreDictUnificator.get( - OrePrefixes.dustTiny, - (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) - || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal)) - ? Materials.DarkAsh - : Materials.Ash, - 1L)); + 3, + GT_OreDictUnificator.get( + OrePrefixes.dustTiny, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal)) ? Materials.DarkAsh + : Materials.Ash, + 1L)); } } } else if ( // If its a block of the following materials GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Coal)) - || GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], - OrePrefixes.block.get(Materials.Lignite)) - || GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], - OrePrefixes.block.get(Materials.Charcoal)) - || GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], - OrePrefixes.block.get(Materials.Diamond)) - || + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Lignite)) + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Charcoal)) + || GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.block.get(Materials.Diamond)) + || - // if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block - (Block.getBlockFromItem(this.mInventory[2].getItem()) != null && // check if the block exists - (Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("tile") && // check if the block is a tile -> block - ( - // If the name of the block contains these names - Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("charcoal") - || Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("coal") - || Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("diamond") - || Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("coke") - || Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("railcraft.cube") - || Block.getBlockFromItem(this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("lignite"))))) { - // try to add 10% of the burnvalue as Processing energy, no boost - // for coal coke here - if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) - > 0) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime( - this.mInventory[2]) / 10); - aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot( - 3, - GT_OreDictUnificator.get( - OrePrefixes.dust, - (GT_Utility.isPartOfMaterials( - this.mInventory[2], - Materials.Lignite) - || GT_Utility.isPartOfMaterials( - this.mInventory[2], - Materials.Coal) - || Block.getBlockFromItem( - this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("coal") - || Block.getBlockFromItem( - this.mInventory[2].getItem()) - .getUnlocalizedName() - .toLowerCase() - .contains("lignite")) - ? Materials.DarkAsh - : Materials.Ash, - 1L)); - } - // enables every other fuel with at least 2000 burntime as a fuel, - // i.e. peat, Magic/Solid Super Fuel, Coal - // Singularities, Nitor, while bucket of creosite should be blocked - // same goes for lava - } else + // if its either a Railcraft Coke Block or a custom GTNH compressed Coal/charcoal/lignite/coke block + (Block.getBlockFromItem(this.mInventory[2].getItem()) != null && // check if the block exists + (Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("tile") && // check if the block is a tile -> block + ( + // If the name of the block contains these names + Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("charcoal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("diamond") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coke") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("railcraft.cube") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite"))))) { + // try to add 10% of the burnvalue as Processing energy, no boost + // for coal coke here + if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10) > 0) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) + / 10); + aBaseMetaTileEntity.decrStackSize(2, 1); + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + OrePrefixes.dust, + (GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) + || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Coal) + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("coal") + || Block.getBlockFromItem(this.mInventory[2].getItem()) + .getUnlocalizedName() + .toLowerCase() + .contains("lignite")) ? Materials.DarkAsh : Materials.Ash, + 1L)); + } + // enables every other fuel with at least 2000 burntime as a fuel, + // i.e. peat, Magic/Solid Super Fuel, Coal + // Singularities, Nitor, while bucket of creosite should be blocked + // same goes for lava + } else if ((TileEntityFurnace.getItemBurnTime(this.mInventory[2])) >= 2000 - && !(this.mInventory[2].getUnlocalizedName() - .toLowerCase() - .contains("bucket") - || this.mInventory[2].getUnlocalizedName() - .toLowerCase() - .contains("cell"))) { - this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime( - this.mInventory[2]) / 10); - aBaseMetaTileEntity.decrStackSize(2, 1); - // adds tiny pile of ash for burntime under 10k, small pile for - // under 100k and pile for - // bigger values - if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) - aBaseMetaTileEntity.addStackToSlot( - 3, - GT_OreDictUnificator.get( - (TileEntityFurnace.getItemBurnTime( - this.mInventory[2]) - >= 10000 ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 ? OrePrefixes.dust : OrePrefixes.dustSmall : OrePrefixes.dustTiny), - Materials.Ash, - 1L)); - } + && !(this.mInventory[2].getUnlocalizedName() + .toLowerCase() + .contains("bucket") + || this.mInventory[2].getUnlocalizedName() + .toLowerCase() + .contains("cell"))) { + this.mProcessingEnergy += (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) / 10); + aBaseMetaTileEntity.decrStackSize(2, 1); + // adds tiny pile of ash for burntime under 10k, small pile for + // under 100k and pile for + // bigger values + if (XSTR.XSTR_INSTANCE.nextInt(2) == 0) + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get( + (TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 10000 + ? TileEntityFurnace.getItemBurnTime(this.mInventory[2]) >= 100000 + ? OrePrefixes.dust + : OrePrefixes.dustSmall + : OrePrefixes.dustTiny), + Materials.Ash, + 1L)); + } } @Override diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java index 0f03f6bee4..6ffcd37f28 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java @@ -66,17 +66,15 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - new String[] { "A Boiler running off Lava", - "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", - "Causes " + GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond - + " Pollution per second", - "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) - + "L of Lava every " - + COOLDOWN_INTERVAL - + " ticks when fully heat up" }); + aID, + aName, + aNameRegional, + new String[] { "A Boiler running off Lava", "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second", + "Causes " + GT_Mod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond + " Pollution per second", + "Consumes " + ((double) CONSUMPTION_PER_HEATUP / ENERGY_PER_LAVA) + + "L of Lava every " + + COOLDOWN_INTERVAL + + " ticks when fully heat up" }); } public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -89,7 +87,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { final ForgeDirection sideDirection = ForgeDirection.getOrientation(aSide); final ForgeDirection facingDirection = ForgeDirection.getOrientation(aFacing); final ForgeDirection rearDirection = facingDirection.getOpposite(); @@ -118,18 +116,18 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); rTextures[0][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM, colorModulation) }; rTextures[1][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_TOP, colorModulation), - TextureFactory.of(OVERLAY_DRAIN), TextureFactory.of(FLUID_IN_SIGN) }; + TextureFactory.of(OVERLAY_DRAIN), TextureFactory.of(FLUID_IN_SIGN) }; rTextures[2][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_IN_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_IN_SIGN) }; rTextures[3][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(BOILER_LAVA_FRONT, colorModulation), TextureFactory.of(BOILER_LAVA_FRONT_GLOW) }; + TextureFactory.of(BOILER_LAVA_FRONT, colorModulation), TextureFactory.of(BOILER_LAVA_FRONT_GLOW) }; rTextures[4][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), TextureFactory.builder() - .addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE), TextureFactory.builder() + .addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW) + .glow() + .build() }; rTextures[5][i] = new ITexture[] { TextureFactory.of(MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }; + TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(FLUID_OUT_SIGN) }; } return rTextures; } @@ -224,13 +222,13 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { if (equippedItemStack.stackSize > 1) { if (!aPlayer.inventory.addItemStackToInventory(returnedItemStack)) { aBaseMetaTileEntity.getWorld() - .spawnEntityInWorld( - new EntityItem( - aBaseMetaTileEntity.getWorld(), - (double) aBaseMetaTileEntity.getXCoord() + 0.5D, - (double) aBaseMetaTileEntity.getYCoord() + 1.5D, - (double) aBaseMetaTileEntity.getZCoord() + 0.5D, - equippedItemStack)); + .spawnEntityInWorld( + new EntityItem( + aBaseMetaTileEntity.getWorld(), + (double) aBaseMetaTileEntity.getXCoord() + 0.5D, + (double) aBaseMetaTileEntity.getYCoord() + 1.5D, + (double) aBaseMetaTileEntity.getZCoord() + 0.5D, + equippedItemStack)); } else if (aPlayer instanceof EntityPlayerMP) { ((EntityPlayerMP) aPlayer).sendContainerToPlayer(aPlayer.inventoryContainer); } @@ -246,9 +244,9 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); if (lavaTank.getFluid() != null) aNBT.setTag( - "mLava", - lavaTank.getFluid() - .writeToNBT(new NBTTagCompound())); + "mLava", + lavaTank.getFluid() + .writeToNBT(new NBTTagCompound())); aNBT.setInteger("mCooledLava", this.mCooledLava); } @@ -268,10 +266,10 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { if (mSteam == null || mSteam.amount == 0) return; pushSteamToSide( - aBaseMetaTileEntity, - ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()) - .getOpposite() - .ordinal()); + aBaseMetaTileEntity, + ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()) + .getOpposite() + .ordinal()); } /** @@ -284,14 +282,14 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { if (upTank == null) return; // Simulates drain of maximum lava amount up to 1000L that can fit the internal tank final FluidStack drainableLavaStack = upTank.drain( - ForgeDirection.DOWN, - FluidRegistry.getFluidStack( - "lava", - Math.min( - this.lavaTank.getCapacity() - - (this.lavaTank.getFluid() != null ? this.lavaTank.getFluid().amount : 0), - 1000)), - false); + ForgeDirection.DOWN, + FluidRegistry.getFluidStack( + "lava", + Math.min( + this.lavaTank.getCapacity() + - (this.lavaTank.getFluid() != null ? this.lavaTank.getFluid().amount : 0), + 1000)), + false); if (!GT_ModHandler.isLava(drainableLavaStack) || drainableLavaStack.amount <= 0) return; // Performs actual drain up and fill internal tank this.lavaTank.fill(upTank.drain(ForgeDirection.DOWN, drainableLavaStack, true), true); @@ -327,7 +325,7 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { final ForgeDirection frontDirection = ForgeDirection.getOrientation(frontFacing); if (frontFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) { final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 8D / 16D; final double oY = aBaseMetaTileEntity.getOffsetY(frontFacing, 1); @@ -359,13 +357,12 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.SMOKE) - .run(); + .run(); particleEventBuilder.setIdentifier(ParticleFX.FLAME) - .run(); + .run(); } } } @@ -381,11 +378,11 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { final FluidStack containedFluidStack = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()], true); if (GT_ModHandler.isWater(containedFluidStack)) super.onPreTick(aBaseMetaTileEntity, aTick); if (GT_ModHandler.isLava(containedFluidStack) - && lavaTank.fill(containedFluidStack, false) == containedFluidStack.amount - && aBaseMetaTileEntity.addStackToSlot( - getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), - 1)) { + && lavaTank.fill(containedFluidStack, false) == containedFluidStack.amount + && aBaseMetaTileEntity.addStackToSlot( + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { lavaTank.fill(containedFluidStack, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); } @@ -412,28 +409,25 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { if (aIndex != GT_MetaTileEntity_Boiler.SOUND_EVENT_LET_OFF_EXCESS_STEAM) return; final ForgeDirection rearDirection = ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()) - .getOpposite(); + .getOpposite(); GT_Utility.doSoundAtClient( - SoundResource.RANDOM_FIZZ, - 2, - 1.0F, - // Sound emitted from center of rear face (Steam Output) - aX + 0.5 * rearDirection.offsetX, - aY, - aZ + 0.5 * rearDirection.offsetZ); + SoundResource.RANDOM_FIZZ, + 2, + 1.0F, + // Sound emitted from center of rear face (Steam Output) + aX + 0.5 * rearDirection.offsetX, + aY, + aZ + 0.5 * rearDirection.offsetZ); new ParticleEventBuilder().setIdentifier(ParticleFX.CLOUD) - .setWorld(getBaseMetaTileEntity().getWorld()) - // Particles emitted with a 1 block/s velocity toward rear - .setMotion(rearDirection.offsetX / 20D, 0D, rearDirection.offsetZ / 20D) - .<ParticleEventBuilder>times( - 8, - // Particles emitted from center of rear face (Steam Output) - x -> x.setPosition( - aX + rearDirection.offsetX / 2D, - aY, - aZ + rearDirection.offsetZ / 2D) - .run()); + .setWorld(getBaseMetaTileEntity().getWorld()) + // Particles emitted with a 1 block/s velocity toward rear + .setMotion(rearDirection.offsetX / 20D, 0D, rearDirection.offsetZ / 20D) + .<ParticleEventBuilder>times( + 8, + // Particles emitted from center of rear face (Steam Output) + x -> x.setPosition(aX + rearDirection.offsetX / 2D, aY, aZ + rearDirection.offsetZ / 2D) + .run()); } @Override @@ -467,67 +461,59 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler { @Override public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { return new FluidTankInfo[] { super.getTankInfo(aSide)[0], - new FluidTankInfo(this.lavaTank.getFluid(), this.lavaTank.getCapacity()), - new FluidTankInfo(getDrainableStack(), getCapacity()) }; + new FluidTankInfo(this.lavaTank.getFluid(), this.lavaTank.getCapacity()), + new FluidTankInfo(getDrainableStack(), getCapacity()) }; } @Override protected IDrawable[] getAshSlotBackground() { return new IDrawable[] { getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_BLOCK_STEAM.get(getSteamVariant()) }; + GT_UITextures.OVERLAY_SLOT_BLOCK_STEAM.get(getSteamVariant()) }; } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inventoryHandler, 0).setPos(43, 25) - .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotIn())) - .widget( - new SlotWidget(inventoryHandler, 1).setAccess(true, false) - .setPos(43, 61) - .setBackground( - getGUITextureSet().getItemSlot(), - getOverlaySlotOut())) - .widget( - new FluidSlotWidget(lavaTank) - .setBackground( - getGUITextureSet().getFluidSlot(), - getOverlaySlotIn()) - .setPos(115, 61)) - .widget(createAshSlot()) - .widget( - new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(70, 25) - .setSize(10, 54)) - .widget( - new ProgressBar().setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_WATER, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(83, 25) - .setSize(10, 54)) - .widget( - new ProgressBar().setProgress(() -> (float) mTemperature / maxProgresstime()) - .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_HEAT, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(96, 25) - .setSize(10, 54)) - .widget( - new ProgressBar() - // cap minimum so that one can easily see there's fuel remaining - .setProgress( - () -> mProcessingEnergy > 0 - ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) - : 0) - .setTexture(getProgressbarFuel(), 14) - .setDirection(ProgressBar.Direction.UP) - .setPos(116, 45) - .setSize(14, 14)) - .widget( - new DrawableWidget().setDrawable(getOverlaySlotCanister()) - .setPos(43, 43) - .setSize(18, 18)); + new SlotWidget(inventoryHandler, 0).setPos(43, 25) + .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotIn())) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setPos(43, 61) + .setBackground(getGUITextureSet().getItemSlot(), getOverlaySlotOut())) + .widget( + new FluidSlotWidget(lavaTank).setBackground(getGUITextureSet().getFluidSlot(), getOverlaySlotIn()) + .setPos(115, 61)) + .widget(createAshSlot()) + .widget( + new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(70, 25) + .setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_WATER, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(83, 25) + .setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) mTemperature / maxProgresstime()) + .setTexture(getProgressbarEmpty(), GT_UITextures.PROGRESSBAR_BOILER_HEAT, 10) + .setDirection(ProgressBar.Direction.UP) + .setPos(96, 25) + .setSize(10, 54)) + .widget( + new ProgressBar() + // cap minimum so that one can easily see there's fuel remaining + .setProgress(() -> mProcessingEnergy > 0 ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) : 0) + .setTexture(getProgressbarFuel(), 14) + .setDirection(ProgressBar.Direction.UP) + .setPos(116, 45) + .setSize(14, 14)) + .widget( + new DrawableWidget().setDrawable(getOverlaySlotCanister()) + .setPos(43, 43) + .setSize(18, 18)); } static class LavaTank extends FluidTank { diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index 04fa676c16..38c0d6e9e2 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -37,10 +37,10 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { public static final String LPS_FMT = "%s L/s"; private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( - "gt.blockmachines.boiler.solar.desc.format", - "Steam Power by the Sun%n" + "Produces %sL of Steam per second%n" - + "Calcifies over time, reducing Steam output to %sL/s%n" - + "Break and replace to descale"); + "gt.blockmachines.boiler.solar.desc.format", + "Steam Power by the Sun%n" + "Produces %sL of Steam per second%n" + + "Calcifies over time, reducing Steam output to %sL/s%n" + + "Break and replace to descale"); protected final Config mConfig; protected int basicTemperatureMod = 5; // Base Celsius gain or loss private int mRunTimeTicks = 0; @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - Config aConfig) { + Config aConfig) { super(aName, aTier, aDescription, aTextures); mConfig = aConfig; } @@ -97,11 +97,12 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { - return String.format( + return String + .format( localizedDescFormat, GT_Utility.formatNumbers(getMaxOutputPerSecond()), GT_Utility.formatNumbers(getMinOutputPerSecond())) - .split("\\R"); + .split("\\R"); } public int getMinOutputPerSecond() { @@ -115,20 +116,20 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); rTextures[0][i] = new ITexture[] { - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation) }; + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation) }; rTextures[1][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR) }; + TextureFactory.of(BlockIcons.BOILER_SOLAR) }; rTextures[2][i] = new ITexture[] { - TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation) }; + TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation) }; rTextures[3][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE) }; + TextureFactory.of(BlockIcons.OVERLAY_PIPE) }; } return rTextures; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { int i = aColorIndex + 1; if (aSide >= 2) { if (aSide != aFacing) return mTextures[2][i]; @@ -189,8 +190,8 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { * maximum output per second, and return this or the minimum output per second */ return mConfig.getMaxOutputPerSecond() - - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) - / mConfig.getCalcificationTicks(); + - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) + / mConfig.getCalcificationTicks(); } else { return mConfig.getMaxOutputPerSecond(); } @@ -253,34 +254,35 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public String[] getInfoData() { - return String.format( + return String + .format( "Heat Capacity: " + EnumChatFormatting.GREEN - + "%s %%" - + EnumChatFormatting.RESET - + " Hot time: " - + EnumChatFormatting.RED - + "%s s" - + EnumChatFormatting.RESET - + "%n" - + "Min output: " - + EnumChatFormatting.RED - + LPS_FMT - + EnumChatFormatting.RESET - + " Max output: " - + EnumChatFormatting.RED - + LPS_FMT - + EnumChatFormatting.RESET - + "%n" - + "Current Output: " - + EnumChatFormatting.YELLOW - + LPS_FMT - + EnumChatFormatting.RESET, + + "%s %%" + + EnumChatFormatting.RESET + + " Hot time: " + + EnumChatFormatting.RED + + "%s s" + + EnumChatFormatting.RESET + + "%n" + + "Min output: " + + EnumChatFormatting.RED + + LPS_FMT + + EnumChatFormatting.RESET + + " Max output: " + + EnumChatFormatting.RED + + LPS_FMT + + EnumChatFormatting.RESET + + "%n" + + "Current Output: " + + EnumChatFormatting.YELLOW + + LPS_FMT + + EnumChatFormatting.RESET, GT_Utility.formatNumbers(getHeatCapacityPercent()), GT_Utility.formatNumbers(getHotTimeSeconds()), GT_Utility.formatNumbers(getMinOutputPerSecond()), GT_Utility.formatNumbers(getMaxOutputPerSecond()), GT_Utility.formatNumbers(getProductionPerSecond())) - .split("\\R"); + .split("\\R"); } public int getHeatCapacityPercent() { @@ -320,20 +322,20 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); currentTip.add( - String.format( - (GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), - tag.getInteger("calcificationOutput"), - tag.getInteger("maxCalcificationOutput"))); + String.format( + (GOLD + "Solar Boiler Output: " + RESET + "%d/%d L/s"), + tag.getInteger("calcificationOutput"), + tag.getInteger("maxCalcificationOutput"))); super.getWailaBody(itemStack, currentTip, accessor, config); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("calcificationOutput", (getProductionPerSecond())); tag.setInteger("maxCalcificationOutput", (getMaxOutputPerSecond())); @@ -348,34 +350,34 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { private final int maxRuntimeTicks; public Config(String aCategory, int aDefaultCalcificationTicks, int aDefaultMinOutputPerSecond, - int aDefaultMaxOutputPerSecond, int aDefaultCoolDownTicks) { + int aDefaultMaxOutputPerSecond, int aDefaultCoolDownTicks) { calcificationTicks = get( - aCategory, - "CalcificationTicks", - aDefaultCalcificationTicks, - "Number of run-time ticks before boiler starts calcification.", - "100% calcification and minimal output will be reached at 2 times this."); + aCategory, + "CalcificationTicks", + aDefaultCalcificationTicks, + "Number of run-time ticks before boiler starts calcification.", + "100% calcification and minimal output will be reached at 2 times this."); minOutputPerSecond = get(aCategory, "MinOutputPerSecond", aDefaultMinOutputPerSecond); maxOutputPerSecond = get(aCategory, "MaxOutputPerSecond", aDefaultMaxOutputPerSecond); coolDownTicks = get( - aCategory, - "CoolDownTicks", - aDefaultCoolDownTicks, - "Number of ticks it takes to lose 1°C."); + aCategory, + "CoolDownTicks", + aDefaultCoolDownTicks, + "Number of ticks it takes to lose 1°C."); // After which min output is reached. maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks() - / getMaxOutputPerSecond() + getCalcificationTicks(); + / getMaxOutputPerSecond() + getCalcificationTicks(); } protected int get(final String aCategory, final String aKey, final int aDefaultValue, - final String... aComments) { + final String... aComments) { final StringBuilder tCommentBuilder = new StringBuilder(); for (String tComment : aComments) tCommentBuilder.append(tComment) - .append('\n'); + .append('\n'); tCommentBuilder.append("Default: ") - .append(aDefaultValue); + .append(aDefaultValue); return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()) - .getInt(); + .getInt(); } public int getCalcificationTicks() { diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index 45e22c29fb..c20ea4018a 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -17,17 +17,17 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, Config aConfig) { + ITexture[][][] aTextures, Config aConfig) { super(aName, aTier, aDescription, aTextures, aConfig); } @@ -44,13 +44,13 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil int i = color + 1; short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); rTextures[0][i] = new ITexture[] { - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation) }; + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation) }; rTextures[1][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), - TextureFactory.of(BlockIcons.BOILER_SOLAR) }; + TextureFactory.of(BlockIcons.BOILER_SOLAR) }; rTextures[2][i] = new ITexture[] { - TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation) }; + TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation) }; rTextures[3][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), - TextureFactory.of(BlockIcons.OVERLAY_PIPE) }; + TextureFactory.of(BlockIcons.OVERLAY_PIPE) }; } return rTextures; } @@ -68,10 +68,10 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Solar_Steel( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mConfig); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mConfig); } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java index 67e821f636..12374c3313 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java @@ -20,12 +20,11 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro public GT_MetaTileEntity_Boiler_Steel(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - new String[] { "Faster than the Bronze Boiler", "Produces 300L of Steam per second", - "Causes " + GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond - + " Pollution per second" }); + aID, + aName, + aNameRegional, + new String[] { "Faster than the Bronze Boiler", "Produces 300L of Steam per second", + "Causes " + GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond + " Pollution per second" }); } public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -40,18 +39,18 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[5][17][]; final ITexture[] texBottom = { TextureFactory.of(MACHINE_STEELBRICKS_BOTTOM) }, - texTop = { TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE) }, - texSide = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE) }, - texFront = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(BOILER_FRONT), - TextureFactory.builder() - .addIcon(BOILER_FRONT_GLOW) - .glow() - .build() }, - texFrontActive = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(BOILER_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(BOILER_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + texTop = { TextureFactory.of(MACHINE_STEELBRICKS_TOP), TextureFactory.of(OVERLAY_PIPE) }, + texSide = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(OVERLAY_PIPE) }, + texFront = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(BOILER_FRONT), + TextureFactory.builder() + .addIcon(BOILER_FRONT_GLOW) + .glow() + .build() }, + texFrontActive = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE), TextureFactory.of(BOILER_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(BOILER_FRONT_ACTIVE_GLOW) + .glow() + .build() }; for (int i = 0; i < 17; i++) { rTextures[0][i] = texBottom; rTextures[1][i] = texTop; diff --git a/src/main/java/gregtech/common/tileentities/casings/upgrade/InventoryUpgrade.java b/src/main/java/gregtech/common/tileentities/casings/upgrade/InventoryUpgrade.java index ef57f40e65..06bb75c62f 100644 --- a/src/main/java/gregtech/common/tileentities/casings/upgrade/InventoryUpgrade.java +++ b/src/main/java/gregtech/common/tileentities/casings/upgrade/InventoryUpgrade.java @@ -86,19 +86,16 @@ public class InventoryUpgrade extends UpgradeCasing { @Override public void addUIWidgets(Builder builder, UIBuildContext buildContext) { builder.widget( - new TextFieldWidget().setGetter(() -> mInventoryName) - .setSetter((val) -> { - mInventoryName = val; - final IMultiBlockController controller = getTarget(false); - if (controller != null) { - controller.changeInventoryName( - mInventoryName, - mInventoryID.toString(), - mType); - } - }) - .setSize(100, 25) - .setPos(50, 30)); + new TextFieldWidget().setGetter(() -> mInventoryName) + .setSetter((val) -> { + mInventoryName = val; + final IMultiBlockController controller = getTarget(false); + if (controller != null) { + controller.changeInventoryName(mInventoryName, mInventoryID.toString(), mType); + } + }) + .setSize(100, 25) + .setPos(50, 30)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/debug/GT_MetaTileEntity_AdvDebugStructureWriter.java b/src/main/java/gregtech/common/tileentities/debug/GT_MetaTileEntity_AdvDebugStructureWriter.java index 5f77c09e15..deb71f93cf 100644 --- a/src/main/java/gregtech/common/tileentities/debug/GT_MetaTileEntity_AdvDebugStructureWriter.java +++ b/src/main/java/gregtech/common/tileentities/debug/GT_MetaTileEntity_AdvDebugStructureWriter.java @@ -45,10 +45,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock - implements IAddGregtechLogo, IAddUIWidgets { + implements IAddGregtechLogo, IAddUIWidgets { private static final HashMap<GT_MetaTileEntity_AdvDebugStructureWriter, BoundHighlighter> bondingBoxes = new HashMap<>( - 1); + 1); private final BoundHighlighter boundingBox = new BoundHighlighter(); private final short[] numbers = new short[6]; private boolean transpose = false; @@ -60,7 +60,7 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity } public GT_MetaTileEntity_AdvDebugStructureWriter(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -71,18 +71,18 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], aSide != aFacing - ? TextureFactory.of( - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) - .glow() - .build()) - : TextureFactory.of( - TextureFactory.builder() - .addIcon(Textures.BlockIcons.STRUCTURE_MARK) - .glow() - .build()) }; + ? TextureFactory.of( + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE) + .glow() + .build()) + : TextureFactory.of( + TextureFactory.builder() + .addIcon(Textures.BlockIcons.STRUCTURE_MARK) + .glow() + .build()) }; } @Override @@ -132,8 +132,8 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - ExtendedFacing writerFacing = ExtendedFacing.of( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())); + ExtendedFacing writerFacing = ExtendedFacing + .of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())); double[] abc = new double[3]; double[] xyz = new double[3]; boundingBox.dim = aBaseMetaTileEntity.getWorld().provider.dimensionId; @@ -143,17 +143,17 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity abc[2] = -numbers[2] - 0.5; writerFacing.getWorldOffset(abc, xyz); boundingBox.pos1 = new Vec3Impl( - aBaseMetaTileEntity.getXCoord() + (int) (xyz[0] + 0.5), - aBaseMetaTileEntity.getYCoord() + (int) (xyz[1] + 0.5), - aBaseMetaTileEntity.getZCoord() + (int) (xyz[2] + 0.5)); + aBaseMetaTileEntity.getXCoord() + (int) (xyz[0] + 0.5), + aBaseMetaTileEntity.getYCoord() + (int) (xyz[1] + 0.5), + aBaseMetaTileEntity.getZCoord() + (int) (xyz[2] + 0.5)); abc[0] = -numbers[0] + numbers[3] - 0.5; abc[1] = -numbers[1] + numbers[4] - 0.5; abc[2] = -numbers[2] + numbers[5] - 0.5; writerFacing.getWorldOffset(abc, xyz); boundingBox.pos2 = new Vec3Impl( - aBaseMetaTileEntity.getXCoord() + (int) (xyz[0] + 0.5), - aBaseMetaTileEntity.getYCoord() + (int) (xyz[1] + 0.5), - aBaseMetaTileEntity.getZCoord() + (int) (xyz[2] + 0.5)); + aBaseMetaTileEntity.getXCoord() + (int) (xyz[0] + 0.5), + aBaseMetaTileEntity.getYCoord() + (int) (xyz[1] + 0.5), + aBaseMetaTileEntity.getZCoord() + (int) (xyz[2] + 0.5)); } } @@ -172,24 +172,24 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity public void printStructure(EntityPlayer aPlayer) { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); String pseudoJavaCode = StructureUtility.getPseudoJavaCode( - aBaseMetaTileEntity.getWorld(), - ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord(), - numbers[0], - numbers[1], - numbers[2], - te -> te.getClass() - .getCanonicalName(), - numbers[3], - numbers[4], - numbers[5], - transpose); + aBaseMetaTileEntity.getWorld(), + ExtendedFacing.of(ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing())), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + numbers[0], + numbers[1], + numbers[2], + te -> te.getClass() + .getCanonicalName(), + numbers[3], + numbers[4], + numbers[5], + transpose); GT_FML_LOGGER.info(pseudoJavaCode); result = pseudoJavaCode.split("\\n"); aPlayer.addChatMessage( - new ChatComponentTranslation(translateToLocal("GT5U.machines.advdebugstructurewriter.printed"))); + new ChatComponentTranslation(translateToLocal("GT5U.machines.advdebugstructurewriter.printed"))); } @Override @@ -216,9 +216,9 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity @Override public String[] getDescription() { return new String[] { translateToLocal("GT5U.machines.advdebugstructurewriter.tooltip"), // Scans Blocks Around - translateToLocal("GT5U.machines.advdebugstructurewriter.tooltip.1"), // Prints Multiblock NonTE - // structure check code - translateToLocal("GT5U.machines.advdebugstructurewriter.tooltip.2") // ABC axes aligned to machine front + translateToLocal("GT5U.machines.advdebugstructurewriter.tooltip.1"), // Prints Multiblock NonTE + // structure check code + translateToLocal("GT5U.machines.advdebugstructurewriter.tooltip.2") // ABC axes aligned to machine front }; } @@ -240,86 +240,69 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setSize(90, 112) - .setPos(43, 4)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (getBaseMetaTileEntity().isServerSide()) { - printStructure( - widget.getContext() - .getPlayer()); - } - }) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_PRINT) - .setSize(18, 18) - .setPos(11, 128) - .addTooltip( - translateToLocal( - "GT5U.machines.advdebugstructurewriter.gui.print.tooltip"))) - .widget( - new CycleButtonWidget().setToggle(() -> transpose, aBoolean -> transpose = aBoolean) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_TRANSPOSE) - .setSize(18, 18) - .setPos(32, 128) - .addTooltip( - translateToLocal( - "GT5U.machines.advdebugstructurewriter.gui.transpose.tooltip"))) - .widget( - new CycleButtonWidget().setToggle( - () -> showHighlightBox, - aBoolean -> showHighlightBox = aBoolean) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_BOUNDING_BOX) - .setSize(18, 18) - .setPos(53, 128) - .addTooltip( - translateToLocal( - "GT5U.machines.advdebugstructurewriter.gui.highlight.tooltip"))) - .widget( - new MultiChildWidget().addChild( - new TextWidget( - translateToLocal("GT5U.machines.advdebugstructurewriter.gui.origin")) - .setDefaultColor( - 0xf0f0ff) - .setPos( - 0, - 0)) - .addChild( - TextWidget.dynamicString(() -> "A: " + numbers[0]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 10)) - .addChild( - TextWidget.dynamicString(() -> "B: " + numbers[1]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 18)) - .addChild( - TextWidget.dynamicString(() -> "C: " + numbers[2]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 26)) - .addChild( - new TextWidget( - translateToLocal( - "GT5U.machines.advdebugstructurewriter.gui.size")).setDefaultColor( - 0xf0f0ff) - .setPos( - 0, - 52)) - .addChild( - TextWidget.dynamicString(() -> "A: " + numbers[3]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 62)) - .addChild( - TextWidget.dynamicString(() -> "B: " + numbers[4]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 70)) - .addChild( - TextWidget.dynamicString(() -> "C: " + numbers[5]) - .setDefaultColor(0xf0f0ff) - .setPos(0, 78)) - .setPos(46, 8)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 112) + .setPos(43, 4)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (getBaseMetaTileEntity().isServerSide()) { + printStructure( + widget.getContext() + .getPlayer()); + } + }) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_PRINT) + .setSize(18, 18) + .setPos(11, 128) + .addTooltip(translateToLocal("GT5U.machines.advdebugstructurewriter.gui.print.tooltip"))) + .widget( + new CycleButtonWidget().setToggle(() -> transpose, aBoolean -> transpose = aBoolean) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_TRANSPOSE) + .setSize(18, 18) + .setPos(32, 128) + .addTooltip(translateToLocal("GT5U.machines.advdebugstructurewriter.gui.transpose.tooltip"))) + .widget( + new CycleButtonWidget().setToggle(() -> showHighlightBox, aBoolean -> showHighlightBox = aBoolean) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_BOUNDING_BOX) + .setSize(18, 18) + .setPos(53, 128) + .addTooltip(translateToLocal("GT5U.machines.advdebugstructurewriter.gui.highlight.tooltip"))) + .widget( + new MultiChildWidget() + .addChild( + new TextWidget(translateToLocal("GT5U.machines.advdebugstructurewriter.gui.origin")) + .setDefaultColor(0xf0f0ff) + .setPos(0, 0)) + .addChild( + TextWidget.dynamicString(() -> "A: " + numbers[0]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 10)) + .addChild( + TextWidget.dynamicString(() -> "B: " + numbers[1]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 18)) + .addChild( + TextWidget.dynamicString(() -> "C: " + numbers[2]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 26)) + .addChild( + new TextWidget(translateToLocal("GT5U.machines.advdebugstructurewriter.gui.size")) + .setDefaultColor(0xf0f0ff) + .setPos(0, 52)) + .addChild( + TextWidget.dynamicString(() -> "A: " + numbers[3]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 62)) + .addChild( + TextWidget.dynamicString(() -> "B: " + numbers[4]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 70)) + .addChild( + TextWidget.dynamicString(() -> "C: " + numbers[5]) + .setDefaultColor(0xf0f0ff) + .setPos(0, 78)) + .setPos(46, 8)); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, -16, -1, 25); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, 16, 1, 133); @@ -327,16 +310,16 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity } private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift, - int addNumber, int xPos) { + int addNumber, int xPos) { int[] yPos = new int[] { 4, 22, 40, 62, 80, 98 }; for (int i = 0; i < yPos.length; i++) { final int index = i; // needed for lambda builder.widget( - new ButtonWidget().setOnClick( - (clickData, widget) -> numbers[index] += clickData.shift ? addNumberShift : addNumber) - .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) - .setSize(18, 18) - .setPos(xPos, yPos[index])); + new ButtonWidget() + .setOnClick((clickData, widget) -> numbers[index] += clickData.shift ? addNumberShift : addNumber) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos[index])); } } @@ -348,9 +331,9 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(113, 96)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(113, 96)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java index 3db3a5eef9..e2aea182fb 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java @@ -31,15 +31,15 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe public GT_MetaTileEntity_DieselGenerator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Requires liquid Fuel", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond - * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) - + " Pollution per second" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires liquid Fuel", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond + * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier]) + + " Pollution per second" }); onConfigLoad(); } @@ -75,9 +75,9 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "DieselGenerator.efficiency.tier." + this.mTier, - (100 - this.mTier * 5)); + ConfigCategories.machineconfig, + "DieselGenerator.efficiency.tier." + this.mTier, + (100 - this.mTier * 5)); } @Override @@ -102,13 +102,13 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aTick % 100 == 0 && mFluid != null && mFluid.amount > this.getCapacity()) { GT_Log.err.println( - "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() - + " Coords: " - + aBaseMetaTileEntity.getXCoord() - + " " - + aBaseMetaTileEntity.getYCoord() - + " " - + aBaseMetaTileEntity.getZCoord()); + "Dupe Abuse: " + aBaseMetaTileEntity.getOwnerName() + + " Coords: " + + aBaseMetaTileEntity.getXCoord() + + " " + + aBaseMetaTileEntity.getYCoord() + + " " + + aBaseMetaTileEntity.getZCoord()); aBaseMetaTileEntity.setToFire(); } super.onPostTick(aBaseMetaTileEntity, aTick); @@ -127,19 +127,19 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { final double x = aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D - + XSTR_INSTANCE.nextFloat() * 14D / 16D; + + XSTR_INSTANCE.nextFloat() * 14D / 16D; final double y = aBaseMetaTileEntity.getOffsetY(topFacing, 1) + 1D / 32D; final double z = aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D - + XSTR_INSTANCE.nextFloat() * 14D / 16D; + + XSTR_INSTANCE.nextFloat() * 14D / 16D; new ParticleEventBuilder().setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld(getBaseMetaTileEntity().getWorld()) - .setIdentifier(ParticleFX.SMOKE) - .run(); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()) + .setIdentifier(ParticleFX.SMOKE) + .run(); } } } @@ -147,118 +147,118 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_FRONT_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BACK_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_TOP_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_SIDE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BACK_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_TOP_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(DIESEL_GENERATOR_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(DIESEL_GENERATOR_SIDE_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public int getPollution() { return (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond - * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[mTier]); + * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[mTier]); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index 2e0279552a..1c8aeebb40 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -19,30 +19,30 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Deprecated public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Requires flammable Gasses", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond - * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) - + " Pollution per second" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires flammable Gasses", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + + " Pollution per second" }); this.mEfficiency = 100 - aTier * 5; onConfigLoad(); } public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier, int mEfficiency) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Requires flammable Gasses", - "Causes " - + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond - * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) - + " Pollution per second" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Requires flammable Gasses", + "Causes " + + (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[aTier]) + + " Pollution per second" }); this.mEfficiency = mEfficiency; onConfigLoad(); } @@ -62,7 +62,7 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat } public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - int mEfficiency) { + int mEfficiency) { super(aName, aTier, aDescription, aTextures); this.mEfficiency = mEfficiency; onConfigLoad(); @@ -76,11 +76,11 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_GasTurbine( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mEfficiency); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mEfficiency); } @Override @@ -94,10 +94,8 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "GasTurbine.efficiency.tier." + this.mTier, - this.mEfficiency); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, this.mEfficiency); } @Override @@ -108,118 +106,118 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT), - TextureFactory.builder() - .addIcon(GAS_TURBINE_FRONT_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT), + TextureFactory.builder() + .addIcon(GAS_TURBINE_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BACK_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BACK_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BOTTOM_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BOTTOM_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP), - TextureFactory.builder() - .addIcon(GAS_TURBINE_TOP_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP), + TextureFactory.builder() + .addIcon(GAS_TURBINE_TOP_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_SIDE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_SIDE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BACK_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_TOP_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(GAS_TURBINE_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(GAS_TURBINE_SIDE_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public int getPollution() { return (int) (GT_Mod.gregtechproxy.mPollutionBaseGasTurbinePerSecond - * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[mTier]); + * GT_Mod.gregtechproxy.mPollutionGasTurbineReleasedByTier[mTier]); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java index 152a849d5a..33066f7617 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java @@ -24,31 +24,29 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != ForgeDirection.UP.ordinal()) { return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] }; + BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier] }; } if (!aActive) return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) }; - return new ITexture[] { - BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of( - BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() }; + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS) }; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + TextureFactory.of(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW), TextureFactory.builder() + .addIcon(BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @Override @@ -59,11 +57,11 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_LightningRod( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override @@ -86,8 +84,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach for (int i = aBaseMetaTileEntity.getYCoord() + 1; i < aWorld.getHeight() - 1; i++) { if (isRodValid && aBaseMetaTileEntity.getBlock(aX, i, aZ) - .getUnlocalizedName() - .equals("blockFenceIron")) { + .getUnlocalizedName() + .equals("blockFenceIron")) { aRodValue++; } else { isRodValid = false; @@ -99,9 +97,8 @@ public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMach } if (!aWorld.isThundering() && ((aY + aRodValue) < 128)) aRodValue = 0; if (XSTR_INSTANCE.nextInt(4 * aWorld.getHeight()) < (aRodValue * (aY + aRodValue))) { - aBaseMetaTileEntity.increaseStoredEnergyUnits( - maxEUStore() - aBaseMetaTileEntity.getStoredEU(), - false); + aBaseMetaTileEntity + .increaseStoredEnergyUnits(maxEUStore() - aBaseMetaTileEntity.getStoredEU(), false); aWorld.addWeatherEffect(new EntityLightningBolt(aWorld, aX, aY + aRodValue, aZ)); } } diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java index b67993770d..17089403c3 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java @@ -29,13 +29,13 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba } public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } @@ -48,10 +48,10 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MagicEnergyConverter( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -66,9 +66,9 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "MagicEnergyConverter.efficiency.tier." + this.mTier, - 100 - this.mTier * 5); + ConfigCategories.machineconfig, + "MagicEnergyConverter.efficiency.tier." + this.mTier, + 100 - this.mTier * 5); } @Override @@ -79,93 +79,93 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java index dded37de09..b95f79c0f5 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java @@ -69,13 +69,13 @@ interface MagicalEnergyBBListener { } public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_BasicGenerator - implements MagicalEnergyBBListener { + implements MagicalEnergyBBListener { private static final boolean THAUMCRAFT_LOADED = Thaumcraft.isModLoaded(); private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>( - 4); + 4); private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() - : new ArrayList<>(); + : new ArrayList<>(); private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>(); private static boolean sAllowMultipleEggs = false; private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null; @@ -97,7 +97,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } private GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(GregTech_API.sMachineFile); } @@ -118,12 +118,12 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B for (Aspect tAspect : Aspect.aspects.values()) { // noinspection UnstableApiUsage sAspectsEnergy.put( - tAspect, - Enums.getIfPresent( - TC_Aspects.class, - tAspect.getTag() - .toUpperCase(Locale.ENGLISH)) - .or(TC_Aspects.AER).mValue * sEnergyPerEssentia); + tAspect, + Enums.getIfPresent( + TC_Aspects.class, + tAspect.getTag() + .toUpperCase(Locale.ENGLISH)) + .or(TC_Aspects.AER).mValue * sEnergyPerEssentia); } } } @@ -137,9 +137,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B sharedConfigLoad(aConfig); mEfficiency = aConfig.get(machineconfig, "MagicEnergyAbsorber.efficiency.tier." + mTier, 100 - mTier * 10); mMaxVisPerDrain = (int) Math.round( - Math.sqrt( - (double) (V[mTier] * 10000) - / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); + Math.sqrt((double) (V[mTier] * 10000) / (sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100)))); if (Math.pow(mMaxVisPerDrain, 2) * sEnergyFromVis * (getEfficiency() != 0 ? getEfficiency() : 100) < V[mTier]) { mMaxVisPerDrain += 1; } @@ -150,13 +148,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (aPlayer.isSneaking()) mMagicalEnergyBB.decreaseTier(); else mMagicalEnergyBB.increaseTier(); GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - GT_LanguageManager.addStringLocalization( - "Interaction_DESCRIPTION_MagicalEnergyAbsorber_Screwdriver", - "Absorption range: %s blocks"), - mMagicalEnergyBB.getRange(), - true)); + aPlayer, + String.format( + GT_LanguageManager.addStringLocalization( + "Interaction_DESCRIPTION_MagicalEnergyAbsorber_Screwdriver", + "Absorption range: %s blocks"), + mMagicalEnergyBB.getRange(), + true)); mMagicalEnergyBB.update(); } @@ -208,43 +206,43 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final String LI = "- %%%"; final String EU_PER = "%%%EU per "; List<String> description = new ArrayList<>(); + description + .add(UNDERLINE + "Feasts on " + LIGHT_PURPLE + UNDERLINE + "magic" + GRAY + UNDERLINE + " close to it:"); description.add( - UNDERLINE + "Feasts on " + LIGHT_PURPLE + UNDERLINE + "magic" + GRAY + UNDERLINE + " close to it:"); - description.add( - LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) - + GRAY - + " " - + LIGHT_PURPLE - + "Dragon Egg" - + GRAY - + " atop"); + LI + (sAllowMultipleEggs ? "A " : "An " + YELLOW + UNDERLINE + "EXCLUSIVE" + RESET) + + GRAY + + " " + + LIGHT_PURPLE + + "Dragon Egg" + + GRAY + + " atop"); if (sEnergyPerEndercrystal > 0) { description.add(LI + sEnergyPerEndercrystal + EU_PER + LIGHT_PURPLE + "Ender Crystal" + GRAY + " in range"); } if (THAUMCRAFT_LOADED) { description.add(LI + mMaxVisPerDrain + "%%%CV/t from an " + LIGHT_PURPLE + "Energised Node" + GRAY); description.add( - LI + (sEnergyPerEssentia * getEfficiency()) / 100 - + EU_PER - + LIGHT_PURPLE - + "Essentia" - + GRAY - + " Aspect-Value from containers in range"); + LI + (sEnergyPerEssentia * getEfficiency()) / 100 + + EU_PER + + LIGHT_PURPLE + + "Essentia" + + GRAY + + " Aspect-Value from containers in range"); } description.add(" "); description.add(UNDERLINE + "Lookup range (Use Screwdriver to change):"); description.add("Default: %%%" + GREEN + mMagicalEnergyBB.getDefaultRange()); description.add("Max: %%%" + GREEN + mMagicalEnergyBB.getMaxRange()); description.add(" "); + description + .add(UNDERLINE + "Fuels on " + LIGHT_PURPLE + UNDERLINE + "enchantments" + GRAY + UNDERLINE + " input:"); description.add( - UNDERLINE + "Fuels on " + LIGHT_PURPLE + UNDERLINE + "enchantments" + GRAY + UNDERLINE + " input:"); - description.add( - "- Item: %%%" + (10000 * getEfficiency()) / 100 - + EU_PER - + LIGHT_PURPLE - + "enchant" - + GRAY - + " weight × level / max"); + "- Item: %%%" + (10000 * getEfficiency()) / 100 + + EU_PER + + LIGHT_PURPLE + + "enchant" + + GRAY + + " weight × level / max"); description.add("- Book: %%%" + 10000 + EU_PER + LIGHT_PURPLE + "enchant" + GRAY + " weight × level / max"); description.add(" "); description.add("Efficiency: %%%" + GREEN + getEfficiency() + "%"); @@ -254,29 +252,29 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build() }; } @Override @@ -287,56 +285,56 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_FRONT_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG), - TextureFactory.builder() - .addIcon(MACHINE_CASING_DRAGONEGG_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_DRAGONEGG_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW) + .glow() + .build() }; } @Override @@ -379,8 +377,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B } aBaseMetaTileEntity.increaseStoredEnergyUnits(tGeneratedEU, true); aBaseMetaTileEntity.setActive( - aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); + aBaseMetaTileEntity.isAllowedToWork() + && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } } @@ -403,10 +401,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double oY = aBaseMetaTileEntity.getYCoord() + 17D / 32D; final double oZ = aBaseMetaTileEntity.getZCoord() + 8D / 16D; - final ParticleEventBuilder particleEventBuilder = new ParticleEventBuilder().setWorld( - getBaseMetaTileEntity().getWorld()) - .setIdentifier( - ParticleFX.PORTAL); + final ParticleEventBuilder particleEventBuilder = new ParticleEventBuilder() + .setWorld(getBaseMetaTileEntity().getWorld()) + .setIdentifier(ParticleFX.PORTAL); for (int i = 0; i < 9; i++) { final double dX = (XSTR_INSTANCE.nextFloat() - 0.5D) / 2D; @@ -423,8 +420,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B final double mZ = dZ * 4D; particleEventBuilder.setMotion(mX, mY, mZ) - .setPosition(x, y, z) - .run(); + .setPosition(x, y, z) + .run(); } } } @@ -458,8 +455,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B private boolean isDisenchantableItem(ItemStack aStack) { return ((aStack.isItemEnchanted()) && (aStack.getItem() - .getItemEnchantability() - > 0)); + .getItemEnchantability() > 0)); } private boolean isEnchantedBook(ItemStack aStack) { @@ -507,7 +503,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B // Only consume input when it can store EU and push output if ((getBaseMetaTileEntity().getStoredEU() + tEU) < getBaseMetaTileEntity().getEUCapacity() - && getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) { + && getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) { decrStackSize(getInputSlot(), 1); } else { tEU = 0; @@ -524,11 +520,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (!hasEgg()) return 0; if (!sAllowMultipleEggs) { if (sActiveSiphon != null && sActiveSiphon != this - && sActiveSiphon.getBaseMetaTileEntity() != null - && !sActiveSiphon.getBaseMetaTileEntity() - .isInvalidTileEntity() - && sActiveSiphon.isChunkLoaded() - && sActiveSiphon.hasEgg()) { + && sActiveSiphon.getBaseMetaTileEntity() != null + && !sActiveSiphon.getBaseMetaTileEntity() + .isInvalidTileEntity() + && sActiveSiphon.isChunkLoaded() + && sActiveSiphon.hasEgg()) { getBaseMetaTileEntity().doExplosion(Integer.MAX_VALUE); } else { setActiveSiphon(this); @@ -538,9 +534,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (egg == Blocks.dragon_egg) { return sDragonEggEnergyPerTick; } else if (egg.getUnlocalizedName() - .contains("creeperEgg")) { - return sCreeperEggEnergyPerTick; - } + .contains("creeperEgg")) { + return sCreeperEggEnergyPerTick; + } return 0; } @@ -591,10 +587,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B Aspect aspect = mAvailableEssentiaAspects.get(i); long tAspectEU = ((long) sAspectsEnergy.get(aspect) * getEfficiency()) / 100; if (tAspectEU <= tEUtoGen && AspectSourceHelper.drainEssentia( - (TileEntity) getBaseMetaTileEntity(), - aspect, - ForgeDirection.UNKNOWN, - mMagicalEnergyBB.getRange())) { + (TileEntity) getBaseMetaTileEntity(), + aspect, + ForgeDirection.UNKNOWN, + mMagicalEnergyBB.getRange())) { tEUtoGen -= tAspectEU; tEU += tAspectEU; } @@ -608,7 +604,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (aBlock == Blocks.dragon_egg) return true; if (aBlock instanceof BlockDragonEgg) return true; return (aBlock.getUnlocalizedName() - .equals("tile.dragonEgg")); + .equals("tile.dragonEgg")); } private boolean isChunkLoaded() { @@ -713,18 +709,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B double tX = tBaseMetaTileEntity.getXCoord(); double tY = tBaseMetaTileEntity.getYCoord(); double tZ = tBaseMetaTileEntity.getZCoord(); - return AxisAlignedBB.getBoundingBox( - tX - tRange, - tY - tRange, - tZ - tRange, - tX + tRange, - tY + tRange, - tZ + tRange); + return AxisAlignedBB + .getBoundingBox(tX - tRange, tY - tRange, tZ - tRange, tX + tRange, tY + tRange, tZ + tRange); } private void scanLivingCrystals() { World tWorld = mAbsorber.getBaseMetaTileEntity() - .getWorld(); + .getWorld(); mLivingCrystalIDs.clear(); for (EntityEnderCrystal o : tWorld.getEntitiesWithinAABB(EntityEnderCrystal.class, getAxisAlignedBB())) { if (o.isEntityAlive()) { @@ -740,8 +731,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B int tRange = getRange(); int tY = tBaseMetaTileEntity.getYCoord(); int tMaxY = tBaseMetaTileEntity.getWorld() - .getHeight() - - 1; + .getHeight() - 1; // Make sure relative Y range stays between 0 and world max Y int rYMin = (tY - tRange >= 0) ? -tRange : -(tY); int rYMax = (((tY + tRange) <= tMaxY) ? tRange : tMaxY - tY); @@ -783,12 +773,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B if (mAbsorber == null) return; if (mAbsorber.getBaseMetaTileEntity() == null) return; if (mAbsorber.getBaseMetaTileEntity() - .isInvalidTileEntity()) - return; + .isInvalidTileEntity()) return; if (mAbsorber.getBaseMetaTileEntity() - .getWorld() - == null) - return; + .getWorld() == null) return; scanLivingCrystals(); scanAvailableAspects(); if (mListener != null) { diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java index b81b0b956b..7e9fff95aa 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java @@ -16,7 +16,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe private int mEfficiency; public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional, - int aTier) { + int aTier) { super(aID, aName, aNameRegional, aTier, aDescription); if (aTier > 8 || aTier < 4) { new Exception("Tier without Recipe Map!").printStackTrace(); @@ -35,7 +35,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe @Override public boolean isOutputFacing(byte aSide) { return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) - && (aSide != getBaseMetaTileEntity().getBackFacing()); + && (aSide != getBaseMetaTileEntity().getBackFacing()); } @Override @@ -84,111 +84,108 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe } public int onConfigLoad() { - return mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "SolidNaquadah.efficiency.tier." + mTier, - getBaseEff()); + return mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "SolidNaquadah.efficiency.tier." + mTier, getBaseEff()); } @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BACK_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_TOP_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE), + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BACK_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomActive(aColor)[0], + TextureFactory.of(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE), TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_TOP_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE_GLOW) + .glow() + .build() }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java index 6e4bbe2dc7..c1370cce63 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java @@ -36,7 +36,7 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS), - OVERLAYS_ENERGY_OUT[mTier] }; + OVERLAYS_ENERGY_OUT[mTier] }; } @Override @@ -62,47 +62,47 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build(), - OVERLAYS_ENERGY_OUT[mTier] }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build(), + OVERLAYS_ENERGY_OUT[mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS_YELLOW), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .glow() + .build() }; } @Override @@ -132,9 +132,9 @@ public class GT_MetaTileEntity_PlasmaGenerator extends GT_MetaTileEntity_BasicGe public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "PlasmaGenerator.efficiency.tier." + this.mTier, - Math.max(10, 10 + Math.min(90, this.mTier * 10))); + ConfigCategories.machineconfig, + "PlasmaGenerator.efficiency.tier." + this.mTier, + Math.max(10, 10 + Math.min(90, this.mTier * 10))); } @Override diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java index 6d59c050d0..a875fd521c 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java @@ -20,11 +20,11 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - new String[] { "Converts Steam into EU", "Base rate: 2L of Steam -> 1 EU" }); + aID, + aName, + aNameRegional, + aTier, + new String[] { "Converts Steam into EU", "Base rate: 2L of Steam -> 1 EU" }); onConfigLoad(); } @@ -59,9 +59,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length); desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%"; desc[mDescriptionArray.length + 1] = String.format( - "Consumes up to %sL of Steam per second", - (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, Math.max(mTier - 1, 0))) - / (600 / getEfficiency()))); + "Consumes up to %sL of Steam per second", + (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, Math.max(mTier - 1, 0))) / (600 / getEfficiency()))); return desc; } @@ -71,10 +70,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener } public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "SteamTurbine.efficiency.tier." + this.mTier, - 6 + this.mTier); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + this.mTier); } @Override @@ -96,113 +93,113 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener @Override public ITexture[] getFront(byte aColor) { return new ITexture[] { super.getFront(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_FRONT), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_FRONT_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_FRONT_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { return new ITexture[] { super.getBack(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BACK), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_BACK_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BACK_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottom(byte aColor) { return new ITexture[] { super.getBottom(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BOTTOM), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_BOTTOM_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BOTTOM_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTop(byte aColor) { return new ITexture[] { super.getTop(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_TOP), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_TOP_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_TOP_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSides(byte aColor) { return new ITexture[] { super.getSides(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_SIDE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_SIDE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_SIDE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getFrontActive(byte aColor) { return new ITexture[] { super.getFrontActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_FRONT_ACTIVE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_FRONT_ACTIVE_GLOW) - .glow() - .build()), - OVERLAYS_ENERGY_OUT[this.mTier] }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_FRONT_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_FRONT_ACTIVE_GLOW) + .glow() + .build()), + OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { return new ITexture[] { super.getBackActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BACK_ACTIVE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_BACK_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BACK_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BACK_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getBottomActive(byte aColor) { return new ITexture[] { super.getBottomActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_BOTTOM_ACTIVE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_BOTTOM_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_BOTTOM_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_BOTTOM_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getTopActive(byte aColor) { return new ITexture[] { super.getTopActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_TOP_ACTIVE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_TOP_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_TOP_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_TOP_ACTIVE_GLOW) + .glow() + .build()) }; } @Override public ITexture[] getSidesActive(byte aColor) { return new ITexture[] { super.getSidesActive(aColor)[0], - TextureFactory.of( - TextureFactory.of(STEAM_TURBINE_SIDE_ACTIVE), - TextureFactory.builder() - .addIcon(STEAM_TURBINE_SIDE_ACTIVE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(STEAM_TURBINE_SIDE_ACTIVE), + TextureFactory.builder() + .addIcon(STEAM_TURBINE_SIDE_ACTIVE_GLOW) + .glow() + .build()) }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java index bf027be770..252cc6a5b8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java @@ -11,7 +11,7 @@ import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -20,7 +20,7 @@ public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicH } public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -33,15 +33,12 @@ public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicH public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - rTextures[0][(i + 1)] = new ITexture[] { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[1][(i + 1)] = new ITexture[] { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZE_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][(i + 1)] = new ITexture[] { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZE_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + rTextures[0][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + rTextures[1][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + rTextures[2][(i + 1)] = new ITexture[] { + TextureFactory.of(Textures.BlockIcons.MACHINE_BRONZE_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; } return rTextures; } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java index 6be36f5798..ee788ba8c0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java @@ -11,44 +11,41 @@ import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_BronzeBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_BronzeBricks( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp0 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp1 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp2 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java index 72785918b6..85e461bf47 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java @@ -11,7 +11,7 @@ import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } @@ -32,16 +32,14 @@ public class GT_MetaTileEntity_BasicHull_Steel extends GT_MetaTileEntity_BasicHu public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_STEEL_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp0 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = { - TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_STEEL_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp2 = { + TextureFactory.of(Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java index 39cd8fec3c..cd5f547d22 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java @@ -11,44 +11,41 @@ import gregtech.api.render.TextureFactory; public class GT_MetaTileEntity_BasicHull_SteelBricks extends GT_MetaTileEntity_BasicHull_NonElectric { public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicHull_SteelBricks( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[3][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp0 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp1 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = { TextureFactory.of( - Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; + ITexture[] tmp2 = { TextureFactory + .of(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[2][(i + 1)] = tmp2; } return rTextures; diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java index 6910fd9de5..2b78fd5c55 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java @@ -62,7 +62,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.gui.modularui.widget.AESlotWidget; public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus - implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets, IPowerChannelState { + implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets, IPowerChannelState { private static final int SLOT_COUNT = 16; private BaseActionSource requestSource = null; @@ -76,22 +76,22 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch public GT_MetaTileEntity_Hatch_InputBus_ME(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - 1, - SLOT_COUNT * 2 + 1, - new String[] { "Advanced item input for Multiblocks", "Retrieves directly from ME", - "Keeps 16 item types in stock", - "Auto-Pull from ME mode will automatically stock the first 16 items in the ME system, updated every 5 seconds.", - "Toggle by right-clicking with screwdriver, or use the GUI.", - "Use the GUI to limit the minimum stack size for Auto-Pulling.", - "Configuration data can be copy+pasted using a data stick." }); + aID, + aName, + aNameRegional, + 1, + SLOT_COUNT * 2 + 1, + new String[] { "Advanced item input for Multiblocks", "Retrieves directly from ME", + "Keeps 16 item types in stock", + "Auto-Pull from ME mode will automatically stock the first 16 items in the ME system, updated every 5 seconds.", + "Toggle by right-clicking with screwdriver, or use the GUI.", + "Use the GUI to limit the minimum stack size for Auto-Pulling.", + "Configuration data can be copy+pasted using a data stick." }); disableSort = true; } public GT_MetaTileEntity_Hatch_InputBus_ME(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, SLOT_COUNT * 2 + 1, aDescription, aTextures); disableSort = true; } @@ -135,14 +135,14 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch if (gridProxy == null) { if (getBaseMetaTileEntity() instanceof IGridProxyable) { gridProxy = new AENetworkProxy( - (IGridProxyable) getBaseMetaTileEntity(), - "proxy", - ItemList.Hatch_Output_Bus_ME.get(1), - true); + (IGridProxyable) getBaseMetaTileEntity(), + "proxy", + ItemList.Hatch_Output_Bus_ME.get(1), + true); gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner( - getBaseMetaTileEntity().getWorld() - .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); } } return this.gridProxy; @@ -217,10 +217,8 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch public String[] getInfoData() { if (GregTech_API.mAE2) { return new String[] { - "The bus is " - + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" - : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) - + EnumChatFormatting.RESET }; + "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" + : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET }; } else return new String[] {}; } @@ -245,7 +243,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { if (!(aPlayer instanceof EntityPlayerMP)) return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); ItemStack dataStick = aPlayer.inventory.getCurrentItem(); @@ -332,7 +330,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch } try { IMEMonitor<IAEItemStack> sg = proxy.getStorage() - .getItemInventory(); + .getItemInventory(); IAEItemStack request = AEItemStack.create(mInventory[aIndex]); request.setStackSize(Integer.MAX_VALUE); IAEItemStack result = sg.extractItems(request, Actionable.SIMULATE, getRequestSource()); @@ -377,9 +375,9 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch AENetworkProxy proxy = getProxy(); try { IMEMonitor<IAEItemStack> sg = proxy.getStorage() - .getItemInventory(); + .getItemInventory(); Iterator<IAEItemStack> iterator = sg.getStorageList() - .iterator(); + .iterator(); int index = 0; while (iterator.hasNext() && index < SLOT_COUNT) { IAEItemStack currItem = iterator.next(); @@ -413,12 +411,12 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch AENetworkProxy proxy = getProxy(); try { IMEMonitor<IAEItemStack> sg = proxy.getStorage() - .getItemInventory(); + .getItemInventory(); IAEItemStack request = AEItemStack.create(mInventory[i]); request.setStackSize(savedStackSizes[i] - (oldStack == null ? 0 : oldStack.stackSize)); sg.extractItems(request, Actionable.MODULATE, getRequestSource()); proxy.getEnergy() - .extractAEPower(request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG); + .extractAEPower(request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG); setInventorySlotContents(i + SLOT_COUNT, oldStack); } catch (final GridAccessException ignored) {} } @@ -442,7 +440,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch } try { IMEMonitor<IAEItemStack> sg = proxy.getStorage() - .getItemInventory(); + .getItemInventory(); IAEItemStack request = AEItemStack.create(mInventory[aIndex]); request.setStackSize(Integer.MAX_VALUE); IAEItemStack result = sg.extractItems(request, Actionable.SIMULATE, getRequestSource()); @@ -465,77 +463,76 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch final SlotWidget[] aeSlotWidgets = new SlotWidget[16]; buildContext.addSyncedWindow(CONFIG_WINDOW_ID, this::createStackSizeConfigurationWindow); builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4) + .startFromSlot(0) + .endAtSlot(15) + .phantom(true) + .background(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_ARROW_ME) + .widgetCreator(slot -> new SlotWidget(slot) { + + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + if (clickData.mouseButton != 0 || autoPullItemList) return; + final int aSlotIndex = getMcSlot().getSlotIndex(); + if (cursorStack == null) { + getMcSlot().putStack(null); + } else { + if (containsSuchStack(cursorStack)) return; + getMcSlot().putStack(GT_Utility.copyAmount(1L, cursorStack)); + } + if (getBaseMetaTileEntity().isServerSide()) { + final ItemStack newInfo = updateInformationSlot(aSlotIndex, cursorStack); + aeSlotWidgets[getMcSlot().getSlotIndex()].getMcSlot() + .putStack(newInfo); + } + } + + private boolean containsSuchStack(ItemStack tStack) { + for (int i = 0; i < 16; ++i) { + if (GT_Utility.areStacksEqual(mInventory[i], tStack, false)) return true; + } + return false; + } + }) + .build() + .setPos(7, 9)) + .widget( SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(0) - .endAtSlot(15) - .phantom(true) - .background(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_ARROW_ME) - .widgetCreator(slot -> new SlotWidget(slot) { - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - if (clickData.mouseButton != 0 || autoPullItemList) return; - final int aSlotIndex = getMcSlot().getSlotIndex(); - if (cursorStack == null) { - getMcSlot().putStack(null); - } else { - if (containsSuchStack(cursorStack)) return; - getMcSlot().putStack(GT_Utility.copyAmount(1L, cursorStack)); - } - if (getBaseMetaTileEntity().isServerSide()) { - final ItemStack newInfo = updateInformationSlot(aSlotIndex, cursorStack); - aeSlotWidgets[getMcSlot().getSlotIndex()].getMcSlot() - .putStack(newInfo); - } - } - - private boolean containsSuchStack(ItemStack tStack) { - for (int i = 0; i < 16; ++i) { - if (GT_Utility.areStacksEqual(mInventory[i], tStack, false)) return true; - } - return false; - } - }) - .build() - .setPos(7, 9)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(16) - .endAtSlot(31) - .phantom(true) - .background(GT_UITextures.SLOT_DARK_GRAY) - .widgetCreator( - slot -> aeSlotWidgets[slot.getSlotIndex() - - 16] = new AESlotWidget(slot).disableInteraction()) - .build() - .setPos(97, 9)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_DOUBLE) - .setPos(82, 40) - .setSize(12, 12)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - setAutoPullItemList(!autoPullItemList); - } else if (clickData.mouseButton == 1 && !widget.isClient()) { - widget.getContext() - .openSyncedWindow(CONFIG_WINDOW_ID); - } - }) - .setPlayClickSound(true) - .setBackground(() -> { - List<UITexture> ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (autoPullItemList) ret.add(GT_UITextures.OVERLAY_BUTTON_AUTOPULL_ME); - else ret.add(GT_UITextures.OVERLAY_BUTTON_AUTOPULL_ME_DISABLED); - return ret.toArray(new IDrawable[0]); - }) - .addTooltips( - ImmutableList.of( - "Click to toggle automatic item pulling from ME.", - "Right-Click to edit minimum stack size for item pulling.")) - .setSize(16, 16) - .setPos(80, 10)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> autoPullItemList, this::setAutoPullItemList)); + .startFromSlot(16) + .endAtSlot(31) + .phantom(true) + .background(GT_UITextures.SLOT_DARK_GRAY) + .widgetCreator( + slot -> aeSlotWidgets[slot.getSlotIndex() - 16] = new AESlotWidget(slot).disableInteraction()) + .build() + .setPos(97, 9)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_ARROW_DOUBLE) + .setPos(82, 40) + .setSize(12, 12)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (clickData.mouseButton == 0) { + setAutoPullItemList(!autoPullItemList); + } else if (clickData.mouseButton == 1 && !widget.isClient()) { + widget.getContext() + .openSyncedWindow(CONFIG_WINDOW_ID); + } + }) + .setPlayClickSound(true) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (autoPullItemList) ret.add(GT_UITextures.OVERLAY_BUTTON_AUTOPULL_ME); + else ret.add(GT_UITextures.OVERLAY_BUTTON_AUTOPULL_ME_DISABLED); + return ret.toArray(new IDrawable[0]); + }) + .addTooltips( + ImmutableList.of( + "Click to toggle automatic item pulling from ME.", + "Right-Click to edit minimum stack size for item pulling.")) + .setSize(16, 16) + .setPos(80, 10)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> autoPullItemList, this::setAutoPullItemList)); } protected ModularWindow createStackSizeConfigurationWindow(final EntityPlayer player) { @@ -548,39 +545,37 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch builder.setGuiTint(getGUIColorization()); builder.setDraggable(true); builder.setPos( - (size, window) -> Alignment.Center.getAlignedPos(size, new Size(PARENT_WIDTH, PARENT_HEIGHT)) - .add( - Alignment.TopRight.getAlignedPos( - new Size(PARENT_WIDTH, PARENT_HEIGHT), - new Size(WIDTH, HEIGHT)) - .add(WIDTH - 3, 0))); + (size, window) -> Alignment.Center.getAlignedPos(size, new Size(PARENT_WIDTH, PARENT_HEIGHT)) + .add( + Alignment.TopRight.getAlignedPos(new Size(PARENT_WIDTH, PARENT_HEIGHT), new Size(WIDTH, HEIGHT)) + .add(WIDTH - 3, 0))); builder.widget( - new TextWidget("Min Stack Size").setPos(3, 2) - .setSize(74, 14)) - .widget( - new TextFieldWidget().setSetterInt(val -> minAutoPullStackSize = val) - .setGetterInt(() -> minAutoPullStackSize) - .setNumbers(1, Integer.MAX_VALUE) - .setOnScrollNumbers(1, 4, 64) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(36, 18) - .setPos(19, 18) - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD)); + new TextWidget("Min Stack Size").setPos(3, 2) + .setSize(74, 14)) + .widget( + new TextFieldWidget().setSetterInt(val -> minAutoPullStackSize = val) + .setGetterInt(() -> minAutoPullStackSize) + .setNumbers(1, Integer.MAX_VALUE) + .setOnScrollNumbers(1, 4, 64) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setSize(36, 18) + .setPos(19, 18) + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD)); return builder.build(); } @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(80, 63)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(80, 63)); } @Override public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { NBTTagCompound tag = accessor.getNBTData(); boolean autopull = tag.getBoolean("autoPull"); int minSize = tag.getInteger("minStackSize"); @@ -591,7 +586,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { tag.setBoolean("autoPull", autoPullItemList); tag.setInteger("minStackSize", minAutoPullStackSize); super.getWailaNBTData(player, tile, tag, world, x, y, z); diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java index 606c0b8157..22afe4b9fe 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java @@ -43,14 +43,13 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus - implements IPowerChannelState { + implements IPowerChannelState { private BaseActionSource requestSource = null; private AENetworkProxy gridProxy = null; IItemList<IAEItemStack> itemCache = GregTech_API.mAE2 ? AEApi.instance() - .storage() - .createItemList() - : null; + .storage() + .createItemList() : null; long lastOutputTick = 0; long tickCounter = 0; boolean lastOutputFailed = false; @@ -58,16 +57,16 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc public GT_MetaTileEntity_Hatch_OutputBus_ME(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - 1, - new String[] { "Item Output for Multiblocks", "Stores directly into ME", }, - 0); + aID, + aName, + aNameRegional, + 1, + new String[] { "Item Output for Multiblocks", "Stores directly into ME", }, + 0); } public GT_MetaTileEntity_Hatch_OutputBus_ME(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 0, aDescription, aTextures); } @@ -108,9 +107,9 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc public int store(final ItemStack stack) { if (!infiniteCache && lastOutputFailed) return stack.stackSize; itemCache.add( - AEApi.instance() - .storage() - .createItemStack(stack)); + AEApi.instance() + .storage() + .createItemStack(stack)); return 0; } @@ -132,12 +131,10 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .isGUIClickable()) - return; + .isGUIClickable()) return; infiniteCache = !infiniteCache; - GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.infiniteCache." + infiniteCache)); + GT_Utility + .sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.hatch.infiniteCache." + infiniteCache)); } @Override @@ -145,14 +142,14 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc if (gridProxy == null) { if (getBaseMetaTileEntity() instanceof IGridProxyable) { gridProxy = new AENetworkProxy( - (IGridProxyable) getBaseMetaTileEntity(), - "proxy", - ItemList.Hatch_Output_Bus_ME.get(1), - true); + (IGridProxyable) getBaseMetaTileEntity(), + "proxy", + ItemList.Hatch_Output_Bus_ME.get(1), + true); gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner( - getBaseMetaTileEntity().getWorld() - .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); } } return this.gridProxy; @@ -170,7 +167,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc } try { IMEMonitor<IAEItemStack> sg = proxy.getStorage() - .getItemInventory(); + .getItemInventory(); for (IAEItemStack s : itemCache) { if (s.getStackSize() == 0) continue; IAEItemStack rest = Platform.poweredInsert(proxy.getEnergy(), sg, s, getRequest()); @@ -217,7 +214,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tagItemStack = new NBTTagCompound(); s.getItemStack() - .writeToNBT(tagItemStack); + .writeToNBT(tagItemStack); tag.setTag("itemStack", tagItemStack); tag.setLong("size", s.getStackSize()); items.appendTag(tag); @@ -234,30 +231,30 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc if (GregTech_API.mAE2) { NBTBase t = aNBT.getTag("cachedStack"); // legacy if (t instanceof NBTTagCompound) itemCache.add( - AEApi.instance() - .storage() - .createItemStack(GT_Utility.loadItem((NBTTagCompound) t))); + AEApi.instance() + .storage() + .createItemStack(GT_Utility.loadItem((NBTTagCompound) t))); t = aNBT.getTag("cachedItems"); if (t instanceof NBTTagList l) { for (int i = 0; i < l.tagCount(); ++i) { NBTTagCompound tag = l.getCompoundTagAt(i); if (!tag.hasKey("itemStack")) { // legacy #868 itemCache.add( - AEApi.instance() - .storage() - .createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i)))); + AEApi.instance() + .storage() + .createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i)))); continue; } NBTTagCompound tagItemStack = tag.getCompoundTag("itemStack"); final IAEItemStack s = AEApi.instance() - .storage() - .createItemStack(GT_Utility.loadItem(tagItemStack)); + .storage() + .createItemStack(GT_Utility.loadItem(tagItemStack)); if (s != null) { s.setStackSize(tag.getLong("size")); itemCache.add(s); } else { GT_Mod.GT_FML_LOGGER.warn( - "An error occurred while loading contents of ME Output Bus, some items have been voided"); + "An error occurred while loading contents of ME Output Bus, some items have been voided"); } } } @@ -279,8 +276,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc if (!GregTech_API.mAE2) return new String[] {}; List<String> ss = new ArrayList<>(); ss.add( - "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" - : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET); + "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" + : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET); if (itemCache.isEmpty()) { ss.add("The bus has no cached items"); } else { @@ -289,11 +286,11 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc int counter = 0; for (IAEItemStack s : itemCache) { ss.add( - s.getItem() - .getItemStackDisplayName(s.getItemStack()) + ": " - + EnumChatFormatting.GOLD - + nc.toWideReadableForm(s.getStackSize()) - + EnumChatFormatting.RESET); + s.getItem() + .getItemStackDisplayName(s.getItemStack()) + ": " + + EnumChatFormatting.GOLD + + nc.toWideReadableForm(s.getStackSize()) + + EnumChatFormatting.RESET); if (++counter > 100) break; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java index 780a6c03de..0c65d1bc2e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java +++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java @@ -52,9 +52,8 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O private BaseActionSource requestSource = null; private AENetworkProxy gridProxy = null; IItemList<IAEFluidStack> fluidCache = GregTech_API.mAE2 ? AEApi.instance() - .storage() - .createFluidList() - : null; + .storage() + .createFluidList() : null; long lastOutputTick = 0; long tickCounter = 0; boolean lastOutputFailed = false; @@ -62,12 +61,12 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O public GT_MetaTileEntity_Hatch_Output_ME(int aID, String aName, String aNameRegional) { super( - aID, - aName, - aNameRegional, - 1, - new String[] { "Fluid Output for Multiblocks", "Stores directly into ME", }, - 0); + aID, + aName, + aNameRegional, + 1, + new String[] { "Fluid Output for Multiblocks", "Stores directly into ME", }, + 0); } public GT_MetaTileEntity_Hatch_Output_ME(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -115,9 +114,9 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O public int tryFillAE(final FluidStack aFluid) { if ((!infiniteCache && lastOutputFailed) || aFluid == null) return 0; fluidCache.add( - AEApi.instance() - .storage() - .createFluidStack(aFluid)); + AEApi.instance() + .storage() + .createFluidStack(aFluid)); return aFluid.amount; } @@ -153,12 +152,11 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { // Don't allow to lock fluid in me fluid hatch if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide) - .isGUIClickable()) - return; + .isGUIClickable()) return; infiniteCache = !infiniteCache; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.hatch.infiniteCacheFluid." + infiniteCache)); + aPlayer, + StatCollector.translateToLocal("GT5U.hatch.infiniteCacheFluid." + infiniteCache)); } @Override @@ -166,14 +164,14 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O if (gridProxy == null) { if (getBaseMetaTileEntity() instanceof IGridProxyable) { gridProxy = new AENetworkProxy( - (IGridProxyable) getBaseMetaTileEntity(), - "proxy", - ItemList.Hatch_Output_ME.get(1), - true); + (IGridProxyable) getBaseMetaTileEntity(), + "proxy", + ItemList.Hatch_Output_ME.get(1), + true); gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner( - getBaseMetaTileEntity().getWorld() - .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); } } return this.gridProxy; @@ -191,7 +189,7 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O } try { IMEMonitor<IAEFluidStack> sg = proxy.getStorage() - .getFluidInventory(); + .getFluidInventory(); for (IAEFluidStack s : fluidCache) { if (s.getStackSize() == 0) continue; IAEFluidStack rest = fluidAEInsert(proxy.getEnergy(), sg, s, getRequest()); @@ -237,7 +235,7 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tagFluidStack = new NBTTagCompound(); s.getFluidStack() - .writeToNBT(tagFluidStack); + .writeToNBT(tagFluidStack); tag.setTag("fluidStack", tagFluidStack); tag.setLong("size", s.getStackSize()); fluids.appendTag(tag); @@ -257,14 +255,14 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O NBTTagCompound tag = l.getCompoundTagAt(i); NBTTagCompound tagFluidStack = tag.getCompoundTag("fluidStack"); final IAEFluidStack s = AEApi.instance() - .storage() - .createFluidStack(GT_Utility.loadFluid(tagFluidStack)); + .storage() + .createFluidStack(GT_Utility.loadFluid(tagFluidStack)); if (s != null) { s.setStackSize(tag.getLong("size")); fluidCache.add(s); } else { GT_Mod.GT_FML_LOGGER.warn( - "An error occurred while loading contents of ME Output Hatch, some fluids have been voided"); + "An error occurred while loading contents of ME Output Hatch, some fluids have been voided"); } } } @@ -286,8 +284,8 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O if (!GregTech_API.mAE2) return new String[] {}; List<String> ss = new ArrayList<>(); ss.add( - "The hatch is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" - : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET); + "The hatch is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online" + : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET); if (fluidCache.isEmpty()) { ss.add("The bus has no cached fluids"); } else { @@ -296,12 +294,12 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O int counter = 0; for (IAEFluidStack s : fluidCache) { ss.add( - s.getFluidStack() - .getLocalizedName() + ": " - + EnumChatFormatting.GOLD - + nc.toWideReadableForm(s.getStackSize()) - + " mB" - + EnumChatFormatting.RESET); + s.getFluidStack() + .getLocalizedName() + ": " + + EnumChatFormatting.GOLD + + nc.toWideReadableForm(s.getStackSize()) + + " mB" + + EnumChatFormatting.RESET); if (++counter > 100) break; } } @@ -309,7 +307,7 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O } public static IAEFluidStack fluidAEInsert(final IEnergySource energy, final IMEInventory<IAEFluidStack> cell, - final IAEFluidStack input, final BaseActionSource src) { + final IAEFluidStack input, final BaseActionSource src) { final IAEFluidStack possible = cell.injectItems(input.copy(), Actionable.SIMULATE, src); long stored = input.getStackSize(); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index ad55276576..089713f01a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -42,66 +42,66 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba int cZ; public GT_MetaTileEntity_AdvSeismicProspector(int aID, String aName, String aNameRegional, int aTier, int aRadius, - int aStep) { + int aStep) { super( - aID, - aName, - aNameRegional, - aTier, - 1, // amperage - "", - 1, // input slot count - 1, // output slot count - "Default.png", // GUI name - "", // NEI name - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, // amperage + "", + 1, // input slot count + 1, // output slot count + "Default.png", // GUI name + "", // NEI name + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); radius = aRadius; step = aStep; } @@ -109,14 +109,14 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba @Override public String[] getDescription() { return new String[] { "Place, activate with explosives", - "2 Powderbarrels, " + "4 Glyceryl Trinitrate, " + "16 TNT, or " + "8 ITNT", - "Use Data Stick, Scan Data Stick, Print Data Stick, Bind Pages into Book", - "Ore prospecting area = " + radius * 2 + "x" + radius * 2 + " ONLY blocks below prospector", - "Oil prospecting area 3x3 oilfields, each is 8x8 chunks" }; + "2 Powderbarrels, " + "4 Glyceryl Trinitrate, " + "16 TNT, or " + "8 ITNT", + "Use Data Stick, Scan Data Stick, Print Data Stick, Bind Pages into Book", + "Ore prospecting area = " + radius * 2 + "x" + radius * 2 + " ONLY blocks below prospector", + "Oil prospecting area 3x3 oilfields, each is 8x8 chunks" }; } protected GT_MetaTileEntity_AdvSeismicProspector(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, String aGUIName, String aNEIName, int aRadius, int aStep) { + ITexture[][][] aTextures, String aGUIName, String aNEIName, int aRadius, int aStep) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); radius = aRadius; step = aStep; @@ -125,14 +125,14 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_AdvSeismicProspector( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName, - this.radius, - this.step); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName, + this.radius, + this.step); } @Override @@ -141,43 +141,43 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba ItemStack aStack = aPlayer.getCurrentEquippedItem(); if (!ready && (GT_Utility.consumeItems(aPlayer, aStack, Item.getItemFromBlock(Blocks.tnt), 16) - || GT_Utility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8) - || GT_Utility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4) - || GT_Utility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2))) { + || GT_Utility.consumeItems(aPlayer, aStack, Ic2Items.industrialTnt.getItem(), 8) + || GT_Utility.consumeItems(aPlayer, aStack, Materials.Glyceryl, 4) + || GT_Utility.consumeItems(aPlayer, aStack, ItemList.Block_Powderbarrel.getItem(), 2))) { this.ready = true; this.mMaxProgresstime = (aPlayer.capabilities.isCreativeMode ? 20 : 800); } else if (ready && mMaxProgresstime == 0 - && aStack != null - && aStack.stackSize == 1 - && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { - this.ready = false; - - // prospecting ores - HashMap<String, Integer> tOres = new HashMap<>(36); - - prospectOres(tOres); - - // prospecting oils - ArrayList<String> tOils = new ArrayList<>(); - prospectOils(tOils); - - GT_Utility.ItemNBT.setAdvancedProspectionData( - mTier, - aStack, - this.getBaseMetaTileEntity() - .getXCoord(), - this.getBaseMetaTileEntity() - .getYCoord(), - this.getBaseMetaTileEntity() - .getZCoord(), - this.getBaseMetaTileEntity() - .getWorld().provider.dimensionId, - tOils, - GT_Utility.sortByValueToList(tOres), - radius); - } + && aStack != null + && aStack.stackSize == 1 + && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { + this.ready = false; + + // prospecting ores + HashMap<String, Integer> tOres = new HashMap<>(36); + + prospectOres(tOres); + + // prospecting oils + ArrayList<String> tOils = new ArrayList<>(); + prospectOils(tOils); + + GT_Utility.ItemNBT.setAdvancedProspectionData( + mTier, + aStack, + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getYCoord(), + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId, + tOils, + GT_Utility.sortByValueToList(tOres), + radius); + } } return true; @@ -202,9 +202,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba for (int i = 0; i < oilfieldSize; i++) { for (int j = 0; j < oilfieldSize; j++) { Chunk tChunk = getBaseMetaTileEntity().getWorld() - .getChunkFromChunkCoords( - xChunk + i + x * oilfieldSize, - zChunk + j + z * oilfieldSize); + .getChunkFromChunkCoords(xChunk + i + x * oilfieldSize, zChunk + j + z * oilfieldSize); FluidStack tFluid = undergroundOilReadInformation(tChunk); if (tFluid != null) { if (tFluid.amount > max) max = tFluid.amount; @@ -217,13 +215,13 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } aOils.add( - ++oilFieldCount + "," - + min - + "-" - + max - + "," - + tFluids.get(cInts) - .getLocalizedName()); + ++oilFieldCount + "," + + min + + "-" + + max + + "," + + tFluids.get(cInts) + .getLocalizedName()); } } } catch (Exception ignored) {} @@ -231,13 +229,11 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba private void prospectOres(Map<String, Integer> aOres) { int tLeftXBound = this.getBaseMetaTileEntity() - .getXCoord() - - radius; + .getXCoord() - radius; int tRightXBound = tLeftXBound + 2 * radius; int tLeftZBound = this.getBaseMetaTileEntity() - .getZCoord() - - radius; + .getZCoord() - radius; int tRightZBound = tLeftZBound + 2 * radius; for (int i = tLeftXBound; i <= tRightXBound; i += step) { @@ -258,7 +254,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba private void prospectHole(int i, int k, Map<String, Integer> aOres) { String tFoundOre; for (int j = this.getBaseMetaTileEntity() - .getYCoord(); j > 0; j--) { + .getYCoord(); j > 0; j--) { tFoundOre = checkForOre(i, j, k); if (tFoundOre != null) countOre(aOres, tFoundOre, cX, cZ); } @@ -266,28 +262,27 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba private String checkForOre(int x, int y, int z) { Block tBlock = this.getBaseMetaTileEntity() - .getBlock(x, y, z); + .getBlock(x, y, z); if (tBlock instanceof GT_Block_Ores_Abstract) { TileEntity tTileEntity = getBaseMetaTileEntity().getWorld() - .getTileEntity(x, y, z); + .getTileEntity(x, y, z); if ((tTileEntity instanceof GT_TileEntity_Ores) && (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000)) { // Filtering // small // ores Materials tMaterial = GregTech_API.sGeneratedMaterials[((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000]; + % 1000]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) return tMaterial.mDefaultLocalName; } } else { int tMetaID = getBaseMetaTileEntity().getWorld() - .getBlockMetadata(x, y, z); + .getBlockMetadata(x, y, z); ItemStack is = new ItemStack(tBlock, 1, tMetaID); ItemData association = GT_OreDictUnificator.getAssociation(is); if ((association != null) && (association.mPrefix.toString() - .startsWith("ore"))) - return association.mMaterial.mMaterial.mDefaultLocalName; + .startsWith("ore"))) return association.mMaterial.mMaterial.mDefaultLocalName; else if (GT_Utility.isOre(tBlock, tMetaID)) return tBlock.getLocalizedName(); } return null; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 1b30282781..02c1897522 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -22,85 +22,85 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Puts things into Boxes", - 2, - 1, - "Packager.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_BOXINATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_BOXINATOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_BOXINATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_BOXINATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_BOXINATOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_BOXINATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_BOXINATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_BOXINATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_BOXINATOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_BOXINATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_BOXINATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_BOXINATOR_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Puts things into Boxes", + 2, + 1, + "Packager.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_BOXINATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_BOXINATOR), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_BOXINATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_BOXINATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_BOXINATOR), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_BOXINATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_BOXINATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_BOXINATOR), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_BOXINATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_BOXINATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_BOXINATOR), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_BOXINATOR_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_Boxinator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boxinator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -110,10 +110,9 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine private boolean hasValidCache(ItemStack mItem, int mType, boolean mClearOnFailure) { if (aInputCache != null && aOutputCache != null - && aTypeCache == mType - && aInputCache.isItemEqual(mItem) - && ItemStack.areItemStackTagsEqual(mItem, aInputCache)) - return true; + && aTypeCache == mType + && aInputCache.isItemEqual(mItem) + && ItemStack.areItemStackTagsEqual(mItem, aInputCache)) return true; // clear cache if it was invalid if (mClearOnFailure) { aInputCache = null; @@ -138,7 +137,7 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine ItemStack tSlot0 = getInputAt(0); ItemStack tSlot1 = getInputAt(1); if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) - && (GT_Utility.getContainerItem(tSlot0, true) == null)) { + && (GT_Utility.getContainerItem(tSlot0, true) == null)) { if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { boolean tIsCached = hasValidCache(tSlot0, 1, true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(tSlot0); @@ -158,7 +157,7 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { boolean tIsCached = hasValidCache(tSlot0, 2, true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() - : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0); + : GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 4; @@ -175,16 +174,8 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { boolean tIsCached = hasValidCache(tSlot0, 3, true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() - : GT_ModHandler.getRecipeOutput( - tSlot0, - tSlot0, - tSlot0, - tSlot0, - tSlot0, - tSlot0, - tSlot0, - tSlot0, - tSlot0); + : GT_ModHandler + .getRecipeOutput(tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0); if (this.mOutputItems[0] != null) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 9; @@ -204,39 +195,31 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { if (!super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) { return false; } ItemStack tInput1 = getInputAt(1); if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) - || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { + || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { if (hasValidCache(aStack, aTypeCache, false)) return true; if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe( - getBaseMetaTileEntity(), - true, - gregtech.api.enums.GT_Values.V[mTier], - null, - GT_Utility.copyAmount(64L, aStack), - tInput1) != null) { + getBaseMetaTileEntity(), + true, + gregtech.api.enums.GT_Values.V[mTier], + null, + GT_Utility.copyAmount(64L, aStack), + tInput1) != null) { return true; } if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(aStack) != null) return true; if (ItemList.Schematic_2by2.isStackEqual(getInputAt(1)) - && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) { + && GT_ModHandler.getRecipeOutput(aStack, aStack, null, aStack, aStack) != null) { return true; } - return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler.getRecipeOutput( - aStack, - aStack, - aStack, - aStack, - aStack, - aStack, - aStack, - aStack, - aStack) != null); + return ItemList.Schematic_3by3.isStackEqual(getInputAt(1)) && (GT_ModHandler + .getRecipeOutput(aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack) != null); } else { return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java index f273197026..de43fd715e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java @@ -14,17 +14,17 @@ import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuffer { public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription, - int aSlotCount) { + int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - int aSlotCount) { + int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); } public GT_MetaTileEntity_Charger(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - int aSlotCount) { + int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); } @@ -62,40 +62,41 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf if (mBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity mMetaTileEntity) { // for (int t = 0; t < 6; t++) { if (mMetaTileEntity.dechargerSlotCount() > 0 - && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), - k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null - && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { + && mBaseMetaTileEntity.getStoredEU() < mBaseMetaTileEntity.getEUCapacity()) { mBaseMetaTileEntity.increaseStoredEnergyUnits( - GT_ModHandler.dischargeElectricItem( - mMetaTileEntity.mInventory[i], - GT_Utility.safeInt( - Math.min( - V[mTier] * 15, - mBaseMetaTileEntity.getEUCapacity() - - mBaseMetaTileEntity.getStoredEU())), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), - true, - false, - false), - true); + GT_ModHandler.dischargeElectricItem( + mMetaTileEntity.mInventory[i], + GT_Utility.safeInt( + Math.min( + V[mTier] * 15, + mBaseMetaTileEntity.getEUCapacity() + - mBaseMetaTileEntity.getStoredEU())), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()), + true, + false, + false), + true); if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; } } } if (mMetaTileEntity.rechargerSlotCount() > 0 && mBaseMetaTileEntity.getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), - k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { + k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { if (mBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { - mBaseMetaTileEntity.decreaseStoredEU( + mBaseMetaTileEntity + .decreaseStoredEU( GT_ModHandler.chargeElectricItem( - mMetaTileEntity.mInventory[i], - GT_Utility.safeInt( - Math.min(V[mTier] * 15, mBaseMetaTileEntity.getStoredEU())), - (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), - true, - false), + mMetaTileEntity.mInventory[i], + GT_Utility + .safeInt(Math.min(V[mTier] * 15, mBaseMetaTileEntity.getStoredEU())), + (int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getOutputTier()), + true, + false), true); if (mMetaTileEntity.mInventory[i].stackSize <= 0) mMetaTileEntity.mInventory[i] = null; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java index fb0bbfb4c2..01832d0d96 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java @@ -21,55 +21,52 @@ public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_CuringOven(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Heats tools for hardening", - 1, - 1, - "E_Oven.png", - "", - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); + aID, + aName, + aNameRegional, + aTier, + 1, + "Heats tools for hardening", + 1, + 1, + "E_Oven.png", + "", + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_SIDE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_FRONT")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_TOP")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/ELECTRIC_OVEN/OVERLAY_BOTTOM"))); } public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_CuringOven(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_CuringOven( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return (super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)) - && ItemList.Cell_Empty.isStackEqual(aStack); + && ItemList.Cell_Empty.isStackEqual(aStack); } @Override @@ -81,34 +78,34 @@ public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { for (ItemStack tStack : mInventory) if (tStack != null && tStack.getItem() instanceof GT_MetaGenerated_Tool - && getBaseMetaTileEntity().getStoredEU() > 0) { - getBaseMetaTileEntity().decreaseStoredEnergyUnits(24, true); - NBTTagCompound aNBT = tStack.getTagCompound(); - if (aNBT != null) { - int tHeat = 300; - long tWorldTime = getBaseMetaTileEntity().getWorld() - .getTotalWorldTime(); - aNBT = aNBT.getCompoundTag("GT.ToolStats"); - if (aNBT != null && aNBT.hasKey("Heat")) { - tHeat = aNBT.getInteger("Heat"); - if (aNBT.hasKey("HeatTime")) { - long tHeatTime = aNBT.getLong("HeatTime"); - if (tWorldTime > (tHeatTime + 10)) { - tHeat = (int) (tHeat - ((tWorldTime - tHeatTime) / 10)); - if (tHeat < 300) tHeat = 300; - } + && getBaseMetaTileEntity().getStoredEU() > 0) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(24, true); + NBTTagCompound aNBT = tStack.getTagCompound(); + if (aNBT != null) { + int tHeat = 300; + long tWorldTime = getBaseMetaTileEntity().getWorld() + .getTotalWorldTime(); + aNBT = aNBT.getCompoundTag("GT.ToolStats"); + if (aNBT != null && aNBT.hasKey("Heat")) { + tHeat = aNBT.getInteger("Heat"); + if (aNBT.hasKey("HeatTime")) { + long tHeatTime = aNBT.getLong("HeatTime"); + if (tWorldTime > (tHeatTime + 10)) { + tHeat = (int) (tHeat - ((tWorldTime - tHeatTime) / 10)); + if (tHeat < 300) tHeat = 300; } } - tHeat++; - if (aNBT != null) { - aNBT.setInteger("Heat", tHeat); - aNBT.setLong("HeatTime", tWorldTime); - } - if (tHeat > GT_MetaGenerated_Tool.getPrimaryMaterial(tStack).mMeltingPoint) { - mInventory[0] = null; - } + } + tHeat++; + if (aNBT != null) { + aNBT.setInteger("Heat", tHeat); + aNBT.setLong("HeatTime", tWorldTime); + } + if (tHeat > GT_MetaGenerated_Tool.getPrimaryMaterial(tStack).mMeltingPoint) { + mInventory[0] = null; } } + } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java index 70b9ecbc22..a0e5561559 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java @@ -76,7 +76,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicMachine - implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener, IAddUIWidgets { + implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener, IAddUIWidgets { public static final int beeCycleLength = 550; public static final int baseEUtUsage = 37; @@ -95,85 +95,85 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM public GT_MetaTileEntity_IndustrialApiary(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 4, - new String[] { "BEES GOES BRRRR", EnumChatFormatting.GRAY + AuthorKuba }, - 6, - 9, - "IndustrialApiary.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 4, + new String[] { "BEES GOES BRRRR", EnumChatFormatting.GRAY + AuthorKuba }, + 6, + 9, + "IndustrialApiary.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_INDUSTRIAL_APIARY), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_INDUSTRIAL_APIARY), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_INDUSTRIAL_APIARY), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_INDUSTRIAL_APIARY_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_INDUSTRIAL_APIARY), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_INDUSTRIAL_APIARY_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); } public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 6, 9, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_IndustrialApiary( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -195,11 +195,11 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM private void openGUI(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { IndustrialApiaryUI.open( - aPlayer, - aBaseMetaTileEntity.getWorld(), - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord()); + aPlayer, + aBaseMetaTileEntity.getWorld(), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()); } @Override @@ -256,13 +256,13 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (isRetrievingPollen && floweringMod > 0f) { final int icycles = (int) cycles - + (getWorld().rand.nextFloat() < (cycles - (float) ((int) cycles)) ? 1 : 0); + + (getWorld().rand.nextFloat() < (cycles - (float) ((int) cycles)) ? 1 : 0); for (int z = 0; z < icycles; z++) { final IIndividual p = bee.retrievePollen(this); if (p != null) { final ItemStack s = p.getGenome() - .getSpeciesRoot() - .getMemberStack(p, EnumGermlingType.POLLEN.ordinal()); + .getSpeciesRoot() + .getMemberStack(p, EnumGermlingType.POLLEN.ordinal()); if (s != null) { final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s); pollen.computeIfAbsent(id, k -> { @@ -290,45 +290,37 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM final HashMap<GT_Utility.ItemId, ItemStack> dropstacks = new HashMap<>(); for (Map.Entry<ItemStack, Float> entry : primary.getProductChances() - .entrySet()) { + .entrySet()) { final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); drops.merge( - id, - Bee.getFinalChance(entry.getValue(), speed, prodMod, 8f) * (float) entry.getKey().stackSize - * cycles, - Float::sum); + id, + Bee.getFinalChance(entry.getValue(), speed, prodMod, 8f) * (float) entry.getKey().stackSize + * cycles, + Float::sum); dropstacks.computeIfAbsent(id, k -> entry.getKey()); } for (Map.Entry<ItemStack, Float> entry : secondary.getProductChances() - .entrySet()) { + .entrySet()) { final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); drops.merge( - id, - Bee.getFinalChance(entry.getValue() / 2f, speed, prodMod, 8f) - * (float) entry.getKey().stackSize - * cycles, - Float::sum); + id, + Bee.getFinalChance(entry.getValue() / 2f, speed, prodMod, 8f) * (float) entry.getKey().stackSize + * cycles, + Float::sum); dropstacks.computeIfAbsent(id, k -> entry.getKey()); } if (primary.isJubilant(genome, this) && secondary.isJubilant(genome, this)) for (Map.Entry<ItemStack, Float> entry : primary.getSpecialtyChances() - .entrySet()) { - final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy( - entry.getKey()); - drops.merge( - id, - Bee.getFinalChance( - entry.getValue(), - speed, - prodMod, - 8f) - * (float) entry.getKey().stackSize - * cycles, - Float::sum); - dropstacks.computeIfAbsent( - id, - k -> entry.getKey()); - } + .entrySet()) { + final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey()); + drops.merge( + id, + Bee.getFinalChance(entry.getValue(), speed, prodMod, 8f) + * (float) entry.getKey().stackSize + * cycles, + Float::sum); + dropstacks.computeIfAbsent(id, k -> entry.getKey()); + } int i = 0; final int imax = mOutputItems.length; @@ -370,11 +362,11 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM for (Map.Entry<GT_Utility.ItemId, Float> entry : drops.entrySet()) { final ItemStack s = dropstacks.get(entry.getKey()) - .copy(); + .copy(); s.stackSize = entry.getValue() - .intValue() - + (getWorld().rand.nextFloat() < (entry.getValue() - (float) entry.getValue() - .intValue()) ? 1 : 0); + .intValue() + + (getWorld().rand.nextFloat() < (entry.getValue() - (float) entry.getValue() + .intValue()) ? 1 : 0); if (s.stackSize > 0 && i < imax) while (true) { if (s.stackSize <= s.getMaxStackSize()) { this.mOutputItems[i++] = s; @@ -426,7 +418,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM this.mOutputItems[0] = new ItemStack(PluginApiculture.items.beeQueenGE); this.mOutputItems[0].setTagCompound(nbttagcompound); beeRoot.getBreedingTracker(getWorld(), getOwner()) - .registerQueen(princess); + .registerQueen(princess); setQueen(null); getDrone().stackSize -= 1; @@ -484,12 +476,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (effect instanceof IAlleleBeeAcceleratableEffect) { effectData[0] = effect.validateStorage(effectData[0]); effectData[0] = ((IAlleleBeeAcceleratableEffect) effect).doEffectAccelerated( - genome, - effectData[0], - this, - usedBeeLife / (effect instanceof AlleleEffectThrottled - ? (float) AlleleBeeEffectThrottledField.getInt(effect) - : 1f)); + genome, + effectData[0], + this, + usedBeeLife / (effect instanceof AlleleEffectThrottled + ? (float) AlleleBeeEffectThrottledField.getInt(effect) + : 1f)); } if (!effect.isCombinable()) return; @@ -500,12 +492,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (secondary instanceof IAlleleBeeAcceleratableEffect) { effectData[1] = secondary.validateStorage(effectData[1]); effectData[1] = ((IAlleleBeeAcceleratableEffect) secondary).doEffectAccelerated( - genome, - effectData[0], - this, - usedBeeLife / (secondary instanceof AlleleEffectThrottled - ? (float) AlleleBeeEffectThrottledField.getInt(secondary) - : 1f)); + genome, + effectData[0], + this, + usedBeeLife / (secondary instanceof AlleleEffectThrottled + ? (float) AlleleBeeEffectThrottledField.getInt(secondary) + : 1f)); } } catch (Exception ex) { ex.printStackTrace(); @@ -542,9 +534,9 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (!aBaseMetaTileEntity.isActive()) { if (aBaseMetaTileEntity.isAllowedToWork() - && (aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 - || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) - && hasEnoughEnergyToCheckRecipe()) { + && (aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) + && hasEnoughEnergyToCheckRecipe()) { final int check = checkRecipe(); if (check == FOUND_AND_SUCCESSFULLY_USED_RECIPE) { aBaseMetaTileEntity.setActive(true); @@ -577,11 +569,10 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (usedQueenBee == null) usedQueenBee = beeRoot.getMember(usedQueen); doEffect(); if (!retrievingPollenInThisOperation && floweringMod > 0f - && this.mProgresstime % pollinationDelay == 0) { + && this.mProgresstime % pollinationDelay == 0) { if (retrievedpollen == null) retrievedpollen = usedQueenBee.retrievePollen(this); if (retrievedpollen != null && (usedQueenBee.pollinateRandom(this, retrievedpollen) - || this.mProgresstime % (pollinationDelay * 5) == 0)) - retrievedpollen = null; + || this.mProgresstime % (pollinationDelay * 5) == 0)) retrievedpollen = null; } } @@ -599,16 +590,15 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (mOutputItems[i] != null) for (int j = 0; j < mOutputItems.length; j++) { if (j == 0 && isAutomated) { if (beeRoot.isMember(mOutputItems[i], EnumBeeType.QUEEN.ordinal()) - || beeRoot.isMember(mOutputItems[i], EnumBeeType.PRINCESS.ordinal())) { + || beeRoot.isMember(mOutputItems[i], EnumBeeType.PRINCESS.ordinal())) { if (aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[i])) break; } else if (beeRoot.isMember(mOutputItems[i], EnumBeeType.DRONE.ordinal())) if (aBaseMetaTileEntity.addStackToSlot(drone, mOutputItems[i])) break; } else if (i == 0 && j == 0 && beeRoot.isMember(mOutputItems[0], EnumBeeType.QUEEN.ordinal())) if (aBaseMetaTileEntity.addStackToSlot(queen, mOutputItems[0])) break; - if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot() + ((j + i) % mOutputItems.length), - mOutputItems[i])) + if (aBaseMetaTileEntity + .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; } Arrays.fill(mOutputItems, null); @@ -619,24 +609,24 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM aBaseMetaTileEntity.setActive(false); if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing) { - final TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide( - aBaseMetaTileEntity.getFrontFacing()); + final TileEntity tTileEntity2 = aBaseMetaTileEntity + .getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); final long tStoredEnergy = aBaseMetaTileEntity.getUniversalEnergyStored(); int tMaxStacks = (int) (tStoredEnergy / 64L); if (tMaxStacks > mOutputItems.length) tMaxStacks = mOutputItems.length; moveMultipleItemStacks( - aBaseMetaTileEntity, - tTileEntity2, - aBaseMetaTileEntity.getFrontFacing(), - aBaseMetaTileEntity.getBackFacing(), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1, - tMaxStacks); + aBaseMetaTileEntity, + tTileEntity2, + aBaseMetaTileEntity.getFrontFacing(), + aBaseMetaTileEntity.getBackFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1, + tMaxStacks); } if (aBaseMetaTileEntity.isAllowedToWork() && checkRecipe() == FOUND_AND_SUCCESSFULLY_USED_RECIPE) @@ -648,11 +638,11 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM public void cancelProcess() { if (this.getBaseMetaTileEntity() - .isActive() - && this.getBaseMetaTileEntity() - .isServerSide() - && usedQueen != null - && beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) { + .isActive() + && this.getBaseMetaTileEntity() + .isServerSide() + && usedQueen != null + && beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) { Arrays.fill(mOutputItems, null); mEUt = 0; mProgresstime = 0; @@ -671,7 +661,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (aStack == null) return false; if (aIndex < getInputSlot()) return true; if (aIndex == queen) return beeRoot.isMember(aStack, EnumBeeType.QUEEN.ordinal()) - || beeRoot.isMember(aStack, EnumBeeType.PRINCESS.ordinal()); + || beeRoot.isMember(aStack, EnumBeeType.PRINCESS.ordinal()); else if (aIndex == drone) return beeRoot.isMember(aStack, EnumBeeType.DRONE.ordinal()); else if (aIndex < getOutputSlot()) { if (!GT_ApiaryUpgrade.isUpgrade(aStack)) return false; @@ -682,12 +672,10 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (GT_Utility.areStacksEqual(getStackInSlot(i), aStack)) return false; if (GT_ApiaryUpgrade.isUpgrade(aStack)) { if (!GT_ApiaryUpgrade.getUpgrade(aStack) - .isAllowedToWorkWith(getStackInSlot(i))) - return false; + .isAllowedToWorkWith(getStackInSlot(i))) return false; } else if (GT_ApiaryUpgrade.isUpgrade(s)) { if (!GT_ApiaryUpgrade.getUpgrade(s) - .isAllowedToWorkWith(aStack)) - return false; + .isAllowedToWorkWith(aStack)) return false; } } return true; @@ -735,19 +723,19 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public int getBlockLightValue() { return this.getBaseMetaTileEntity() - .getLightLevelAtSide((byte) 1); + .getLightLevelAtSide((byte) 1); } @Override public boolean canBlockSeeTheSky() { return this.getBaseMetaTileEntity() - .getSkyAtSide((byte) 1); + .getSkyAtSide((byte) 1); } @Override public World getWorld() { return this.getBaseMetaTileEntity() - .getWorld(); + .getWorld(); } GameProfile owner = null; @@ -755,25 +743,25 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public GameProfile getOwner() { if (owner == null) owner = new GameProfile( - this.getBaseMetaTileEntity() - .getOwnerUuid(), - this.getBaseMetaTileEntity() - .getOwnerName()); + this.getBaseMetaTileEntity() + .getOwnerUuid(), + this.getBaseMetaTileEntity() + .getOwnerName()); return owner; } @Override public Vec3 getBeeFXCoordinates() { return Vec3.createVectorHelper( - getBaseMetaTileEntity().getXCoord() + 0.5, - getBaseMetaTileEntity().getYCoord() + 0.5, - getBaseMetaTileEntity().getZCoord() + 0.5); + getBaseMetaTileEntity().getXCoord() + 0.5, + getBaseMetaTileEntity().getYCoord() + 0.5, + getBaseMetaTileEntity().getZCoord() + 0.5); } @Override public BiomeGenBase getBiome() { if (biomeOverride == null) return this.getBaseMetaTileEntity() - .getBiome(); + .getBiome(); return biomeOverride; } @@ -796,7 +784,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public ChunkCoordinates getCoordinates() { return this.getBaseMetaTileEntity() - .getCoords(); + .getCoords(); } // endregion @@ -878,26 +866,20 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM private boolean checkFlower(IBee bee) { final String flowerType = bee.getGenome() - .getFlowerProvider() - .getFlowerType(); + .getFlowerProvider() + .getFlowerType(); if (!this.flowerType.equals(flowerType)) flowercoords = null; if (flowercoords != null) { if (getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ) != flowerBlock - || getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ) - != flowerBlockMeta) - if (!FlowerManager.flowerRegistry.isAcceptedFlower( - flowerType, - getWorld(), - flowercoords.posX, - flowercoords.posY, - flowercoords.posZ)) + || getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ) + != flowerBlockMeta) + if (!FlowerManager.flowerRegistry + .isAcceptedFlower(flowerType, getWorld(), flowercoords.posX, flowercoords.posY, flowercoords.posZ)) flowercoords = null; else { flowerBlock = getWorld().getBlock(flowercoords.posX, flowercoords.posY, flowercoords.posZ); - flowerBlockMeta = getWorld().getBlockMetadata( - flowercoords.posX, - flowercoords.posY, - flowercoords.posZ); + flowerBlockMeta = getWorld() + .getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ); } } if (flowercoords == null) { @@ -1111,12 +1093,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM }; private static final String POWER_SOURCE_POWER = "GT5U.machines.powersource.power", - CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip", - SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip", - SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip", - INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", - INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip", - UPGRADE_TOOLTIP = "GT5U.machines.industrialapiary.upgradeslot.tooltip"; + CANCEL_PROCESS_TOOLTIP = "GT5U.machines.industrialapiary.cancel.tooltip", + SPEED_TOOLTIP = "GT5U.machines.industrialapiary.speed.tooltip", + SPEED_LOCKED_TOOLTIP = "GT5U.machines.industrialapiary.speedlocked.tooltip", + INFO_TOOLTIP = "GT5U.machines.industrialapiary.info.tooltip", + INFO_WITH_BEE_TOOLTIP = "GT5U.machines.industrialapiary.infoextended.tooltip", + UPGRADE_TOOLTIP = "GT5U.machines.industrialapiary.upgradeslot.tooltip"; @Override public boolean useModularUI() { @@ -1125,150 +1107,126 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( + builder + .widget( new SlotWidget(new ApiarySlot(inventoryHandler, queen)) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_BEE_QUEEN) - .setPos(36, 21)) - .widget( - new SlotWidget(new ApiarySlot(inventoryHandler, drone)).setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_BEE_DRONE) - .setPos(36, 41)) - .widget( - SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(7) - .endAtSlot(10) - .slotCreator(i -> new ApiarySlot(inventoryHandler, i)) - .applyForWidget( - widget -> widget.setGTTooltip(() -> mTooltipCache.getData(UPGRADE_TOOLTIP)) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) - .build() - .setPos(61, 23)); + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_BEE_QUEEN) + .setPos(36, 21)) + .widget( + new SlotWidget(new ApiarySlot(inventoryHandler, drone)) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_BEE_DRONE) + .setPos(36, 41)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 2) + .startFromSlot(7) + .endAtSlot(10) + .slotCreator(i -> new ApiarySlot(inventoryHandler, i)) + .applyForWidget( + widget -> widget.setGTTooltip(() -> mTooltipCache.getData(UPGRADE_TOOLTIP)) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .build() + .setPos(61, 23)); super.addUIWidgets(builder, buildContext); builder.widget( - new ProgressBar().setProgress(() -> (float) getProgresstime() / Math.max(maxProgresstime(), 1)) - .setTexture(GT_UITextures.PROGRESSBAR_ARROW, 20) - .setPos(70, 3) - .setSize(20, 18)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> cancelProcess()) - .setBackground( - GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_CROSS) - .setGTTooltip(() -> mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP)) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(7, 26) - .setSize(18, 18)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_INFORMATION) - .setGTTooltip(() -> { - final String energyreq = GT_Utility.formatNumbers( - (int) ((float) GT_MetaTileEntity_IndustrialApiary.baseEUtUsage - * getEnergyModifier() - * getAcceleration()) + getAdditionalEnergyUsage()); - final String Temp = StatCollector.translateToLocal( - getTemperature().getName()); - final String Hum = StatCollector.translateToLocal( - getHumidity().getName()); - if (getUsedQueen() != null && BeeManager.beeRoot.isMember( - getUsedQueen(), - EnumBeeType.QUEEN.ordinal())) { - final IBee bee = BeeManager.beeRoot.getMember(getUsedQueen()); - if (bee.isAnalyzed()) { - final IBeeGenome genome = bee.getGenome(); - final IBeeModifier mod = BeeManager.beeRoot.getBeekeepingMode( - getWorld()) - .getBeeModifier(); - final float tmod = getTerritoryModifier(null, 1f) - * mod.getTerritoryModifier(null, 1f); - final int[] t = Arrays.stream(genome.getTerritory()) - .map(i -> (int) ((float) i * tmod)) - .toArray(); - return mTooltipCache.getUncachedTooltipData( - INFO_WITH_BEE_TOOLTIP, - energyreq, - Temp, - Hum, - genome.getSpeed(), - getProductionModifier(null, 1f) - * mod.getProductionModifier(null, 1f), - Math.round( - getFloweringModifier(null, 1f) - * genome.getFlowering() - * mod.getFloweringModifier(null, 1f)), - Math.round( - getLifespanModifier(null, null, 1f) - * genome.getLifespan() - * mod.getLifespanModifier( - null, - null, - 1f)), - t[0], - t[1], - t[2]); - } - } - return mTooltipCache.getUncachedTooltipData( - INFO_TOOLTIP, - energyreq, - Temp, - Hum); - }) - .attachSyncer( - new FakeSyncWidget.ItemStackSyncer( - () -> usedQueen, - val -> usedQueen = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .setPos(163, 5) - .setSize(7, 18)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - if (mLockedSpeed) return; - if (!clickData.shift) { - mSpeed++; - if (mSpeed > getMaxSpeed()) mSpeed = 0; - } else { - mSpeed--; - if (mSpeed < 0) mSpeed = getMaxSpeed(); - } - } else if (clickData.mouseButton == 1) { - mLockedSpeed = !mLockedSpeed; - if (mLockedSpeed) mSpeed = getMaxSpeed(); - } - }) - .setGTTooltip( - () -> mTooltipCache.getUncachedTooltipData( - mLockedSpeed ? SPEED_LOCKED_TOOLTIP : SPEED_TOOLTIP, - getAcceleration(), - GT_Utility.formatNumbers(getAdditionalEnergyUsage()))) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> mSpeed, val -> mSpeed = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .attachSyncer( - new FakeSyncWidget.BooleanSyncer( - () -> mLockedSpeed, - val -> mLockedSpeed = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GT_UITextures.PICTURE_SQUARE_LIGHT_GRAY) - .setPos(25, 62) - .setSize(18, 18)) - .widget( - new TextWidget("x").setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(30, 63)) - .widget( - TextWidget.dynamicString(() -> String.valueOf(1 << mSpeed)) - // mSpeed is already synced - .setSynced(false) - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(26, 72)); + new ProgressBar().setProgress(() -> (float) getProgresstime() / Math.max(maxProgresstime(), 1)) + .setTexture(GT_UITextures.PROGRESSBAR_ARROW, 20) + .setPos(70, 3) + .setSize(20, 18)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> cancelProcess()) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_CROSS) + .setGTTooltip(() -> mTooltipCache.getData(CANCEL_PROCESS_TOOLTIP)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(7, 26) + .setSize(18, 18)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_INFORMATION) + .setGTTooltip(() -> { + final String energyreq = GT_Utility.formatNumbers( + (int) ((float) GT_MetaTileEntity_IndustrialApiary.baseEUtUsage * getEnergyModifier() + * getAcceleration()) + getAdditionalEnergyUsage()); + final String Temp = StatCollector.translateToLocal(getTemperature().getName()); + final String Hum = StatCollector.translateToLocal(getHumidity().getName()); + if (getUsedQueen() != null + && BeeManager.beeRoot.isMember(getUsedQueen(), EnumBeeType.QUEEN.ordinal())) { + final IBee bee = BeeManager.beeRoot.getMember(getUsedQueen()); + if (bee.isAnalyzed()) { + final IBeeGenome genome = bee.getGenome(); + final IBeeModifier mod = BeeManager.beeRoot.getBeekeepingMode(getWorld()) + .getBeeModifier(); + final float tmod = getTerritoryModifier(null, 1f) * mod.getTerritoryModifier(null, 1f); + final int[] t = Arrays.stream(genome.getTerritory()) + .map(i -> (int) ((float) i * tmod)) + .toArray(); + return mTooltipCache.getUncachedTooltipData( + INFO_WITH_BEE_TOOLTIP, + energyreq, + Temp, + Hum, + genome.getSpeed(), + getProductionModifier(null, 1f) * mod.getProductionModifier(null, 1f), + Math.round( + getFloweringModifier(null, 1f) * genome.getFlowering() + * mod.getFloweringModifier(null, 1f)), + Math.round( + getLifespanModifier(null, null, 1f) * genome.getLifespan() + * mod.getLifespanModifier(null, null, 1f)), + t[0], + t[1], + t[2]); + } + } + return mTooltipCache.getUncachedTooltipData(INFO_TOOLTIP, energyreq, Temp, Hum); + }) + .attachSyncer( + new FakeSyncWidget.ItemStackSyncer(() -> usedQueen, val -> usedQueen = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .setPos(163, 5) + .setSize(7, 18)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (clickData.mouseButton == 0) { + if (mLockedSpeed) return; + if (!clickData.shift) { + mSpeed++; + if (mSpeed > getMaxSpeed()) mSpeed = 0; + } else { + mSpeed--; + if (mSpeed < 0) mSpeed = getMaxSpeed(); + } + } else if (clickData.mouseButton == 1) { + mLockedSpeed = !mLockedSpeed; + if (mLockedSpeed) mSpeed = getMaxSpeed(); + } + }) + .setGTTooltip( + () -> mTooltipCache.getUncachedTooltipData( + mLockedSpeed ? SPEED_LOCKED_TOOLTIP : SPEED_TOOLTIP, + getAcceleration(), + GT_Utility.formatNumbers(getAdditionalEnergyUsage()))) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer(() -> mSpeed, val -> mSpeed = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .attachSyncer( + new FakeSyncWidget.BooleanSyncer(() -> mLockedSpeed, val -> mLockedSpeed = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GT_UITextures.PICTURE_SQUARE_LIGHT_GRAY) + .setPos(25, 62) + .setSize(18, 18)) + .widget( + new TextWidget("x").setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(30, 63)) + .widget( + TextWidget.dynamicString(() -> String.valueOf(1 << mSpeed)) + // mSpeed is already synced + .setSynced(false) + .setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(26, 72)); } @Override @@ -1295,37 +1253,26 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM @Override protected DrawableWidget createErrorStatusArea(ModularWindow.Builder builder, IDrawable picture) { return (DrawableWidget) super.createErrorStatusArea(builder, picture).setPos(100, 62) - .attachSyncer( - new FakeSyncWidget.ListSyncer<>( - () -> Arrays.asList( - mErrorStates.toArray( - new IErrorState[0])), - val -> { - mErrorStates.clear(); - mErrorStates.addAll( - new HashSet<>( - val)); - }, - (buffer, val) -> buffer.writeShort( - val.getID()), - buffer -> ForestryAPI.errorStateRegistry.getErrorState( - buffer.readShort())), - builder, - (widget, val) -> widget.notifyTooltipChange()); + .attachSyncer( + new FakeSyncWidget.ListSyncer<>(() -> Arrays.asList(mErrorStates.toArray(new IErrorState[0])), val -> { + mErrorStates.clear(); + mErrorStates.addAll(new HashSet<>(val)); + }, + (buffer, val) -> buffer.writeShort(val.getID()), + buffer -> ForestryAPI.errorStateRegistry.getErrorState(buffer.readShort())), + builder, + (widget, val) -> widget.notifyTooltipChange()); } @Override protected List<String> getErrorDescriptions() { if (!mErrorStates.isEmpty()) { return mErrorStates.stream() - .map( - state -> EnumChatFormatting.RED - + StatCollector.translateToLocal("for." + state.getDescription())) - .collect(Collectors.toList()); + .map(state -> EnumChatFormatting.RED + StatCollector.translateToLocal("for." + state.getDescription())) + .collect(Collectors.toList()); } else if (mStuttering) { - return mTooltipCache.getData( - STALLED_STUTTERING_TOOLTIP, - StatCollector.translateToLocal(POWER_SOURCE_POWER)).text; + return mTooltipCache + .getData(STALLED_STUTTERING_TOOLTIP, StatCollector.translateToLocal(POWER_SOURCE_POWER)).text; } else { return Collections.emptyList(); } @@ -1368,8 +1315,8 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM } } - private static final UIInfo<?, ?> IndustrialApiaryUI = GT_UIInfos.GTTileEntityUIFactory.apply( - GT_ModularUIContainer_IndustrialApiary::new); + private static final UIInfo<?, ?> IndustrialApiaryUI = GT_UIInfos.GTTileEntityUIFactory + .apply(GT_ModularUIContainer_IndustrialApiary::new); private static class GT_ModularUIContainer_IndustrialApiary extends ModularUIContainer { @@ -1395,7 +1342,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); if (!GT_ApiaryUpgrade.isUpgrade(s)) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer); int max = GT_ApiaryUpgrade.getUpgrade(s) - .getMaxNumber(); + .getMaxNumber(); if (slotStack != null) max = Math.max(0, max - slotStack.stackSize); max = Math.min(max, s.stackSize); if (max == 0) return null; @@ -1424,7 +1371,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM if (!GT_Utility.areStacksEqual(aStack, iStack)) continue; } int max = GT_ApiaryUpgrade.getUpgrade(aStack) - .getMaxNumber(); + .getMaxNumber(); if (iStack == null) { max = Math.min(max, aStack.stackSize); final ItemStack newstack = aStack.splitStack(max); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index 2c1e46ea9e..fd9062cbd4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -32,75 +32,75 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac public GT_MetaTileEntity_Massfabricator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "UUM = Matter * Fabrication Squared", - 1, - 1, - "Massfabricator.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_MASSFAB_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_MASSFAB), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_MASSFAB_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_MASSFAB_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_MASSFAB), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_MASSFAB_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_MASSFAB_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_MASSFAB_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_MASSFAB), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_MASSFAB_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_MASSFAB_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_MASSFAB), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_MASSFAB_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "UUM = Matter * Fabrication Squared", + 1, + 1, + "Massfabricator.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_MASSFAB_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_MASSFAB), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_MASSFAB_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_MASSFAB_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_MASSFAB), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MASSFAB_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_MASSFAB_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_MASSFAB), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_MASSFAB_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_MASSFAB_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_MASSFAB_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_MASSFAB), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_MASSFAB_GLOW) + .glow() + .build())); EUt = V[1] * (long) Math.pow(2, mTier + 2); } public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); EUt = V[1] * (long) Math.pow(2, mTier + 2); } public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); EUt = V[1] * (long) Math.pow(2, mTier + 2); } @@ -108,12 +108,12 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Massfabricator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -129,10 +129,8 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac @Override public void onConfigLoad(GT_Config aConfig) { super.onConfigLoad(aConfig); - sDurationMultiplier = aConfig.get( - ConfigCategories.machineconfig, - "Massfabricator.UUM_Duration_Multiplier", - sDurationMultiplier); + sDurationMultiplier = aConfig + .get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); @@ -155,8 +153,8 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac if ((tFluid == null) || (tFluid.amount < getCapacity())) { this.mOutputFluid = Materials.UUMatter.getFluid(1L); calculateOverclockedNess( - (int) EUt, - containsUUA(getFillableStack()) ? sDurationMultiplier / sUUASpeedBonus : sDurationMultiplier); + (int) EUt, + containsUUA(getFillableStack()) ? sDurationMultiplier / sUUASpeedBonus : sDurationMultiplier); // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -165,9 +163,9 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } return sRequiresUUA || Arrays.stream(getAllInputs()) - .anyMatch(s -> ItemList.Circuit_Integrated.isStackEqual(s, true, true)) - ? FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS - : FOUND_AND_SUCCESSFULLY_USED_RECIPE; + .anyMatch(s -> ItemList.Circuit_Integrated.isStackEqual(s, true, true)) + ? FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS + : FOUND_AND_SUCCESSFULLY_USED_RECIPE; } return DID_NOT_FIND_RECIPE; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java index b72c456683..3db90597f6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java @@ -44,7 +44,7 @@ import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank - implements IAddGregtechLogo, IAddUIWidgets { + implements IAddGregtechLogo, IAddUIWidgets { private static boolean sInterDimensionalTeleportAllowed = true; private static int mMaxLoss = 50; @@ -64,22 +64,22 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt public GT_MetaTileEntity_MicrowaveEnergyTransmitter(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - new String[] { "Transmits Energy Wirelessly", "Use Nitrogen Plasma", - "for Inter-dimensional transmission", "0.004EU Loss per 100 Blocks" }); + aID, + aName, + aNameRegional, + aTier, + 3, + new String[] { "Transmits Energy Wirelessly", "Use Nitrogen Plasma", "for Inter-dimensional transmission", + "0.004EU Loss per 100 Blocks" }); } public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -94,41 +94,41 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MicrowaveEnergyTransmitter( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override public String[] getInfoData() { return new String[] { "Coordinates:", - "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, - "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, - "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, - "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, - "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) - ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), - "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) - ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; + "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, + "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, + "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, + "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), + "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == 0) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1] }; if (aActive) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_GLOW) + .glow() + .build() }; } @Override @@ -153,10 +153,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig.get( - ConfigCategories.machineconfig, - "Teleporter.Interdimensional", - true); + sInterDimensionalTeleportAllowed = aConfig + .get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); mMaxLoss = Math.max(aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLoss", 50), 11); mMaxLossDistance = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.MaxLossDistance", 10000); mPassiveEnergyUse = aConfig.get(ConfigCategories.machineconfig, "MicrowaveTransmitter.PassiveEnergy", true); @@ -180,7 +178,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt for (byte j = -5; j <= 5; j = (byte) (j + 1)) { for (byte k = -5; k <= 5; k = (byte) (k + 1)) { if (getBaseMetaTileEntity().getBlockOffset(i, j, k) == GregTech_API.sBlockMetal5 - && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 8) { // require osmiridium block + && getBaseMetaTileEntity().getMetaIDOffset(i, j, k) == 8) { // require osmiridium block return true; } } @@ -191,12 +189,12 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt public boolean hasDimensionalTeleportCapability() { return this.mDebug || (sInterDimensionalTeleportAllowed && (this.hasBlock - || mFluid != null && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000)); + || mFluid != null && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000)); } public boolean isDimensionalTeleportAvailable() { return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD) - && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); + && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); } @Override @@ -215,8 +213,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt getBaseMetaTileEntity().decreaseStoredEnergyUnits(2L << (mTier - 1), false); } if (hasDimensionalTeleportCapability() - && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId - && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) { + && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId + && mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1))) { mFluid.amount--; if (mFluid.amount < 1) { mFluid = null; @@ -248,8 +246,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt } long energyUse = 10; if (mMaxLossDistance != 0) { - energyUse = GT_Utility.safeInt( - 10L + (tDistance * Math.max(mMaxLoss - 10L, 0) / mMaxLossDistance)); + energyUse = GT_Utility + .safeInt(10L + (tDistance * Math.max(mMaxLoss - 10L, 0) / mMaxLossDistance)); } energyUse = packetSize + ((V[mTier] * energyUse) / 100); if (getBaseMetaTileEntity().isUniversalEnergyStored(energyUse)) { @@ -269,12 +267,12 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt private int distanceCalculation() { return Math.abs( - ((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) - && (isDimensionalTeleportAvailable()) ? 100 : 1) - * (int) Math.sqrt( - Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) - + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) - + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); + ((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) + && (isDimensionalTeleportAvailable()) ? 100 : 1) + * (int) Math.sqrt( + Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))); } @Override @@ -415,32 +413,31 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setSize(90, 72) - .setPos(43, 4)) - .widget( - TextWidget.dynamicString(() -> "X: " + GT_Utility.parseNumberToString(mTargetX)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 8)) - .widget( - TextWidget.dynamicString(() -> "Y: " + GT_Utility.parseNumberToString(mTargetY)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 16)) - .widget( - TextWidget.dynamicString(() -> "Z: " + GT_Utility.parseNumberToString(mTargetZ)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 24)) - .widget( - TextWidget.dynamicString(() -> "Dim: " + GT_Utility.parseNumberToString(mTargetD)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 32)) - .widget( - TextWidget.dynamicString( - () -> "Dim Valid: " + (GT_Utility.isRealDimension(mTargetD) ? "Yes" : "No")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> hasDimensionalTeleportCapability()) - .setPos(46, 40)) - .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget( + TextWidget.dynamicString(() -> "X: " + GT_Utility.parseNumberToString(mTargetX)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget( + TextWidget.dynamicString(() -> "Y: " + GT_Utility.parseNumberToString(mTargetY)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)) + .widget( + TextWidget.dynamicString(() -> "Z: " + GT_Utility.parseNumberToString(mTargetZ)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 24)) + .widget( + TextWidget.dynamicString(() -> "Dim: " + GT_Utility.parseNumberToString(mTargetD)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 32)) + .widget( + TextWidget.dynamicString(() -> "Dim Valid: " + (GT_Utility.isRealDimension(mTargetD) ? "Yes" : "No")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> hasDimensionalTeleportCapability()) + .setPos(46, 40)) + .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, -16, -1, 25); @@ -448,40 +445,40 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, 512, 64, 151); addChangeNumberButton( - builder, - GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, - val -> mTargetD += val, - -16, - -8, - 7, - 58); + builder, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + val -> mTargetD += val, + -16, + -8, + 7, + 58); addChangeNumberButton( - builder, - GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, - val -> mTargetD += val, - -4, - -1, - 25, - 58); + builder, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + val -> mTargetD += val, + -4, + -1, + 25, + 58); addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> mTargetD += val, 4, 1, 133, 58); addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> mTargetD += val, 16, 8, 151, 58); } private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift, - int addNumber, int xPos) { + int addNumber, int xPos) { addChangeNumberButton(builder, overlay, val -> mTargetX += val, addNumberShift, addNumber, xPos, 4); addChangeNumberButton(builder, overlay, val -> mTargetY += val, addNumberShift, addNumber, xPos, 22); addChangeNumberButton(builder, overlay, val -> mTargetZ += val, addNumberShift, addNumber, xPos, 40); } private void addChangeNumberButton(ModularWindow.Builder builder, IDrawable overlay, Consumer<Integer> setter, - int addNumberShift, int addNumber, int xPos, int yPos) { + int addNumberShift, int addNumber, int xPos, int yPos) { builder.widget( - new ButtonWidget().setOnClick( - (clickData, widget) -> setter.accept(clickData.shift ? addNumberShift : addNumber)) - .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) - .setSize(18, 18) - .setPos(xPos, yPos)); + new ButtonWidget() + .setOnClick((clickData, widget) -> setter.accept(clickData.shift ? addNumberShift : addNumber)) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); } @Override @@ -492,8 +489,8 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(113, 56)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(113, 56)); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index 8d605599e7..8186d716df 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -42,7 +42,7 @@ import gregtech.common.misc.GT_IDrillingLogicDelegateOwner; @SuppressWarnings("ObjectEquality") public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine - implements GT_IDrillingLogicDelegateOwner, IAddUIWidgets { + implements GT_IDrillingLogicDelegateOwner, IAddUIWidgets { static final int[] RADIUS = { 8, 8, 16, 24, 32 }; // Miner radius per tier static final int[] SPEED = { 160, 160, 80, 40, 20 }; // Miner cycle time per tier @@ -60,100 +60,81 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_Miner(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - new String[] { "Digging ore instead of you", "Use Screwdriver to regulate work area", - "Use Soft Mallet to disable and retract the pipe", - String.format("%d EU/t, %d sec per block, no stuttering", ENERGY[aTier], SPEED[aTier] / 20), - String.format("Maximum work area %dx%d", (RADIUS[aTier] * 2 + 1), (RADIUS[aTier] * 2 + 1)), - String.format("Fortune bonus of %d", aTier) }, - 2, - 2, - "Miner.png", - "", - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_SIDE_ACTIVE_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_SIDE_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_FRONT_ACTIVE_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_FRONT_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_TOP_ACTIVE_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_TOP_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of( - new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_BOTTOM_ACTIVE_GLOW")) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM")), - TextureFactory.builder() - .addIcon( - new Textures.BlockIcons.CustomIcon( - "basicmachines/miner/OVERLAY_BOTTOM_GLOW")) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + new String[] { "Digging ore instead of you", "Use Screwdriver to regulate work area", + "Use Soft Mallet to disable and retract the pipe", + String.format("%d EU/t, %d sec per block, no stuttering", ENERGY[aTier], SPEED[aTier] / 20), + String.format("Maximum work area %dx%d", (RADIUS[aTier] * 2 + 1), (RADIUS[aTier] * 2 + 1)), + String.format("Fortune bonus of %d", aTier) }, + 2, + 2, + "Miner.png", + "", + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_SIDE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_FRONT_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_TOP_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/miner/OVERLAY_BOTTOM_GLOW")) + .glow() + .build())); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; } public GT_MetaTileEntity_Miner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; } public GT_MetaTileEntity_Miner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); mSpeed = SPEED[aTier]; radiusConfig = RADIUS[mTier]; @@ -172,9 +153,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) // - && aStack.getItem() == GT_DrillingLogicDelegate.MINING_PIPE_STACK.getItem(); + && aStack.getItem() == GT_DrillingLogicDelegate.MINING_PIPE_STACK.getItem(); } /** Both output slots must be free to work */ @@ -208,12 +189,12 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine } GT_Utility.sendChatToPlayer( - aPlayer, - String.format( - "%s %dx%d", - StatCollector.translateToLocal("GT5U.machines.workareaset"), - (radiusConfig * 2 + 1), - (radiusConfig * 2 + 1))); + aPlayer, + String.format( + "%s %dx%d", + StatCollector.translateToLocal("GT5U.machines.workareaset"), + (radiusConfig * 2 + 1), + (radiusConfig * 2 + 1))); // Rebuild ore cache after change config fillOreList(getBaseMetaTileEntity()); @@ -251,9 +232,9 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine mMaxProgresstime = 0; if (debugBlockMiner) { GT_Log.out.println( - "MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed) - + " have " - + aBaseMetaTileEntity.getUniversalEnergyStored()); + "MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed) + + " have " + + aBaseMetaTileEntity.getUniversalEnergyStored()); } return; } @@ -283,17 +264,15 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine boolean isOre; do { ChunkPosition oreBlockPos = oreBlockPositions.remove(0); - oreBlock = aBaseMetaTileEntity.getBlockOffset( - oreBlockPos.chunkPosX, - oreBlockPos.chunkPosY, - oreBlockPos.chunkPosZ); + oreBlock = aBaseMetaTileEntity + .getBlockOffset(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); x = aBaseMetaTileEntity.getXCoord() + oreBlockPos.chunkPosX; y = aBaseMetaTileEntity.getYCoord() + oreBlockPos.chunkPosY; z = aBaseMetaTileEntity.getZCoord() + oreBlockPos.chunkPosZ; isOre = GT_Utility.isOre( - oreBlock, - aBaseMetaTileEntity.getWorld() - .getBlockMetadata(x, y, z)); + oreBlock, + aBaseMetaTileEntity.getWorld() + .getBlockMetadata(x, y, z)); } // someone else might have removed the block while (!isOre && !oreBlockPositions.isEmpty()); @@ -351,7 +330,7 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine @Override public boolean pushOutputs(ItemStack stack, int count, boolean simulate, boolean allowInputSlots) { return allowInputSlots && pushOutput(getInputSlot(), getInputSlot() + mInputSlotCount, stack, count, simulate) - || pushOutput(getOutputSlot(), getOutputSlot() + mOutputItems.length, stack, count, simulate); + || pushOutput(getOutputSlot(), getOutputSlot() + mOutputItems.length, stack, count, simulate); } private boolean pushOutput(int startIndex, int endIndex, ItemStack stack, int count, boolean simulate) { @@ -405,18 +384,18 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine @Override public String[] getInfoData() { return new String[] { - String.format( - "%s%s%s", - EnumChatFormatting.BLUE, - StatCollector.translateToLocal("GT5U.machines.miner"), - EnumChatFormatting.RESET), - String.format( - "%s: %s%d%s %s", - StatCollector.translateToLocal("GT5U.machines.workarea"), - EnumChatFormatting.GREEN, - (radiusConfig * 2 + 1), - EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.blocks")) }; + String.format( + "%s%s%s", + EnumChatFormatting.BLUE, + StatCollector.translateToLocal("GT5U.machines.miner"), + EnumChatFormatting.RESET), + String.format( + "%s: %s%d%s %s", + StatCollector.translateToLocal("GT5U.machines.workarea"), + EnumChatFormatting.GREEN, + (radiusConfig * 2 + 1), + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.blocks")) }; } @Override @@ -461,18 +440,18 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine } private static final FallbackableUITexture progressBarTexture = new FallbackableUITexture( - UITexture.fullImage(GregTech.ID, "gui/progressbar/miner"), - GT_UITextures.PROGRESSBAR_CANNER); + UITexture.fullImage(GregTech.ID, "gui/progressbar/miner"), + GT_UITextures.PROGRESSBAR_CANNER); @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); builder.widget( - createProgressBar( - progressBarTexture.get(), - 20, - ProgressBar.Direction.RIGHT, - new Pos2d(78, 24), - new Size(20, 18))); + createProgressBar( + progressBarTexture.get(), + 20, + ProgressBar.Direction.RIGHT, + new Pos2d(78, 24), + new Size(20, 18))); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java index 7a786228e4..7306e89986 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java @@ -26,65 +26,65 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered public GT_MetaTileEntity_MonsterRepellent(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 0, - "Repels nasty Creatures. Range: " + (4 + (12 * aTier)) - + " unpowered / " - + (16 + (48 * aTier)) - + " powered. Costs " - + (1L << (aTier * 2)) - + " EU/t"); + aID, + aName, + aNameRegional, + aTier, + 0, + "Repels nasty Creatures. Range: " + (4 + (12 * aTier)) + + " unpowered / " + + (16 + (48 * aTier)) + + " powered. Costs " + + (1L << (aTier * 2)) + + " EU/t"); } public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_MonsterRepellent( - this.mName, - this.mTier, - this.mInventory.length, - this.mDescriptionArray, - this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescriptionArray, + this.mTextures); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1] }; if (aActive) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_GLOW) + .glow() + .build() }; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide()) { int[] tCoords = { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId }; + aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId }; if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) { GT_SpawnEventHandler.mobReps.add(tCoords); } if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) - && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { + && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { mRange = GT_SpawnEventHandler.getPoweredRepellentRange(mTier); } else { mRange = GT_SpawnEventHandler.getUnpoweredRepellentRange(mTier); @@ -95,20 +95,20 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { int[] tCoords = { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId }; + aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId }; GT_SpawnEventHandler.mobReps.add(tCoords); } @Override public void onRemoval() { int[] tCoords = { this.getBaseMetaTileEntity() - .getXCoord(), - this.getBaseMetaTileEntity() - .getYCoord(), - this.getBaseMetaTileEntity() - .getZCoord(), - this.getBaseMetaTileEntity() - .getWorld().provider.dimensionId }; + .getXCoord(), + this.getBaseMetaTileEntity() + .getYCoord(), + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId }; GT_SpawnEventHandler.mobReps.removeIf(coords -> Arrays.equals(coords, tCoords)); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java index bae01940f9..ad73047507 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -22,85 +22,85 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Brewing your Drinks", - 1, - 0, - "PotionBrewer.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_POTIONBREWER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_POTIONBREWER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_POTIONBREWER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_POTIONBREWER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_POTIONBREWER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_POTIONBREWER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_POTIONBREWER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_POTIONBREWER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_POTIONBREWER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_POTIONBREWER_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Brewing your Drinks", + 1, + 0, + "PotionBrewer.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_POTIONBREWER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_POTIONBREWER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_POTIONBREWER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_POTIONBREWER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_POTIONBREWER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_POTIONBREWER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_POTIONBREWER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_POTIONBREWER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_POTIONBREWER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_POTIONBREWER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_POTIONBREWER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_POTIONBREWER_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); } public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 0, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_PotionBrewer( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -123,7 +123,7 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi FluidStack aFluid = getFillableStack(); if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null)) { String tInputName = aFluid.getFluid() - .getName(); + .getName(); if (tInputName.startsWith("potion.")) { tInputName = tInputName.replaceFirst("potion.", ""); int tFirstDot = tInputName.indexOf('.') + 1; @@ -159,11 +159,11 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi return setOutput("potion.weakness"); } if (GT_Utility.areStacksEqual( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), - getInputAt(0))) { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), + getInputAt(0))) { if (!tModifier.startsWith("strong")) { return setOutput( - "potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : "." + tModifier)); + "potion." + tInputName + ".strong" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("long")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("long", "")); @@ -171,11 +171,11 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi return setOutput("potion.thick"); } if (GT_Utility.areStacksEqual( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), - getInputAt(0))) { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L), + getInputAt(0))) { if (!tModifier.startsWith("long")) { return setOutput( - "potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : "." + tModifier)); + "potion." + tInputName + ".long" + (tModifier.isEmpty() ? "" : "." + tModifier)); } if (tModifier.startsWith("strong")) { return setOutput("potion." + tInputName + tModifier.replaceFirst("strong", "")); @@ -183,8 +183,8 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi return setOutput("potion.mundane"); } if (GT_Utility.areStacksEqual( - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), - getInputAt(0))) { + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Gunpowder, 1L), + getInputAt(0))) { if (!tInputName.endsWith(".splash")) { return setOutput("potion." + tInputName + ".splash"); } @@ -212,17 +212,16 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi @Override public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && getRecipeList().containsInput(aStack); + && getRecipeList().containsInput(aStack); } @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return (aFluid.getFluid() - .getName() - .startsWith("potion.")) - || (super.isFluidInputAllowed(aFluid)); + .getName() + .startsWith("potion.")) || (super.isFluidInputAllowed(aFluid)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java index 444121cc79..b0ffcaedcc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java @@ -17,20 +17,20 @@ public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "It can copy Books and paint Stuff", - 1, - 1, - "Printer.png", - GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); + aID, + aName, + aNameRegional, + aTier, + 1, + "It can copy Books and paint Stuff", + 1, + 1, + "Printer.png", + GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName); } public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName); } @@ -39,26 +39,26 @@ public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine { if (getOutputAt(0) != null) { this.mOutputBlocked += 1; } else if ((GT_Utility.isStackValid(getInputAt(0))) && (getInputAt(0).stackSize > 0) - && (GT_Utility.isStackInvalid(getSpecialSlot())) - && (OrePrefixes.block.contains(getInputAt(0)))) { - ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres( - GT_OreDictUnificator.getAssociation(getInputAt(0))); - if (tList.size() > 1) { - tList.add(tList.get(0)); - int i = 0; - for (int j = tList.size() - 1; i < j; i++) { - if (GT_Utility.areStacksEqual(getInputAt(0), tList.get(i))) { - this.mOutputItems[0] = GT_Utility.copyAmount(1L, tList.get(i + 1)); - calculateOverclockedNess(1, 32); - // In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - getInputAt(0).stackSize -= 1; - return 2; - } + && (GT_Utility.isStackInvalid(getSpecialSlot())) + && (OrePrefixes.block.contains(getInputAt(0)))) { + ArrayList<ItemStack> tList = GT_OreDictUnificator + .getOres(GT_OreDictUnificator.getAssociation(getInputAt(0))); + if (tList.size() > 1) { + tList.add(tList.get(0)); + int i = 0; + for (int j = tList.size() - 1; i < j; i++) { + if (GT_Utility.areStacksEqual(getInputAt(0), tList.get(i))) { + this.mOutputItems[0] = GT_Utility.copyAmount(1L, tList.get(i + 1)); + calculateOverclockedNess(1, 32); + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + getInputAt(0).stackSize -= 1; + return 2; } } } + } this.mMaxProgresstime = 0; return 0; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index db9aedb9eb..db0a889205 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -39,8 +39,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { private static final ItemStack MINING_PIPE = GT_ModHandler.getIC2Item("miningPipe", 0); private static final Block MINING_PIPE_BLOCK = GT_Utility.getBlockFromStack(MINING_PIPE); - private static final Block MINING_PIPE_TIP_BLOCK = GT_Utility.getBlockFromStack( - GT_ModHandler.getIC2Item("miningPipeTip", 0)); + private static final Block MINING_PIPE_TIP_BLOCK = GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 0)); public static int getMaxDistanceForTier(int aTier) { return (10 * ((int) Math.pow(1.6D, aTier))); @@ -64,21 +64,21 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Pump(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - new String[] { "The best way to empty Oceans! Outputs on top", - getEuUsagePerTier(aTier) + " EU/operation, " - + GT_Utility.safeInt(160 / 20 / (long) Math.pow(2, aTier)) - + " sec per bucket, no stuttering", - "Maximum pumping area: " + (getMaxDistanceForTier(aTier) * 2 + 1) - + "x" - + (getMaxDistanceForTier(aTier) * 2 + 1), - "Use Screwdriver to regulate pumping area", "Use Soft Mallet to disable and retract the pipe", - "Disable the bottom pump to retract the pipe!", - "Use Soldering Iron to auto retract the pipe when hitting a rock", }); + aID, + aName, + aNameRegional, + aTier, + 3, + new String[] { "The best way to empty Oceans! Outputs on top", + getEuUsagePerTier(aTier) + " EU/operation, " + + GT_Utility.safeInt(160 / 20 / (long) Math.pow(2, aTier)) + + " sec per bucket, no stuttering", + "Maximum pumping area: " + (getMaxDistanceForTier(aTier) * 2 + 1) + + "x" + + (getMaxDistanceForTier(aTier) * 2 + 1), + "Use Screwdriver to regulate pumping area", "Use Soft Mallet to disable and retract the pipe", + "Disable the bottom pump to retract the pipe!", + "Use Soldering Iron to auto retract the pipe when hitting a rock", }); radiusConfig = getMaxDistanceForTier(mTier); } @@ -102,21 +102,20 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { boolean wasPumping = this.wasPumping || !this.mPumpList.isEmpty(); if (debugBlockPump) { GT_Log.out.println( - "PUMP: NBT:Save - WasPumping - " + wasPumping - + " blocks (" - + this.mPrimaryPumpedBlock - + ", " - + this.mSecondaryPumpedBlock - + ")"); + "PUMP: NBT:Save - WasPumping - " + wasPumping + + " blocks (" + + this.mPrimaryPumpedBlock + + ", " + + this.mSecondaryPumpedBlock + + ")"); } super.saveNBTData(aNBT); aNBT.setString( - "mPumpedBlock1", - this.mPrimaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mPrimaryPumpedBlock)); + "mPumpedBlock1", + this.mPrimaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mPrimaryPumpedBlock)); aNBT.setString( - "mPumpedBlock2", - this.mSecondaryPumpedBlock == null ? "" - : Block.blockRegistry.getNameForObject(this.mSecondaryPumpedBlock)); + "mPumpedBlock2", + this.mSecondaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mSecondaryPumpedBlock)); aNBT.setBoolean("wasPumping", wasPumping); aNBT.setInteger("radiusConfig", radiusConfig); aNBT.setBoolean("mRetractDone", mRetractDone); @@ -135,11 +134,11 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (debugBlockPump) { GT_Log.out.println( - "PUMP: NBT:Load - WasPumping - " + this.wasPumping - + "(" - + aNBT.getString("mPumpedBlock1") - + ") " - + this.mPrimaryPumpedBlock); + "PUMP: NBT:Load - WasPumping - " + this.wasPumping + + "(" + + aNBT.getString("mPumpedBlock1") + + ") " + + this.mPrimaryPumpedBlock); } } @@ -166,24 +165,24 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (radiusConfig > max) radiusConfig = 0; } GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + (radiusConfig * 2 + 1) - + "x" - + (radiusConfig * 2 + 1)); // TODO Add translation support + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + + (radiusConfig * 2 + 1) + + "x" + + (radiusConfig * 2 + 1)); // TODO Add translation support clearQueue(false); } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ)) return true; mDisallowRetract = !mDisallowRetract; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal( - mDisallowRetract ? "GT5U.machines.autoretract.disabled" : "GT5U.machines.autoretract.enabled")); + aPlayer, + StatCollector.translateToLocal( + mDisallowRetract ? "GT5U.machines.autoretract.disabled" : "GT5U.machines.autoretract.enabled")); return true; } @@ -235,9 +234,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { IGregTechTileEntity tTileEntity; for (int i = 1; (i < 21) - && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) - != null) - && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) { + && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) + != null) + && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) { // Apparently someone might stack 21 pumps on top of each other, so let's check for that getBaseMetaTileEntity().setActive(tTileEntity.isActive()); this.mPumpCountBelow += 1; @@ -252,16 +251,16 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (getBaseMetaTileEntity().isAllowedToWork()) { mRetractDone = false; if ((getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction())) - && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { + && ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) { boolean tMovedOneDown = false; if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) { if (!this.wasPumping) { tMovedOneDown = moveOneDown(); if (!tMovedOneDown) { if (canMoveDown( - getBaseMetaTileEntity().getXCoord(), - Math.max(getYOfPumpHead() - 1, 1), - getBaseMetaTileEntity().getZCoord())) { + getBaseMetaTileEntity().getXCoord(), + Math.max(getYOfPumpHead() - 1, 1), + getBaseMetaTileEntity().getZCoord())) { if (debugBlockPump) { GT_Log.out.println("PUMP: No pipe left. Idle for a little longer."); } @@ -287,11 +286,11 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (debugBlockPump && this.mPrimaryPumpedBlock != null) { GT_Log.out.println( - "PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y - + " Previous blocks 1: " - + this.mPrimaryPumpedBlock - + " 2: " - + this.mSecondaryPumpedBlock); + "PUMP: Had an invalid pump block. Trying to find a fluid at Y: " + y + + " Previous blocks 1: " + + this.mPrimaryPumpedBlock + + " 2: " + + this.mSecondaryPumpedBlock); } // First look down checkForFluidToPump(x, y - 1, z); @@ -311,9 +310,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } else if (getYOfPumpHead() < getBaseMetaTileEntity().getYCoord()) { // We didn't just look for a block, and the pump head is below the pump if ((tMovedOneDown) || this.wasPumping - || ((this.mPumpList.isEmpty()) - && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) - || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) { + || ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 200L == 100L)) + || (getBaseMetaTileEntity().getTimer() % 72000L == 100L)) { // Rebuild the list to pump if any of the following conditions are true: // 1) We just moved down // 2) We were previously pumping (and possibly just reloaded) @@ -321,11 +319,11 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // 4) A long while has passed if (debugBlockPump) { GT_Log.out.println( - "PUMP: Rebuilding pump list - Size " + this.mPumpList.size() - + " WasPumping: " - + this.wasPumping - + " Timer " - + getBaseMetaTileEntity().getTimer()); + "PUMP: Rebuilding pump list - Size " + this.mPumpList.size() + + " WasPumping: " + + this.wasPumping + + " Timer " + + getBaseMetaTileEntity().getTimer()); } int yPump = getBaseMetaTileEntity().getYCoord() - 1, yHead = getYOfPumpHead(); @@ -357,29 +355,27 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } } else { if (!mRetractDone && ((aTick % 5) == 0) - && ((this.mInventory[0] == null) || this.mInventory[0].stackSize == 0 - || (GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE) - && (this.mInventory[0].stackSize - < this.mInventory[0].getMaxStackSize())))) { + && ((this.mInventory[0] == null) || this.mInventory[0].stackSize == 0 + || (GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE) + && (this.mInventory[0].stackSize < this.mInventory[0].getMaxStackSize())))) { // try retract if all of these conditions are met // 1. not retracted yet // 2. once per 5 tick // 3. can hold retracted pipe in inventory int tHeadY = getYOfPumpHead(); if (tHeadY < this.getBaseMetaTileEntity() - .getYCoord()) { + .getYCoord()) { final int tXCoord = this.getBaseMetaTileEntity() - .getXCoord(); + .getXCoord(); final int tZCoord = this.getBaseMetaTileEntity() - .getZCoord(); + .getZCoord(); this.getBaseMetaTileEntity() .getWorld() .setBlockToAir(tXCoord, tHeadY, tZCoord); if (tHeadY < this.getBaseMetaTileEntity() - .getYCoord() - - 1) { + .getYCoord() - 1) { getBaseMetaTileEntity().getWorld() - .setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK); + .setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK); } if (this.mInventory[0] == null) { final ItemStack copy = MINING_PIPE.copy(); @@ -430,7 +426,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { private boolean moveOneDown() { if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1) - || (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) { + || (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) { // No mining pipes if (debugBlockPump) { GT_Log.out.println("PUMP: No mining pipes"); @@ -450,11 +446,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord(); if ((!consumeFluid(x, yHead - 1, z)) && (!getBaseMetaTileEntity().getBlock(x, yHead - 1, z) - .isAir( - getBaseMetaTileEntity().getWorld(), - x, - yHead - 1, - z))) { + .isAir(getBaseMetaTileEntity().getWorld(), x, yHead - 1, z))) { // Either we didn't consume a fluid, or it's a non Air block if (debugBlockPump) { GT_Log.out.println("PUMP: Did not consume fluid, or non-airblock found"); @@ -463,13 +455,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } // Try to set the block below us to a tip if (!GT_Utility.setBlockByFakePlayer( - getFakePlayer(getBaseMetaTileEntity()), - x, - yHead - 1, - z, - MINING_PIPE_TIP_BLOCK, - 0, - false)) { + getFakePlayer(getBaseMetaTileEntity()), + x, + yHead - 1, + z, + MINING_PIPE_TIP_BLOCK, + 0, + false)) { if (debugBlockPump) { GT_Log.out.println("PUMP: Could not set block below to new tip"); } @@ -478,7 +470,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // And change the previous block to a pipe -- as long as it isn't the pump itself! if (yHead != getBaseMetaTileEntity().getYCoord()) { getBaseMetaTileEntity().getWorld() - .setBlock(x, yHead, z, MINING_PIPE_BLOCK); + .setBlock(x, yHead, z, MINING_PIPE_BLOCK); } getBaseMetaTileEntity().decrStackSize(0, 1); if (debugBlockPump) { @@ -492,7 +484,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // TODO: Handle pipe|pipe|head|pipe|pipe int y = getBaseMetaTileEntity().getYCoord() - 1, x = getBaseMetaTileEntity().getXCoord(), - z = getBaseMetaTileEntity().getZCoord(); + z = getBaseMetaTileEntity().getZCoord(); while (y > 0) { Block curBlock = getBaseMetaTileEntity().getBlock(x, y, z); @@ -504,7 +496,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { // We're running into an existing set of pipes -- Turn this block into a pipe and keep going this.clearQueue(true); getBaseMetaTileEntity().getWorld() - .setBlock(x, y, z, MINING_PIPE_BLOCK); + .setBlock(x, y, z, MINING_PIPE_BLOCK); if (debugBlockPump) { GT_Log.out.println("PUMP: Hit pipes already in place, trying to merge"); } @@ -518,12 +510,12 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (getBaseMetaTileEntity().getBlock(x, y, z) != MINING_PIPE_TIP_BLOCK) { if (y != getBaseMetaTileEntity().getYCoord() - 1 - && getBaseMetaTileEntity().getBlock(x, y + 1, z) == MINING_PIPE_BLOCK) { + && getBaseMetaTileEntity().getBlock(x, y + 1, z) == MINING_PIPE_BLOCK) { // We're below the pump at the bottom of the pipes, we haven't found a tip; make the previous pipe a // tip! this.clearQueue(true); getBaseMetaTileEntity().getWorld() - .setBlock(x, y + 1, z, MINING_PIPE_TIP_BLOCK); + .setBlock(x, y + 1, z, MINING_PIPE_TIP_BLOCK); if (debugBlockPump) { GT_Log.out.println("PUMP: Did not find a tip at bottom, setting last pipe as tip"); } @@ -582,7 +574,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { } private boolean queueFluid(int aX, int aY, int aZ, ArrayDeque<ChunkPosition> fluidsFound, - Set<ChunkPosition> checked) { + Set<ChunkPosition> checked) { // If we haven't already looked at this coordinate set, and it's not already in the list of fluids found, see if // there is // a valid fluid and add it to the fluids found @@ -630,10 +622,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ); return aBlock != null && (aBlock == Blocks.water || aBlock == Blocks.flowing_water - || aBlock == Blocks.lava - || aBlock == Blocks.flowing_lava - || aBlock instanceof IFluidBlock - || aBlock.isAir(getBaseMetaTileEntity().getWorld(), aX, aY, aZ)); + || aBlock == Blocks.lava + || aBlock == Blocks.flowing_lava + || aBlock instanceof IFluidBlock + || aBlock.isAir(getBaseMetaTileEntity().getWorld(), aX, aY, aZ)); } private boolean consumeFluid(int aX, int aY, int aZ) { @@ -645,7 +637,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { if (aBlock != null && ((this.mPrimaryPumpedBlock == aBlock) || (this.mSecondaryPumpedBlock == aBlock))) { boolean isWaterOrLava = ((this.mPrimaryPumpedBlock == Blocks.water - || this.mPrimaryPumpedBlock == Blocks.lava)); + || this.mPrimaryPumpedBlock == Blocks.lava)); if (isWaterOrLava && getBaseMetaTileEntity().getMetaID(aX, aY, aZ) != 0) { // Water/Lava that isn't a source block - do nothing here, but set the block to air and consume energy @@ -662,27 +654,27 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true); } } else if (GT_ModHandler.isWater(this.mFluid) || GT_ModHandler.isLava(this.mFluid) - || this.mFluid.isFluidEqual( - ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) { - if (!isWaterOrLava) { - // Only set Block to Air for non lava/water fluids - this.getBaseMetaTileEntity() - .getWorld() - .setBlockToAir(aX, aY, aZ); - } - this.mFluid.amount += 1000; + || this.mFluid.isFluidEqual( + ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, false))) { + if (!isWaterOrLava) { + // Only set Block to Air for non lava/water fluids + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir(aX, aY, aZ); + } + this.mFluid.amount += 1000; - } else { - if (debugBlockPump) { - GT_Log.out.println("PUMP: Couldn't consume " + aBlock); - } - // We didn't do anything - return false; - } + } else { + if (debugBlockPump) { + GT_Log.out.println("PUMP: Couldn't consume " + aBlock); + } + // We didn't do anything + return false; + } getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.getEuUsagePerAction(), true); getBaseMetaTileEntity().getWorld() - .setBlock(aX, aY, aZ, Blocks.air, 0, 2); + .setBlock(aX, aY, aZ, Blocks.air, 0, 2); return true; } return false; @@ -696,28 +688,26 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, - int aLogLevel, ArrayList<String> aList) { + int aLogLevel, ArrayList<String> aList) { aList.addAll( - Arrays.asList( - EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.pump") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea") + ": " - + EnumChatFormatting.GREEN - + (radiusConfig * 2 + 1) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.machines.blocks"), - "Primary pumping fluid: " - + (this.mPrimaryPumpedBlock != null ? this.mPrimaryPumpedBlock.getLocalizedName() - : "None"), - "Secondary pumping fluid: " - + (this.mSecondaryPumpedBlock != null ? this.mSecondaryPumpedBlock.getLocalizedName() - : "None"), - "Pumps below: " + mPumpCountBelow, - "Queue size: " + mPumpList.size(), - "Pump head at Y: " + getYOfPumpHead(), - "Pump timer: " + mPumpTimer, - "Meta Entity Timer: " + getBaseMetaTileEntity().getTimer())); + Arrays.asList( + EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.pump") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + + EnumChatFormatting.GREEN + + (radiusConfig * 2 + 1) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.machines.blocks"), + "Primary pumping fluid: " + + (this.mPrimaryPumpedBlock != null ? this.mPrimaryPumpedBlock.getLocalizedName() : "None"), + "Secondary pumping fluid: " + + (this.mSecondaryPumpedBlock != null ? this.mSecondaryPumpedBlock.getLocalizedName() : "None"), + "Pumps below: " + mPumpCountBelow, + "Queue size: " + mPumpList.size(), + "Pump head at Y: " + getYOfPumpHead(), + "Pump timer: " + mPumpTimer, + "Meta Entity Timer: " + getBaseMetaTileEntity().getTimer())); return aList; } @@ -813,10 +803,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - (aSide == 0 || aSide == 1) ? TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT) - : TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP) }; + (aSide == 0 || aSide == 1) ? TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT) + : TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP) }; } @Override @@ -827,9 +817,9 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return new ITexture[] { TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), - TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), - TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), - TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), }; + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), + TextureFactory.of(Textures.BlockIcons.OVERLAY_ADV_PUMP), }; } private FakePlayer mFakePlayer = null; @@ -844,14 +834,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { return new String[] { - EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.pump") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea") + ": " - + EnumChatFormatting.GREEN - + (radiusConfig * 2 + 1) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.machines.blocks") }; + EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.pump") + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + + EnumChatFormatting.GREEN + + (radiusConfig * 2 + 1) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.machines.blocks") }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java index 739db376c1..45abd16d9f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java @@ -40,85 +40,85 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine public GT_MetaTileEntity_Replicator(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Producing Elemental Matter", - 1, - 1, - "Replicator.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_REPLICATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_REPLICATOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_REPLICATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_REPLICATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_REPLICATOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_REPLICATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_REPLICATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_REPLICATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_REPLICATOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_REPLICATOR_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_REPLICATOR_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Producing Elemental Matter", + 1, + 1, + "Replicator.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_REPLICATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_REPLICATOR), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_REPLICATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_REPLICATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_REPLICATOR), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_REPLICATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_REPLICATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_REPLICATOR), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_REPLICATOR_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_REPLICATOR_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_REPLICATOR), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_REPLICATOR_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_Replicator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Replicator( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } public static long cubicFluidMultiplier(long amount) { @@ -131,8 +131,7 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine if ((tFluid != null) && (tFluid.isFluidEqual(Materials.UUMatter.getFluid(1L)))) { ItemStack tDataOrb = getSpecialSlot(); if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true)) && (Behaviour_DataOrb.getDataTitle(tDataOrb) - .equals( - "Elemental-Scan"))) { + .equals("Elemental-Scan"))) { Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); long tMass = cubicFluidMultiplier(MASS_OVERRIDES.getOrDefault(tMaterial, tMaterial.getMass())); if ((tFluid.amount >= tMass) && (tMass > 0L)) { @@ -144,9 +143,9 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) { if ((this.mOutputItems[0] = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) - != null) { + != null) { if ((this.mOutputFluid = GT_Utility.getFluidForFilledItem(this.mOutputItems[0], true)) - == null) { + == null) { if (ItemList.Cell_Empty.isStackEqual(getInputAt(0))) { if (canOutput(this.mOutputItems[0])) { getInputAt(0).stackSize -= 1; @@ -157,8 +156,8 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine } else { this.mOutputItems[0] = null; if ((getDrainableStack() == null) - || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) - && (getDrainableStack().amount < 16000))) { + || ((getDrainableStack().isFluidEqual(this.mOutputFluid)) + && (getDrainableStack().amount < 16000))) { tFluid.amount = ((int) (tFluid.amount - tMass)); return 2; } @@ -181,9 +180,9 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && ItemList.Cell_Empty.isStackEqual(aStack); + && ItemList.Cell_Empty.isStackEqual(aStack); } @Override @@ -195,11 +194,11 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine public int getCapacity() { if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) { sHeaviestElementMass = Materials.getMaterialsMap() - .values() - .stream() - .mapToInt(material -> (int) cubicFluidMultiplier((int) material.getMass())) - .max() - .orElseThrow(NoSuchElementException::new); + .values() + .stream() + .mapToInt(material -> (int) cubicFluidMultiplier((int) material.getMass())) + .max() + .orElseThrow(NoSuchElementException::new); // Make the Number nicer =) sHeaviestElementMass = 1000 * (sHeaviestElementMass / 1000 + 1); } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java index ace1e90f71..2c16cbad2a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java @@ -20,85 +20,85 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Put Lava and Water adjacent", - 1, - 1, - "RockBreaker.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Put Lava and Water adjacent", + 1, + 1, + "RockBreaker.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_RockBreaker( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -108,9 +108,9 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && getRecipeList().containsInput(aStack); + && getRecipeList().containsInput(aStack); } @Override @@ -122,23 +122,23 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin public int checkRecipe() { IGregTechTileEntity aBaseMetaTileEntity = getBaseMetaTileEntity(); if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.water) - || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) - || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) - || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { + || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.water) + || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.water) + || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.water)) { ItemStack tOutput = null; if (aBaseMetaTileEntity.getBlockOffset(0, 1, 0) == Blocks.lava) { tOutput = new ItemStack(Blocks.stone, 1); } else if ((aBaseMetaTileEntity.getBlockOffset(0, 0, 1) == Blocks.lava) - || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) - || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) - || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) { - tOutput = new ItemStack(Blocks.cobblestone, 1); - } + || (aBaseMetaTileEntity.getBlockOffset(0, 0, -1) == Blocks.lava) + || (aBaseMetaTileEntity.getBlockOffset(-1, 0, 0) == Blocks.lava) + || (aBaseMetaTileEntity.getBlockOffset(1, 0, 0) == Blocks.lava)) { + tOutput = new ItemStack(Blocks.cobblestone, 1); + } if (tOutput != null) { if (GT_Utility.areStacksEqual(getStackInSlot(getCircuitSlot()), GT_Utility.getIntegratedCircuit(1))) { if (GT_Utility.areStacksEqual( - getInputAt(0), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { + getInputAt(0), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { tOutput = new ItemStack(Blocks.obsidian, 1); if (canOutput(tOutput)) { getInputAt(0).stackSize -= 1; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java index ca2182c0b8..ef4dc2ec3b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java @@ -38,85 +38,85 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public GT_MetaTileEntity_Scanner(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "Scans Crops and other things.", - 1, - 1, - "Scanner.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_SCANNER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_SCANNER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_SCANNER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_SCANNER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_SCANNER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_SCANNER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_SCANNER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_SCANNER_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "Scans Crops and other things.", + 1, + 1, + "Scanner.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_SCANNER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_SCANNER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_SCANNER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_SCANNER_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_Scanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Scanner( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -187,10 +187,10 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } ItemData tData = GT_OreDictUnificator.getAssociation(aStack); if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) - && (tData.mMaterial.mMaterial.mElement != null) - && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) - && (tData.mMaterial.mMaterial != Materials.Magic) - && (tData.mMaterial.mMaterial.getMass() > 0L)) { + && (tData.mMaterial.mMaterial.mElement != null) + && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) + && (tData.mMaterial.mMaterial != Materials.Magic) + && (tData.mMaterial.mMaterial.getMass() > 0L)) { getSpecialSlot().stackSize -= 1; aStack.stackSize -= 1; @@ -234,10 +234,8 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound( - GT_Utility.getNBTContainingShort( - new NBTTagCompound(), - "map_id", - (short) aStack.getItemDamage())); + GT_Utility + .getNBTContainingShort(new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) @@ -246,87 +244,71 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } if ((aStack.getItem() - .getUnlocalizedName() - .contains("Schematic") - || aStack.getItem() - .getUnlocalizedName() - .contains("schematic")) - && !aStack.getItem() - .getUnlocalizedName() - .contains("Schematics")) { + .getUnlocalizedName() + .contains("Schematic") + || aStack.getItem() + .getUnlocalizedName() + .contains("schematic")) + && !aStack.getItem() + .getUnlocalizedName() + .contains("Schematics")) { if (mTier < 3) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; String sTier = ""; int stackItemID = Item.getIdFromItem(aStack.getItem()); int stackItemDamage = aStack.getItemDamage(); if (stackItemID == Item.getIdFromItem( - Objects.requireNonNull( - GT_ModHandler.getModItem(GalacticraftCore.ID, "item.schematic", 1L, 0)) - .getItem())) { + Objects.requireNonNull(GT_ModHandler.getModItem(GalacticraftCore.ID, "item.schematic", 1L, 0)) + .getItem())) { if (stackItemDamage == 0 && aStack.toString() - .equals( - Objects.requireNonNull( - GT_ModHandler.getModItem( - GalacticraftCore.ID, - "item.schematic", - 1L, - 0)) - .copy() - .toString())) + .equals( + Objects + .requireNonNull( + GT_ModHandler.getModItem(GalacticraftCore.ID, "item.schematic", 1L, 0)) + .copy() + .toString())) sTier = "100"; else if (stackItemDamage == 1 && aStack.toString() - .equals( - Objects.requireNonNull( - GT_ModHandler.getModItem( - GalacticraftCore.ID, - "item.schematic", - 1L, - 1)) - .copy() - .toString())) + .equals( + Objects + .requireNonNull( + GT_ModHandler.getModItem(GalacticraftCore.ID, "item.schematic", 1L, 1)) + .copy() + .toString())) sTier = "2"; } else { if (stackItemID == Item.getIdFromItem( - Objects.requireNonNull( - GT_ModHandler.getModItem(GalacticraftMars.ID, "item.schematic", 1L, 0)) - .getItem())) { + Objects + .requireNonNull(GT_ModHandler.getModItem(GalacticraftMars.ID, "item.schematic", 1L, 0)) + .getItem())) { if (stackItemDamage == 0 && aStack.toString() - .equals( - Objects.requireNonNull( - GT_ModHandler.getModItem( - GalacticraftMars.ID, - "item.schematic", - 1L, - 0)) - .copy() - .toString())) + .equals( + Objects + .requireNonNull( + GT_ModHandler.getModItem(GalacticraftMars.ID, "item.schematic", 1L, 0)) + .copy() + .toString())) sTier = "3"; else if (stackItemDamage == 1 && aStack.toString() - .equals( - Objects.requireNonNull( - GT_ModHandler.getModItem( - GalacticraftMars.ID, - "item.schematic", - 1L, - 1)) - .copy() - .toString())) + .equals( + Objects + .requireNonNull( + GT_ModHandler.getModItem(GalacticraftMars.ID, "item.schematic", 1L, 1)) + .copy() + .toString())) sTier = "101"; else if (stackItemDamage == 2 && aStack.toString() - .equals( - Objects.requireNonNull( - GT_ModHandler.getModItem( - GalacticraftMars.ID, - "item.schematic", - 1L, - 2)) - .copy() - .toString())) + .equals( + Objects + .requireNonNull( + GT_ModHandler.getModItem(GalacticraftMars.ID, "item.schematic", 1L, 2)) + .copy() + .toString())) sTier = "102"; } else if (aStack.getUnlocalizedName() - .matches(".*\\d+.*")) + .matches(".*\\d+.*")) sTier = aStack.getUnlocalizedName() - .split("(?<=\\D)(?=\\d)")[1].substring(0, 1); + .split("(?<=\\D)(?=\\d)")[1].substring(0, 1); else sTier = "1"; } @@ -336,10 +318,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot()); assert this.mOutputItems[0] != null; this.mOutputItems[0].setTagCompound( - GT_Utility.getNBTContainingShort( - new NBTTagCompound(), - "rocket_tier", - Short.parseShort(sTier))); + GT_Utility.getNBTContainingShort(new NBTTagCompound(), "rocket_tier", Short.parseShort(sTier))); calculateOverclockedNess(480, 36000); // In case recipe is too OP for that machine @@ -350,7 +329,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { } if (getSpecialSlot() == null && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { if (GT_Utility.ItemNBT.getBookTitle(aStack) - .equals("Raw Prospection Data")) { + .equals("Raw Prospection Data")) { GT_Utility.ItemNBT.setBookTitle(aStack, "Analyzed Prospection Data"); GT_Utility.ItemNBT.convertProspectionData(aStack); aStack.stackSize -= 1; @@ -400,11 +379,11 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime >= (mMaxProgresstime - 1)) { if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName() - .equals("gt.metaitem.01.32707"))) { + .equals("gt.metaitem.01.32707"))) { GT_Mod.achievements.issueAchievement( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), - "scanning"); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "scanning"); } } super.onPostTick(aBaseMetaTileEntity, aTick); @@ -422,9 +401,9 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine { @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && getRecipeList().containsInput(aStack); + && getRecipeList().containsInput(aStack); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java index 021511032b..02a2c2da99 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java @@ -35,85 +35,85 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic public GT_MetaTileEntity_SeismicProspector(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 1, - "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", - 1, - 1, - "Default.png", - "", - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build()), - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) - .glow() - .build())); + aID, + aName, + aNameRegional, + aTier, + 1, + "(DEPRECATED, DO NOT USE! SWAP TO ADVANCED VERSION USING SHAPELESS RECIPE!)", + 1, + 1, + "Default.png", + "", + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_ROCK_BREAKER), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW) + .glow() + .build())); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SeismicProspector( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures, - this.mGUIName, - this.mNEIName); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -122,15 +122,15 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic ItemStack aStack = aPlayer.getCurrentEquippedItem(); ItemData stackData = GT_OreDictUnificator.getItemData(aStack); if (!ready && (aStack != null) - && ((aStack.getItem() == Item.getItemFromBlock(Blocks.tnt) && aStack.stackSize >= 2) - || (aStack.getItem() == Ic2Items.industrialTnt.getItem() && aStack.stackSize >= 1) - || (aStack.getItem() == Ic2Items.dynamite.getItem() && aStack.stackSize >= 4) - || (stackData != null && stackData.mMaterial.mMaterial == Materials.Glyceryl - && aStack.stackSize >= 1) - || (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() - && aStack.getItemDamage() == ItemList.Block_Powderbarrel.get(1) - .getItemDamage() - && aStack.stackSize >= 8))) { + && ((aStack.getItem() == Item.getItemFromBlock(Blocks.tnt) && aStack.stackSize >= 2) + || (aStack.getItem() == Ic2Items.industrialTnt.getItem() && aStack.stackSize >= 1) + || (aStack.getItem() == Ic2Items.dynamite.getItem() && aStack.stackSize >= 4) + || (stackData != null && stackData.mMaterial.mMaterial == Materials.Glyceryl + && aStack.stackSize >= 1) + || (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() + && aStack.getItemDamage() == ItemList.Block_Powderbarrel.get(1) + .getItemDamage() + && aStack.stackSize >= 8))) { if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) { if (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)) { aStack.stackSize -= 2; @@ -139,99 +139,92 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic } else if (aStack.getItem() == Ic2Items.dynamite.getItem()) { aStack.stackSize -= 4; } else if (aStack.getItem() == ItemList.Block_Powderbarrel.getItem() - && aStack.getItemDamage() == ItemList.Block_Powderbarrel.get(1) - .getItemDamage()) { - aStack.stackSize -= 8; - } else { - aStack.stackSize -= 1; - } + && aStack.getItemDamage() == ItemList.Block_Powderbarrel.get(1) + .getItemDamage()) { + aStack.stackSize -= 8; + } else { + aStack.stackSize -= 1; + } } this.ready = true; this.mMaxProgresstime = 200; } else if (ready && mMaxProgresstime == 0 - && aStack != null - && aStack.stackSize == 1 - && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { - this.ready = false; - GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(), "Raw Prospection Data"); - List<String> tStringList = new ArrayList<>(); - - // range by tier - int min = -range(); - int max = range(); - int step = step(); - - for (int i = this.getBaseMetaTileEntity() - .getYCoord(); i > 0; i--) { - for (int f = min; f <= max; f += step) { - for (int g = min; g <= max; g += step) { - Block tBlock = this.getBaseMetaTileEntity() - .getBlockOffset(f, -i, g); - if ((tBlock instanceof GT_Block_Ores_Abstract)) { - TileEntity tTileEntity = getBaseMetaTileEntity().getWorld() - .getTileEntity( - getBaseMetaTileEntity().getXCoord() - + f, - getBaseMetaTileEntity().getYCoord() - + (-i), - getBaseMetaTileEntity().getZCoord() - + g); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - if (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData - % 1000)]; - if ((tMaterial != null) && (tMaterial != Materials._NULL)) { - if (!tStringList.contains(tMaterial.mDefaultLocalName)) { - tStringList.add(tMaterial.mDefaultLocalName); - } + && aStack != null + && aStack.stackSize == 1 + && aStack.getItem() == ItemList.Tool_DataStick.getItem()) { + this.ready = false; + GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(), "Raw Prospection Data"); + List<String> tStringList = new ArrayList<>(); + + // range by tier + int min = -range(); + int max = range(); + int step = step(); + + for (int i = this.getBaseMetaTileEntity() + .getYCoord(); i > 0; i--) { + for (int f = min; f <= max; f += step) { + for (int g = min; g <= max; g += step) { + Block tBlock = this.getBaseMetaTileEntity() + .getBlockOffset(f, -i, g); + if ((tBlock instanceof GT_Block_Ores_Abstract)) { + TileEntity tTileEntity = getBaseMetaTileEntity().getWorld() + .getTileEntity( + getBaseMetaTileEntity().getXCoord() + f, + getBaseMetaTileEntity().getYCoord() + (-i), + getBaseMetaTileEntity().getZCoord() + g); + if ((tTileEntity instanceof GT_TileEntity_Ores)) { + if (((GT_TileEntity_Ores) tTileEntity).mMetaData < 16000) { + Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData + % 1000)]; + if ((tMaterial != null) && (tMaterial != Materials._NULL)) { + if (!tStringList.contains(tMaterial.mDefaultLocalName)) { + tStringList.add(tMaterial.mDefaultLocalName); } } } - } else { - int tMetaID = getBaseMetaTileEntity().getWorld() - .getBlockMetadata( - getBaseMetaTileEntity().getXCoord() - + f, - getBaseMetaTileEntity().getYCoord() - + (-i), - getBaseMetaTileEntity().getZCoord() - + g); - ItemData tAssotiation = GT_OreDictUnificator.getAssociation( - new ItemStack(tBlock, 1, tMetaID)); - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() - .startsWith("ore"))) { - if (!tStringList.contains( - tAssotiation.mMaterial.mMaterial.mDefaultLocalName)) { - tStringList.add(tAssotiation.mMaterial.mMaterial.mDefaultLocalName); - } + } + } else { + int tMetaID = getBaseMetaTileEntity().getWorld() + .getBlockMetadata( + getBaseMetaTileEntity().getXCoord() + f, + getBaseMetaTileEntity().getYCoord() + (-i), + getBaseMetaTileEntity().getZCoord() + g); + ItemData tAssotiation = GT_OreDictUnificator + .getAssociation(new ItemStack(tBlock, 1, tMetaID)); + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString() + .startsWith("ore"))) { + if (!tStringList.contains(tAssotiation.mMaterial.mMaterial.mDefaultLocalName)) { + tStringList.add(tAssotiation.mMaterial.mMaterial.mDefaultLocalName); } } } } } - if (tStringList.size() < 1) { - tStringList.add("No Ores found."); - } - FluidStack tFluid = GT_UndergroundOil.undergroundOilReadInformation(getBaseMetaTileEntity()); - String[] tStringArray = new String[tStringList.size()]; - { - for (int i = 0; i < tStringArray.length; i++) { - tStringArray[i] = tStringList.get(i); - } + } + if (tStringList.size() < 1) { + tStringList.add("No Ores found."); + } + FluidStack tFluid = GT_UndergroundOil.undergroundOilReadInformation(getBaseMetaTileEntity()); + String[] tStringArray = new String[tStringList.size()]; + { + for (int i = 0; i < tStringArray.length; i++) { + tStringArray[i] = tStringList.get(i); } - GT_Utility.ItemNBT.setProspectionData( - aPlayer.getCurrentEquippedItem(), - this.getBaseMetaTileEntity() - .getXCoord(), - this.getBaseMetaTileEntity() - .getYCoord(), - this.getBaseMetaTileEntity() - .getZCoord(), - this.getBaseMetaTileEntity() - .getWorld().provider.dimensionId, - tFluid, - tStringArray); } + GT_Utility.ItemNBT.setProspectionData( + aPlayer.getCurrentEquippedItem(), + this.getBaseMetaTileEntity() + .getXCoord(), + this.getBaseMetaTileEntity() + .getYCoord(), + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity() + .getWorld().provider.dimensionId, + tFluid, + tStringArray); + } } return true; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index 08b5897298..ffff8801a5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -64,7 +64,7 @@ import gregtech.api.util.GT_Config; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank - implements IAddGregtechLogo, IAddUIWidgets { + implements IAddGregtechLogo, IAddUIWidgets { private static boolean sInterDimensionalTeleportAllowed = true; private static int sPassiveEnergyDrain = 2048; @@ -79,13 +79,13 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - new String[] { "Teleport long distances with this little device.", - "Use a Dragon Egg or Nitrogen Plasma", "for Inter-dimensional transmission" }); + aID, + aName, + aNameRegional, + aTier, + 3, + new String[] { "Teleport long distances with this little device.", "Use a Dragon Egg or Nitrogen Plasma", + "for Inter-dimensional transmission" }); } public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -116,8 +116,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank for (int i = 0; i < 36; i++) { if (tPlayer.inventory.getStackInSlot(i) != null) { tCount += (tPlayer.inventory.getStackInSlot(i) - .getMaxStackSize() - > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64); + .getMaxStackSize() > 1 ? tPlayer.inventory.getStackInSlot(i).stackSize : 64); } } for (int i = 0; i < 4; i++) { @@ -128,11 +127,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank return Math.min(5.0F, tCount / 666.6F); } if (GT_Utility.getClassName(aEntity) - .equals("EntityItnt")) { + .equals("EntityItnt")) { return 5.0F; } if (GT_Utility.getClassName(aEntity) - .equals("EntityNuke")) { + .equals("EntityNuke")) { return 50.0F; } if ((aEntity instanceof EntityArrow)) { @@ -198,38 +197,38 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank @Override public String[] getInfoData() { return new String[] { "Coordinates:", - "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, - "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, - "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, - "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, - "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) - ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), - "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) - ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; + "X: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetX) + EnumChatFormatting.RESET, + "Y: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetY) + EnumChatFormatting.RESET, + "Z: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTargetZ) + EnumChatFormatting.RESET, + "Dimension: " + EnumChatFormatting.GREEN + this.mTargetD + EnumChatFormatting.RESET, + "Dimension Valid: " + (GT_Utility.isRealDimension(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET), + "Dimension Registered: " + (DimensionManager.isDimensionRegistered(this.mTargetD) + ? EnumChatFormatting.GREEN + "Yes" + EnumChatFormatting.RESET + : EnumChatFormatting.RED + "No" + EnumChatFormatting.RESET) }; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != this.getBaseMetaTileEntity() - .getFrontFacing()) + .getFrontFacing()) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER_SIDES), TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_SIDES_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_TELEPORTER_SIDES), TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_SIDES_GLOW) + .glow() + .build() }; if (aActive) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_TELEPORTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER), - TextureFactory.builder() - .addIcon(OVERLAY_TELEPORTER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TELEPORTER_GLOW) + .glow() + .build() }; } @Override @@ -254,14 +253,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank @Override public void onConfigLoad(GT_Config aConfig) { - sInterDimensionalTeleportAllowed = aConfig.get( - ConfigCategories.machineconfig, - "Teleporter.Interdimensional", - true); - sPassiveEnergyDrain = aConfig.get( - ConfigCategories.machineconfig, - "Teleporter.PassiveDrain", - sPassiveEnergyDrain); + sInterDimensionalTeleportAllowed = aConfig + .get(ConfigCategories.machineconfig, "Teleporter.Interdimensional", true); + sPassiveEnergyDrain = aConfig + .get(ConfigCategories.machineconfig, "Teleporter.PassiveDrain", sPassiveEnergyDrain); sPowerMultiplyer = aConfig.get(ConfigCategories.machineconfig, "Teleporter.PowerMultipler", sPowerMultiplyer); sFPowerMultiplyer = sPowerMultiplyer / 100.0; } @@ -270,8 +265,8 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { if (getBaseMetaTileEntity().isServerSide()) { if ((this.mTargetX == 0) && (this.mTargetY == 0) - && (this.mTargetZ == 0) - && (this.mTargetD == Integer.MIN_VALUE)) { + && (this.mTargetZ == 0) + && (this.mTargetD == Integer.MIN_VALUE)) { this.mTargetX = aBaseMetaTileEntity.getXCoord(); this.mTargetY = aBaseMetaTileEntity.getYCoord(); this.mTargetZ = aBaseMetaTileEntity.getZCoord(); @@ -297,7 +292,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank public boolean hasDimensionalTeleportCapability() { return this.mDebug || // ( - sInterDimensionalTeleportAllowed // && + sInterDimensionalTeleportAllowed // && // ( // this.hasEgg || // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000 @@ -308,7 +303,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank public boolean isDimensionalTeleportAvailable() { return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD) - && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); + && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId)); } @Override @@ -346,54 +341,42 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank if (tTile instanceof IInventory) { int tStacksize = mInventory[0].stackSize; GT_Utility.moveOneItemStack( - this, - tTile, - (byte) 0, - (byte) 0, - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); + this, + tTile, + (byte) 0, + (byte) 0, + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) { getBaseMetaTileEntity().decreaseStoredEnergyUnits( - (long) (Math.pow(tDistance, 1.5) * tDistance - * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) - * sFPowerMultiplyer), - false); + (long) (Math.pow(tDistance, 1.5) * tDistance + * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)) + * sFPowerMultiplyer), + false); } } } List<Entity> entities_in_box = getBaseMetaTileEntity().getWorld() - .getEntitiesWithinAABB( - Entity.class, - AxisAlignedBB.getBoundingBox( - getBaseMetaTileEntity().getOffsetX( - getBaseMetaTileEntity().getFrontFacing(), - 2) - 1, - getBaseMetaTileEntity().getOffsetY( - getBaseMetaTileEntity().getFrontFacing(), - 2) - 1, - getBaseMetaTileEntity().getOffsetZ( - getBaseMetaTileEntity().getFrontFacing(), - 2) - 1, - getBaseMetaTileEntity().getOffsetX( - getBaseMetaTileEntity().getFrontFacing(), - 2) + 2, - getBaseMetaTileEntity().getOffsetY( - getBaseMetaTileEntity().getFrontFacing(), - 2) + 2, - getBaseMetaTileEntity().getOffsetZ( - getBaseMetaTileEntity().getFrontFacing(), - 2) + 2)); + .getEntitiesWithinAABB( + Entity.class, + AxisAlignedBB.getBoundingBox( + getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, + getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, + getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, + getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, + getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, + getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2)); for (Object tObject : entities_in_box) { if (((tObject instanceof Entity tEntity)) && (!((Entity) tObject).isDead)) { // GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5))); if (getBaseMetaTileEntity().decreaseStoredEnergyUnits( - (long) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), - false)) { + (long) (Math.pow(tDistance, 1.5) * weightCalculation(tEntity) * sFPowerMultiplyer), + false)) { // if (hasDimensionalTeleportCapability() && this.mTargetD != // getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg || // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))) { @@ -410,23 +393,23 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) - || (!isDimensionalTeleportAvailable()) - || (!GT_Utility.moveEntityToDimensionAtCoords( - tEntity, - this.mTargetD, - this.mTargetX + 0.5D, - this.mTargetY + 0.5D, - this.mTargetZ + 0.5D))) { + || (!isDimensionalTeleportAvailable()) + || (!GT_Utility.moveEntityToDimensionAtCoords( + tEntity, + this.mTargetD, + this.mTargetX + 0.5D, + this.mTargetY + 0.5D, + this.mTargetZ + 0.5D))) { if ((tEntity instanceof EntityLivingBase)) { ((EntityLivingBase) tEntity).setPositionAndUpdate( - this.mTargetX + 0.5D, - this.mTargetY + 0.5D, - this.mTargetZ + 0.5D); + this.mTargetX + 0.5D, + this.mTargetY + 0.5D, + this.mTargetZ + 0.5D); } else { tEntity.setPosition( - this.mTargetX + 0.5D, - this.mTargetY + 0.5D, - this.mTargetZ + 0.5D); + this.mTargetX + 0.5D, + this.mTargetY + 0.5D, + this.mTargetZ + 0.5D); } } } @@ -442,15 +425,13 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank private int distanceCalculation() { return Math.abs( - ((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) - && (isDimensionalTeleportAvailable()) - ? 4000 - : (int) Math.sqrt( - Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) - + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) - + Math.pow( - getBaseMetaTileEntity().getZCoord() - this.mTargetZ, - 2.0D)))); + ((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) + && (isDimensionalTeleportAvailable()) + ? 4000 + : (int) Math.sqrt( + Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)))); } @Override @@ -591,32 +572,31 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setSize(90, 72) - .setPos(43, 4)) - .widget( - TextWidget.dynamicString(() -> "X: " + GT_Utility.parseNumberToString(mTargetX)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 8)) - .widget( - TextWidget.dynamicString(() -> "Y: " + GT_Utility.parseNumberToString(mTargetY)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 16)) - .widget( - TextWidget.dynamicString(() -> "Z: " + GT_Utility.parseNumberToString(mTargetZ)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 24)) - .widget( - TextWidget.dynamicString(() -> "Dim: " + GT_Utility.parseNumberToString(mTargetD)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 32)) - .widget( - TextWidget.dynamicString( - () -> "Dim Valid: " + (GT_Utility.isRealDimension(mTargetD) ? "Yes" : "No")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> hasDimensionalTeleportCapability()) - .setPos(46, 40)) - .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setSize(90, 72) + .setPos(43, 4)) + .widget( + TextWidget.dynamicString(() -> "X: " + GT_Utility.parseNumberToString(mTargetX)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 8)) + .widget( + TextWidget.dynamicString(() -> "Y: " + GT_Utility.parseNumberToString(mTargetY)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 16)) + .widget( + TextWidget.dynamicString(() -> "Z: " + GT_Utility.parseNumberToString(mTargetZ)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 24)) + .widget( + TextWidget.dynamicString(() -> "Dim: " + GT_Utility.parseNumberToString(mTargetD)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(46, 32)) + .widget( + TextWidget.dynamicString(() -> "Dim Valid: " + (GT_Utility.isRealDimension(mTargetD) ? "Yes" : "No")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> hasDimensionalTeleportCapability()) + .setPos(46, 40)) + .widget(new FakeSyncWidget.FluidStackSyncer(() -> mFluid, val -> mFluid = val)); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7); addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, -16, -1, 25); @@ -624,40 +604,40 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, 512, 64, 151); addChangeNumberButton( - builder, - GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, - val -> mTargetD += val, - -16, - -8, - 7, - 58); + builder, + GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, + val -> mTargetD += val, + -16, + -8, + 7, + 58); addChangeNumberButton( - builder, - GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, - val -> mTargetD += val, - -4, - -1, - 25, - 58); + builder, + GT_UITextures.OVERLAY_BUTTON_MINUS_SMALL, + val -> mTargetD += val, + -4, + -1, + 25, + 58); addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_SMALL, val -> mTargetD += val, 4, 1, 133, 58); addChangeNumberButton(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, val -> mTargetD += val, 16, 8, 151, 58); } private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift, - int addNumber, int xPos) { + int addNumber, int xPos) { addChangeNumberButton(builder, overlay, val -> mTargetX += val, addNumberShift, addNumber, xPos, 4); addChangeNumberButton(builder, overlay, val -> mTargetY += val, addNumberShift, addNumber, xPos, 22); addChangeNumberButton(builder, overlay, val -> mTargetZ += val, addNumberShift, addNumber, xPos, 40); } private void addChangeNumberButton(ModularWindow.Builder builder, IDrawable overlay, Consumer<Integer> setter, - int addNumberShift, int addNumber, int xPos, int yPos) { + int addNumberShift, int addNumber, int xPos, int yPos) { builder.widget( - new ButtonWidget().setOnClick( - (clickData, widget) -> setter.accept(clickData.shift ? addNumberShift : addNumber)) - .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) - .setSize(18, 18) - .setPos(xPos, yPos)); + new ButtonWidget() + .setOnClick((clickData, widget) -> setter.accept(clickData.shift ? addNumberShift : addNumber)) + .setBackground(GT_UITextures.BUTTON_STANDARD, overlay) + .setSize(18, 18) + .setPos(xPos, yPos)); } @Override @@ -668,8 +648,8 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(113, 56)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(113, 56)); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java index 898d819109..b868d151f2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java @@ -66,12 +66,12 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta protected GT_MetaTileEntity_LongDistancePipelineBase mTooCloseTarget = null, mTooCloseSender = null; public GT_MetaTileEntity_LongDistancePipelineBase(int aID, String aName, String aNameRegional, int aTier, - String aDescription) { + String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } public GT_MetaTileEntity_LongDistancePipelineBase(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -91,9 +91,9 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta super.loadNBTData(aNBT); if (aNBT.hasKey("target")) { mTargetPos = new ChunkCoordinates( - aNBT.getInteger("target.x"), - aNBT.getInteger("target.y"), - aNBT.getInteger("target.z")); + aNBT.getInteger("target.x"), + aNBT.getInteger("target.y"), + aNBT.getInteger("target.z")); if (getDistanceToSelf(mTargetPos) < minimalDistancePoints) mTargetPos = null; } } @@ -136,8 +136,9 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta TileEntity te = world.getTileEntity(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ); final IMetaTileEntity tMeta; if (te instanceof BaseMetaTileEntity - && ((tMeta = ((BaseMetaTileEntity) te).getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase) - && isSameClass((GT_MetaTileEntity_LongDistancePipelineBase) tMeta)) { + && ((tMeta = ((BaseMetaTileEntity) te) + .getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase) + && isSameClass((GT_MetaTileEntity_LongDistancePipelineBase) tMeta)) { // It's the right type! mTarget = (GT_MetaTileEntity_LongDistancePipelineBase) tMeta; } else if (te != null) { @@ -151,8 +152,8 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta mTooCloseSender = null; if (mTarget == null || mTarget == this) return false; if (mTarget.mSender == null || mTarget.mSender.isDead() - || mTarget.mSender.mTarget == null - || mTarget.mSender.mTarget.isDead()) { + || mTarget.mSender.mTarget == null + || mTarget.mSender.mTarget.isDead()) { mTarget.mSender = this; mTarget.mTooCloseSender = null; } @@ -162,22 +163,22 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta @Override public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, - int aLogLevel, ArrayList<String> aList) { + int aLogLevel, ArrayList<String> aList) { if (mSender != null && !mSender.isDead() && mSender.mTarget == this) { final ChunkCoordinates coords = mSender.getCoords(); aList.addAll( - Arrays.asList( - "Is the Target", - "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); + Arrays.asList( + "Is the Target", + "Sender is at: X: " + coords.posX + " Y: " + coords.posY + " Z: " + coords.posZ)); } else { aList.addAll( - Arrays.asList( - checkTarget() ? "Has Target" : "Has no loaded Target", - "Target should be around: X: " + mTargetPos.posX - + " Y: " - + mTargetPos.posY - + " Z: " - + mTargetPos.posZ)); + Arrays.asList( + checkTarget() ? "Has Target" : "Has no loaded Target", + "Target should be around: X: " + mTargetPos.posX + + " Y: " + + mTargetPos.posY + + " Z: " + + mTargetPos.posZ)); } return aList; @@ -208,15 +209,15 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta if (aMetaData != getPipeMeta()) return; HashSet<ChunkCoordinates> tVisited = new HashSet<>(Collections.singletonList(getCoords())), - tWires = new HashSet<>(); + tWires = new HashSet<>(); Queue<ChunkCoordinates> tQueue = new LinkedList<>( - Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); + Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing()))); while (!tQueue.isEmpty()) { final ChunkCoordinates aCoords = tQueue.poll(); if (world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ) == aBlock - && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { + && world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ) == aMetaData) { // We've got another pipe/wire block // TODO: Make sure it's the right type of pipe/wire via meta ChunkCoordinates tCoords; @@ -240,11 +241,12 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta // It's not a block - let's see if it's a tile entity TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); if (tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase tGtTile) { + && ((BaseMetaTileEntity) tTileEntity) + .getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase tGtTile) { if (isSameClass(tGtTile) && tWires.contains( - tGtTile.getFacingOffset( - (BaseMetaTileEntity) tTileEntity, - ((BaseMetaTileEntity) tTileEntity).getFrontFacing()))) { + tGtTile.getFacingOffset( + (BaseMetaTileEntity) tTileEntity, + ((BaseMetaTileEntity) tTileEntity).getFrontFacing()))) { // If it's the same class, and we've scanned a wire in front of it (the input side), we've // found our target // still need to check if it's distant enough @@ -273,15 +275,15 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta protected int getDistanceToSelf(ChunkCoordinates aCoords) { return Math.abs(getBaseMetaTileEntity().getXCoord() - aCoords.posX) - + Math.abs(getBaseMetaTileEntity().getYCoord() - aCoords.posY) / 2 - + Math.abs(getBaseMetaTileEntity().getZCoord() - aCoords.posZ); + + Math.abs(getBaseMetaTileEntity().getYCoord() - aCoords.posY) / 2 + + Math.abs(getBaseMetaTileEntity().getZCoord() - aCoords.posZ); } public ChunkCoordinates getFacingOffset(IGregTechTileEntity gt_tile, byte aSide) { return new ChunkCoordinates( - gt_tile.getOffsetX(aSide, 1), - gt_tile.getOffsetY(aSide, 1), - gt_tile.getOffsetZ(aSide, 1)); + gt_tile.getOffsetX(aSide, 1), + gt_tile.getOffsetY(aSide, 1), + gt_tile.getOffsetZ(aSide, 1)); } public ChunkCoordinates getCoords() { @@ -308,11 +310,11 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta @Override public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { final NBTTagCompound tag = accessor.getNBTData(); final int facing = getBaseMetaTileEntity().getFrontFacing(); final int side = (byte) accessor.getSide() - .ordinal(); + .ordinal(); if (side == facing) currentTip.add(GOLD + "Pipeline Input" + RESET); else if (side == ForgeDirection.OPPOSITES[facing]) currentTip.add(BLUE + "Pipeline Output" + RESET); @@ -333,7 +335,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setBoolean("hasSender", mSender != null); diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java index 2b4f4fe377..6b95d20d5c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti } public GT_MetaTileEntity_LongDistancePipelineFluid(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -110,15 +110,15 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_FLUID_FRONT) }; + TextureFactory.of(OVERLAY_PIPELINE_FLUID_FRONT) }; else if (aSide == GT_Utility.getOppositeSide(aFacing)) return new ITexture[] { - MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_FLUID_BACK) }; + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_FLUID_BACK) }; else return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_FLUID_SIDE), TextureFactory.builder() - .addIcon(OVERLAY_PIPELINE_FLUID_SIDE_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_PIPELINE_FLUID_SIDE), TextureFactory.builder() + .addIcon(OVERLAY_PIPELINE_FLUID_SIDE_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java index 85c009b350..dc3956d2a6 100644 --- a/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java +++ b/src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java @@ -44,7 +44,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit } public GT_MetaTileEntity_LongDistancePipelineItem(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -189,15 +189,15 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_ITEM_FRONT) }; + TextureFactory.of(OVERLAY_PIPELINE_ITEM_FRONT) }; else if (aSide == GT_Utility.getOppositeSide(aFacing)) return new ITexture[] { - MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_ITEM_BACK) }; + MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPELINE_ITEM_BACK) }; else return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], - TextureFactory.of(OVERLAY_PIPELINE_ITEM_SIDE), TextureFactory.builder() - .addIcon(OVERLAY_PIPELINE_ITEM_SIDE_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_PIPELINE_ITEM_SIDE), TextureFactory.builder() + .addIcon(OVERLAY_PIPELINE_ITEM_SIDE_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java index 51c7c2eb13..01638c4427 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java @@ -7,7 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase; public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTileEntity_AbstractMultiFurnace<T>> - extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { + extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { private HeatingCoilLevel mCoilLevel; @@ -26,9 +26,9 @@ public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTi protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) - || addInputToMachineList(aTileEntity, aBaseCasingIndex) - || addOutputToMachineList(aTileEntity, aBaseCasingIndex) - || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + || addInputToMachineList(aTileEntity, aBaseCasingIndex) + || addOutputToMachineList(aTileEntity, aBaseCasingIndex) + || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 519bed3ede..9025dd1f78 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -47,183 +47,86 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; -public class GT_MetaTileEntity_AssemblyLine extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_AssemblyLine> implements ISurvivalConstructable { +public class GT_MetaTileEntity_AssemblyLine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_AssemblyLine> implements ISurvivalConstructable { public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<>(); private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_LATER = "later"; private static final String STRUCTURE_PIECE_LAST = "last"; - private static final IStructureDefinition<GT_MetaTileEntity_AssemblyLine> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_AssemblyLine>builder() - .addShape( - STRUCTURE_PIECE_FIRST, - transpose( - new String[][] { - { " ", "e", - " " }, - { "~", "l", - "G" }, - { "g", "m", - "g" }, - { "b", "i", - "b" }, })) - .addShape( - STRUCTURE_PIECE_LATER, - transpose( - new String[][] { - { " ", "e", - " " }, - { "d", "l", - "d" }, - { "g", "m", - "g" }, - { "b", "I", - "b" }, })) - .addShape( - STRUCTURE_PIECE_LAST, - transpose( - new String[][] { - { " ", "e", - " " }, - { "d", "l", - "d" }, - { "g", "m", - "g" }, - { "o", "i", - "b" }, })) - .addElement( - 'G', - ofBlock( - GregTech_API.sBlockCasings3, - 10)) // grate - // machine - // casing - .addElement( - 'l', - ofBlock( - GregTech_API.sBlockCasings2, - 9)) // assembler - // machine - // casing - .addElement( - 'm', - ofBlock( - GregTech_API.sBlockCasings2, - 5)) // assembling - // line - // casing - .addElement( - 'g', - ofChain( - ofBlockUnlocalizedName( - IndustrialCraft2.ID, - "blockAlloyGlass", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks2", - 0, - true), - // warded - // glass - ofBlockUnlocalizedName( - Thaumcraft.ID, - "blockCosmeticOpaque", - 2, - false))) - .addElement( - 'e', - ofChain( - Energy.newAny( - 16, - 1, - ForgeDirection.UP, - ForgeDirection.NORTH, - ForgeDirection.SOUTH), - ofBlock( - GregTech_API.sBlockCasings2, - 0))) - .addElement( - 'd', - buildHatchAdder( - GT_MetaTileEntity_AssemblyLine.class).atLeast( - DataHatchElement.DataAccess) - .dot( - 2) - .casingIndex( - 42) - .allowOnly( - ForgeDirection.NORTH) - .buildAndChain( - GregTech_API.sBlockCasings3, - 10)) - .addElement( - 'b', - buildHatchAdder( - GT_MetaTileEntity_AssemblyLine.class).atLeast( - InputHatch, - InputHatch, - InputHatch, - InputHatch, - Maintenance) - .casingIndex( - 16) - .dot( - 3) - .allowOnly( - ForgeDirection.DOWN) - .buildAndChain( - ofBlock( - GregTech_API.sBlockCasings2, - 0), - ofHatchAdder( - GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, - 16, - 4))) - .addElement( - 'I', - ofChain( - // all - // blocks - // nearby - // use - // solid - // steel - // casing, - // so - // let's - // use - // the - // texture - // of - // that - InputBus.newAny( - 16, - 5, - ForgeDirection.DOWN), - ofHatchAdder( - GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, - 16, - 4))) - .addElement( - 'i', - InputBus.newAny( - 16, - 5, - ForgeDirection.DOWN)) - .addElement( - 'o', - OutputBus.newAny( - 16, - 4, - ForgeDirection.DOWN)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_AssemblyLine> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_AssemblyLine>builder() + .addShape( + STRUCTURE_PIECE_FIRST, + transpose(new String[][] { { " ", "e", " " }, { "~", "l", "G" }, { "g", "m", "g" }, { "b", "i", "b" }, })) + .addShape( + STRUCTURE_PIECE_LATER, + transpose(new String[][] { { " ", "e", " " }, { "d", "l", "d" }, { "g", "m", "g" }, { "b", "I", "b" }, })) + .addShape( + STRUCTURE_PIECE_LAST, + transpose(new String[][] { { " ", "e", " " }, { "d", "l", "d" }, { "g", "m", "g" }, { "o", "i", "b" }, })) + .addElement('G', ofBlock(GregTech_API.sBlockCasings3, 10)) // grate + // machine + // casing + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 9)) // assembler + // machine + // casing + .addElement('m', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling + // line + // casing + .addElement( + 'g', + ofChain( + ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true), + // warded + // glass + ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false))) + .addElement( + 'e', + ofChain( + Energy.newAny(16, 1, ForgeDirection.UP, ForgeDirection.NORTH, ForgeDirection.SOUTH), + ofBlock(GregTech_API.sBlockCasings2, 0))) + .addElement( + 'd', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class).atLeast(DataHatchElement.DataAccess) + .dot(2) + .casingIndex(42) + .allowOnly(ForgeDirection.NORTH) + .buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_AssemblyLine.class) + .atLeast(InputHatch, InputHatch, InputHatch, InputHatch, Maintenance) + .casingIndex(16) + .dot(3) + .allowOnly(ForgeDirection.DOWN) + .buildAndChain( + ofBlock(GregTech_API.sBlockCasings2, 0), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement( + 'I', + ofChain( + // all + // blocks + // nearby + // use + // solid + // steel + // casing, + // so + // let's + // use + // the + // texture + // of + // that + InputBus.newAny(16, 5, ForgeDirection.DOWN), + ofHatchAdder(GT_MetaTileEntity_AssemblyLine::addOutputToMachineList, 16, 4))) + .addElement('i', InputBus.newAny(16, 5, ForgeDirection.DOWN)) + .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN)) + .build(); public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -242,54 +145,52 @@ public class GT_MetaTileEntity_AssemblyLine extends protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Assembling Line") - .addInfo("Controller block for the Assembling Line") - .addInfo("Used to make complex machine parts (LuV+)") - .addInfo("Does not make Assembler items") - .addSeparator() - .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) // ? - .addStructureInfo("From Bottom to Top, Left to Right") - .addStructureInfo( - "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") - .addStructureInfo( - "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") - .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") - .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") - .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") - .addController("Either Grate on layer 3 of the first slice") - .addEnergyHatch("Any layer 4 casing", 1) - .addMaintenanceHatch("Any layer 1 casing", 3) - .addInputBus("As specified on layer 1", 4, 5) - .addInputHatch("Any layer 1 casing", 3) - .addOutputBus("Replaces Input Bus on final slice or on any solid steel casing on layer 1", 4) - .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Assembling Line") + .addInfo("Used to make complex machine parts (LuV+)") + .addInfo("Does not make Assembler items") + .addSeparator() + .beginVariableStructureBlock(5, 16, 4, 4, 3, 3, false) // ? + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo( + "Layer 1 - Solid Steel Machine Casing, Input Bus (last can be Output Bus), Solid Steel Machine Casing") + .addStructureInfo( + "Layer 2 - Borosilicate Glass(any)/Warded Glass/Reinforced Glass, Assembling Line Casing, Reinforced Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing, Assembler Machine Casing, Grate Machine Casing") + .addStructureInfo("Layer 4 - Empty, Solid Steel Machine Casing, Empty") + .addStructureInfo("Up to 16 repeating slices, each one allows for 1 more item in recipes") + .addController("Either Grate on layer 3 of the first slice") + .addEnergyHatch("Any layer 4 casing", 1) + .addMaintenanceHatch("Any layer 1 casing", 3) + .addInputBus("As specified on layer 1", 4, 5) + .addInputHatch("Any layer 1 casing", 3) + .addOutputBus("Replaces Input Bus on final slice or on any solid steel casing on layer 1", 4) + .addOtherStructurePart("Data Access Hatch", "Optional, next to controller", 2) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.casingTexturePages[0][16], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.casingTexturePages[0][16], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ASSEMBLY_LINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][16] }; } @@ -323,9 +224,8 @@ public class GT_MetaTileEntity_AssemblyLine extends boolean foundRecipe = false; nextDataStick: for (ItemStack tDataStick : tDataStickList) { - GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick( - tDataStick, - false); + GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils + .findAssemblyLineRecipeFromDataStick(tDataStick, false); if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) continue; @@ -347,11 +247,11 @@ public class GT_MetaTileEntity_AssemblyLine extends if (mInputBusses.size() < tRecipe.mInputs.length || mInputHatches.size() < tRecipe.mFluidInputs.length) { if (GT_Values.D1) { GT_FML_LOGGER.info( - "Not enough sources: Need ({}, {}), has ({}, {})", - mInputBusses.size(), - tRecipe.mInputs.length, - mInputHatches.size(), - tRecipe.mFluidInputs.length); + "Not enough sources: Need ({}, {}), has ({}, {})", + mInputBusses.size(), + tRecipe.mInputs.length, + mInputHatches.size(), + tRecipe.mFluidInputs.length); } continue; } @@ -384,8 +284,7 @@ public class GT_MetaTileEntity_AssemblyLine extends } else { if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput tMultiHatch) { if (!tMultiHatch.hasFluid(tRecipe.mFluidInputs[i]) - || tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i]) - < tRecipe.mFluidInputs[i].amount) { + || tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i]) < tRecipe.mFluidInputs[i].amount) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; @@ -393,7 +292,7 @@ public class GT_MetaTileEntity_AssemblyLine extends } else { FluidStack fluidInHatch = mInputHatches.get(i).mFluid; if (!GT_Utility.areFluidsEqual(fluidInHatch, tRecipe.mFluidInputs[i], true) - || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { + || fluidInHatch.amount < tRecipe.mFluidInputs[i].amount) { continue nextDataStick; } tFluids[i] = tRecipe.mFluidInputs[i].amount; @@ -433,7 +332,7 @@ public class GT_MetaTileEntity_AssemblyLine extends } for (int i = 0; i < tStack.length; i++) { ItemStack stackInSlot = mInputBusses.get(i) - .getStackInSlot(0); + .getStackInSlot(0); stackInSlot.stackSize -= tStack[i]; } @@ -535,17 +434,15 @@ public class GT_MetaTileEntity_AssemblyLine extends for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) { if (isValidMetaTileEntity(tHatch)) { for (int i = 0; i < tHatch.getBaseMetaTileEntity() - .getSizeInventory(); i++) { + .getSizeInventory(); i++) { if (tHatch.getBaseMetaTileEntity() - .getStackInSlot(i) - != null - && isCorrectDataItem( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i), - state)) + .getStackInSlot(i) != null && isCorrectDataItem( + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i), + state)) rList.add( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i)); + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i)); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java index 96b4c19b93..b650619966 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -18,17 +18,16 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace - implements ISecondaryDescribable { + implements ISecondaryDescribable { private static final ITexture[] FACING_SIDE = { TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS) }; private static final ITexture[] FACING_FRONT = { - TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE) }; - private static final ITexture[] FACING_ACTIVE = { TextureFactory.of( - Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE) }; + private static final ITexture[] FACING_ACTIVE = { + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE), TextureFactory.builder() + .addIcon(BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE_GLOW) + .glow() + .build() }; private GT_Multiblock_Tooltip_Builder tooltipBuilder; public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { @@ -61,25 +60,25 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri if (tooltipBuilder == null) { tooltipBuilder = new GT_Multiblock_Tooltip_Builder(); tooltipBuilder.addMachineType("Blast Furnace") - .addInfo("Controller Block for the Bricked Blast Furnace") - .addInfo("Usable for Steel and general Pyrometallurgy") - .addInfo("Has a useful interface, unlike other gregtech multis") - .addPollutionAmount(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front center") - .addOtherStructurePart("Firebricks", "Everything except the controller") - .addStructureInfo("The top block is also empty") - .addStructureInfo("You can share the walls of GT multis, so") - .addStructureInfo("each additional one costs less, up to 4") - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Bricked Blast Furnace") + .addInfo("Usable for Steel and general Pyrometallurgy") + .addInfo("Has a useful interface, unlike other gregtech multis") + .addPollutionAmount(GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front center") + .addOtherStructurePart("Firebricks", "Everything except the controller") + .addStructureInfo("The top block is also empty") + .addStructureInfo("You can share the walls of GT multis, so") + .addStructureInfo("each additional one costs less, up to 4") + .toolTipFinisher("Gregtech"); } return tooltipBuilder; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 1710b33513..2341f6a046 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -20,10 +20,10 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim private static final ITexture[] FACING_SIDE = { TextureFactory.of(MACHINE_BRONZEPLATEDBRICKS) }; private static final ITexture[] FACING_FRONT = { TextureFactory.of(MACHINE_BRONZEBLASTFURNACE) }; private static final ITexture[] FACING_ACTIVE = { TextureFactory.of(MACHINE_BRONZEBLASTFURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW) + .glow() + .build() }; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java index 8780bdb038..9e1912ca51 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java @@ -33,7 +33,7 @@ import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.common.GT_Pollution; public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase - implements ISecondaryDescribable { + implements ISecondaryDescribable { private boolean running = false; @@ -110,16 +110,16 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if (running) { for (ChunkPosition tPos : tList1) { if (isWoodLog( - getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), - getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) + getBaseMetaTileEntity().getBlockOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ), + getBaseMetaTileEntity().getMetaIDOffset(tPos.chunkPosX, tPos.chunkPosY, tPos.chunkPosZ))) getBaseMetaTileEntity().getWorld() - .setBlock( - getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, - getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, - getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, - GregTech_API.sBlockReinforced, - 4, - 3); + .setBlock( + getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX, + getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY, + getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ, + GregTech_API.sBlockReinforced, + 4, + 3); } running = false; return false; @@ -133,16 +133,15 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul private boolean isWoodLog(Block log, int meta) { for (int id : OreDictionary.getOreIDs(new ItemStack(log, 1, meta))) { if (OreDictionary.getOreName(id) - .equals("logWood")) - return true; + .equals("logWood")) return true; } String tTool = log.getHarvestTool(meta); return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool)) - && (log.getMaterial() == Material.wood); + && (log.getMaterial() == Material.wood); } private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, - ArrayList<? super ChunkPosition> aList2) { + ArrayList<? super ChunkPosition> aList2) { boolean expandToChunkXPos = false; boolean expandToChunkXNeg = false; boolean expandToChunkYPos = false; @@ -153,8 +152,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockXPos = getBaseMetaTileEntity().getBlockOffset(aX + 1, aY, aZ); if (aX + 1 < 6 && (isWoodLog(blockXPos, getBaseMetaTileEntity().getMetaIDOffset(aX + 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX + 1, aY, aZ)) - && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) - expandToChunkXPos = true; + && (!aList2.contains(new ChunkPosition(aX + 1, aY, aZ)))) expandToChunkXPos = true; } else if (!(blockXPos == Blocks.dirt || blockXPos == Blocks.grass)) { return false; } @@ -162,8 +160,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockXNeg = getBaseMetaTileEntity().getBlockOffset(aX - 1, aY, aZ); if (aX - 1 > -6 && (isWoodLog(blockXNeg, getBaseMetaTileEntity().getMetaIDOffset(aX - 1, aY, aZ)))) { if (!aList1.contains(new ChunkPosition(aX - 1, aY, aZ)) - && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) - expandToChunkXNeg = true; + && (!aList2.contains(new ChunkPosition(aX - 1, aY, aZ)))) expandToChunkXNeg = true; } else if (!(blockXNeg == Blocks.dirt || blockXNeg == Blocks.grass)) { return false; } @@ -171,18 +168,16 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockYPos = getBaseMetaTileEntity().getBlockOffset(aX, aY + 1, aZ); if (aY + 1 < 1 && (isWoodLog(blockYPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY + 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY + 1, aZ)) - && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) - expandToChunkYPos = true; + && (!aList2.contains(new ChunkPosition(aX, aY + 1, aZ)))) expandToChunkYPos = true; } else if (!(blockYPos == Blocks.dirt || blockYPos == Blocks.grass - || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { - return false; - } + || (aX == 0 && aY == -1 && aZ == 0 && blockYPos == GregTech_API.sBlockMachines))) { + return false; + } Block blockYNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY - 1, aZ); if (aY - 1 > -6 && (isWoodLog(blockYNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY - 1, aZ)))) { if (!aList1.contains(new ChunkPosition(aX, aY - 1, aZ)) - && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) - expandToChunkYNeg = true; + && (!aList2.contains(new ChunkPosition(aX, aY - 1, aZ)))) expandToChunkYNeg = true; } else if (blockYNeg != Blocks.brick_block) { return false; } @@ -190,8 +185,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockZPos = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ + 1); if (aZ + 1 < 6 && (isWoodLog(blockZPos, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ + 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ + 1)) - && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) - expandToChunkZPos = true; + && (!aList2.contains(new ChunkPosition(aX, aY, aZ + 1)))) expandToChunkZPos = true; } else if (!(blockZPos == Blocks.dirt || blockZPos == Blocks.grass)) { return false; } @@ -199,8 +193,7 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul Block blockZNeg = getBaseMetaTileEntity().getBlockOffset(aX, aY, aZ - 1); if (aZ - 1 > -6 && (isWoodLog(blockZNeg, getBaseMetaTileEntity().getMetaIDOffset(aX, aY, aZ - 1)))) { if (!aList1.contains(new ChunkPosition(aX, aY, aZ - 1)) - && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) - expandToChunkZNeg = true; + && (!aList2.contains(new ChunkPosition(aX, aY, aZ - 1)))) expandToChunkZNeg = true; } else if (!(blockZNeg == Blocks.dirt || blockZNeg == Blocks.grass)) { return false; } @@ -258,36 +251,35 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Charcoal Pile Igniter") - .addInfo("Controller for the Charcoal Pit") - .addInfo("Converts Logs into Brittle Charcoal blocks") - .addInfo("Will automatically start when valid") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) - .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") - .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") - .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") - .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") - .addStructureInfo("No air between logs allowed") - .toolTipFinisher("Gregtech"); + .addInfo("Controller for the Charcoal Pit") + .addInfo("Converts Logs into Brittle Charcoal blocks") + .addInfo("Will automatically start when valid") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginVariableStructureBlock(3, 11, 3, 6, 3, 11, false) + .addStructureInfo("Can be up to 11x6x11 in size, shape doesn't matter") + .addOtherStructurePart("Bricks", "Bottom layer, under all wood logs") + .addOtherStructurePart("Dirt/Grass", "All logs must be covered by these, the controller, or bricks") + .addOtherStructurePart("Wood Logs", "Inside the previously mentioned blocks") + .addStructureInfo("No air between logs allowed") + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == 1) { - if (aActive) - return new ITexture[] { casingTexturePages[0][10], TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) - .glow() - .build() }; + if (aActive) return new ITexture[] { casingTexturePages[0][10], + TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_ACTIVE_GLOW) + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][10], TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) - .glow() - .build(), }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW) + .glow() + .build(), }; } return new ITexture[] { casingTexturePages[0][10] }; } @@ -305,15 +297,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0D, 0.3D, 0D) - .setIdentifier(ParticleFX.LARGE_SMOKE) - .setPosition( - aBaseMetaTileEntity.getOffsetX((byte) 1, 1) - + XSTR_INSTANCE.nextFloat(), - aBaseMetaTileEntity.getOffsetY((byte) 1, 1), - aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) - + XSTR_INSTANCE.nextFloat()) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setIdentifier(ParticleFX.LARGE_SMOKE) + .setPosition( + aBaseMetaTileEntity.getOffsetX((byte) 1, 1) + XSTR_INSTANCE.nextFloat(), + aBaseMetaTileEntity.getOffsetY((byte) 1, 1), + aBaseMetaTileEntity.getOffsetZ((byte) 1, 1) + XSTR_INSTANCE.nextFloat()) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 0d18ce040b..76b867bcbf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -33,7 +33,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase - implements IConstructable, ISecondaryDescribable { + implements IConstructable, ISecondaryDescribable { private int mHeight = -1; @@ -54,29 +54,29 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Cleanroom") - .addInfo("Controller block for the Cleanroom") - .addInfo("Consumes 40 EU/t when first turned on") - .addInfo("and 4 EU/t once at 100% efficiency when not overclocked") // ? - .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") - .addInfo("2 LV batteries + 1 LV generator or 1 MV generator") // ? - .addInfo("Time required to reach full efficiency is proportional to") - .addInfo("the height of empty space within") - .addInfo("Make sure your Energy Hatch matches! ?") - .addInfo("Machines that cause pollution aren't allowed to be put in.") - .addSeparator() - .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) - .addController("Top center") - .addCasingInfoRange("Plascrete", 20, 1007, false) - .addStructureInfo(GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check - .addStructureInfo("Other material can be used in place of Plascrete. See config for detail") // check - .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") - .addEnergyHatch("Any casing. Exactly one.") // check - .addMaintenanceHatch("Any casing") - .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") - .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") - .addStructureInfo("You can also use Diodes for more power") - .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Cleanroom") + .addInfo("Consumes 40 EU/t when first turned on") + .addInfo("and 4 EU/t once at 100% efficiency when not overclocked") // ? + .addInfo("An energy hatch accepts up to 2A, so you can use 2A LV or 1A MV") + .addInfo("2 LV batteries + 1 LV generator or 1 MV generator") // ? + .addInfo("Time required to reach full efficiency is proportional to") + .addInfo("the height of empty space within") + .addInfo("Make sure your Energy Hatch matches! ?") + .addInfo("Machines that cause pollution aren't allowed to be put in.") + .addSeparator() + .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) + .addController("Top center") + .addCasingInfoRange("Plascrete", 20, 1007, false) + .addStructureInfo(GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check + .addStructureInfo("Other material can be used in place of Plascrete. See config for detail") // check + .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") + .addEnergyHatch("Any casing. Exactly one.") // check + .addMaintenanceHatch("Any casing") + .addStructureInfo("1x Reinforced Door (keep closed or efficiency will reduce)") + .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") + .addStructureInfo("You can also use Diodes for more power") + .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") + .toolTipFinisher("Gregtech"); return tt; } @@ -190,7 +190,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { if (debugCleanroom) { GT_Log.out.println( - "Cleanroom: Non reinforced block on top face interior? tMeta != 11"); + "Cleanroom: Non reinforced block on top face interior? tMeta != 11"); } return false; } @@ -198,12 +198,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { mPlascreteCount++; } else { - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset( - dX, - dY, - dZ); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(dX, dY, dZ); if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) - && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { + && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { // let's not fiddle with bits anymore. @@ -228,8 +226,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } else { if (debugCleanroom) { GT_Log.out.println( - "Cleanroom: Incorrect GT block? " - + tBlock.getUnlocalizedName()); + "Cleanroom: Incorrect GT block? " + tBlock.getUnlocalizedName()); } return false; } @@ -243,7 +240,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); } else { if (debugCleanroom) GT_Log.out.println( - "Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); + "Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); return false; } } @@ -256,8 +253,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB } } if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 - || mDoorCount > 4 - || mHullCount > 10) { + || mDoorCount > 4 + || mHullCount > 10) { return false; } if (mPlascreteCount < 20) return false; @@ -310,8 +307,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB @SuppressWarnings("unchecked") private void checkAndSetCallback(IMachineCallback<?> iMachineCallback) { if (debugCleanroom) GT_Log.out.println( - "Cleanroom: IMachineCallback detected, checking for cleanroom: " - + (iMachineCallback.getType() == this.getClass())); + "Cleanroom: IMachineCallback detected, checking for cleanroom: " + + (iMachineCallback.getType() == this.getClass())); if (iMachineCallback.getType() == this.getClass()) ((IMachineCallback<GT_MetaTileEntity_Cleanroom>) iMachineCallback).setCallbackBase(this); } @@ -323,21 +320,21 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == ForgeDirection.DOWN.ordinal() || aSide == ForgeDirection.UP.ordinal()) { return new ITexture[] { TextureFactory.of(BLOCK_PLASCRETE), aActive - ? TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW) - .glow() - .build()) - : TextureFactory.of( - TextureFactory.of(OVERLAY_TOP_CLEANROOM), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_CLEANROOM_GLOW) - .glow() - .build()) }; + ? TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM_ACTIVE), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW) + .glow() + .build()) + : TextureFactory.of( + TextureFactory.of(OVERLAY_TOP_CLEANROOM), + TextureFactory.builder() + .addIcon(OVERLAY_TOP_CLEANROOM_GLOW) + .glow() + .build()) }; } return new ITexture[] { TextureFactory.of(BLOCK_PLASCRETE) }; } @@ -426,45 +423,45 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB public static void loadConfig(Configuration cfg) { if (!cfg.hasCategory(category)) setDefaultConfigValues(cfg); for (ConfigCategory cc : cfg.getCategory(category) - .getChildren()) { + .getChildren()) { final String name = cc.get("Name") - .getString(); + .getString(); if (cc.containsKey("Count")) { if (cc.containsKey("Meta")) config.put( - name + ":" - + cc.get("Meta") - .getInt(), - new ConfigEntry( - 0, - cc.get("Count") - .getInt(), - cc.get("Meta") - .getInt())); + name + ":" + + cc.get("Meta") + .getInt(), + new ConfigEntry( + 0, + cc.get("Count") + .getInt(), + cc.get("Meta") + .getInt())); else config.put( - name, - new ConfigEntry( - 0, - cc.get("Count") - .getInt(), - wildcard_meta)); + name, + new ConfigEntry( + 0, + cc.get("Count") + .getInt(), + wildcard_meta)); } else if (cc.containsKey("Percentage")) { if (cc.containsKey("Meta")) config.put( - name + ":" - + cc.get("Meta") - .getInt(), - new ConfigEntry( - cc.get("Percentage") - .getInt(), - 0, - cc.get("Meta") - .getInt())); + name + ":" + + cc.get("Meta") + .getInt(), + new ConfigEntry( + cc.get("Percentage") + .getInt(), + 0, + cc.get("Meta") + .getInt())); else config.put( - name, - new ConfigEntry( - cc.get("Percentage") - .getInt(), - 0, - wildcard_meta)); + name, + new ConfigEntry( + cc.get("Percentage") + .getInt(), + 0, + wildcard_meta)); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java index 2b902349bc..869d96f2c4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java @@ -30,27 +30,27 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi protected GT_Multiblock_Tooltip_Builder createTooltip(String aStructureName) { String casings = getCasingBlockItem().get(0) - .getDisplayName(); + .getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Concrete Backfiller") - .addInfo("Controller Block for the " + aStructureName) - .addInfo("Will fill in areas below it with light concrete. This goes through walls") - .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") - .addInfo("Will pull back the pipes after it finishes that layer") - .addInfo("Radius is " + getRadius() + " blocks") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes, optional, any base casing", 1) - .addInputHatch("GT Concrete, any base casing", 1) - .addOutputBus("Mining Pipes, optional, any base casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the " + aStructureName) + .addInfo("Will fill in areas below it with light concrete. This goes through walls") + .addInfo("Use it to remove any spawning locations beneath your base to reduce lag") + .addInfo("Will pull back the pipes after it finishes that layer") + .addInfo("Radius is " + getRadius() + " blocks") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("GT Concrete, any base casing", 1) + .addOutputBus("Mining Pipes, optional, any base casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @@ -78,7 +78,7 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (isRefillableBlock(xPipe, yHead - 1, zPipe)) return tryRefillBlock(xPipe, yHead - 1, zPipe); int radius = getRadius(); if (mLastXOff == 0 && mLastZOff == 0) { @@ -111,19 +111,12 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi private boolean isRefillableBlock(int aX, int aY, int aZ) { IGregTechTileEntity aBaseTile = getBaseMetaTileEntity(); if (!aBaseTile.getBlock(aX, aY, aZ) - .isAir(aBaseTile.getWorld(), aX, aY, aZ) - || aBaseTile.getBlock(aX, aY, aZ) - .getMaterial() - .isSolid()) + .isAir(aBaseTile.getWorld(), aX, aY, aZ) || aBaseTile.getBlock(aX, aY, aZ) + .getMaterial() + .isSolid()) return false; - if (!GT_Utility.setBlockByFakePlayer( - getFakePlayer(aBaseTile), - aX, - aY, - aZ, - GregTech_API.sBlockConcretes, - 8, - true)) + if (!GT_Utility + .setBlockByFakePlayer(getFakePlayer(aBaseTile), aX, aY, aZ, GregTech_API.sBlockConcretes, 8, true)) return false; return true; } @@ -131,7 +124,7 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi private boolean tryRefillBlock(int aX, int aY, int aZ) { if (!tryConsumeFluid()) return false; getBaseMetaTileEntity().getWorld() - .setBlock(aX, aY, aZ, GregTech_API.sBlockConcretes, 8, 3); + .setBlock(aX, aY, aZ, GregTech_API.sBlockConcretes, 8, 3); return true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java index 7e6ff95da1..069afffacf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java @@ -42,8 +42,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_DieselEngine extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DieselEngine> implements ISurvivalConstructable { +public class GT_MetaTileEntity_DieselEngine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DieselEngine> implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>> STRUCTURE_DEFINITION = new ClassValue<>() { @@ -51,33 +51,24 @@ public class GT_MetaTileEntity_DieselEngine extends @Override protected IStructureDefinition<GT_MetaTileEntity_DieselEngine> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_DieselEngine>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "---", "iii", "chc", "chc", "ccc", }, - { "---", "i~i", "hgh", "hgh", "cdc", }, - { "---", "iii", "chc", "chc", "ccc", }, })) - .addElement('i', lazy(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('g', lazy(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) - .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 2))) - .addElement( - 'h', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_DieselEngine.class).atLeast( - InputHatch, - InputHatch, - InputHatch, - Muffler, - Maintenance) - .casingIndex( - t.getCasingTextureIndex()) - .dot(1) - .buildAndChain( - t.getCasingBlock(), - t.getCasingMeta()))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "---", "iii", "chc", "chc", "ccc", }, { "---", "i~i", "hgh", "hgh", "cdc", }, + { "---", "iii", "chc", "chc", "ccc", }, })) + .addElement('i', lazy(t -> ofBlock(t.getIntakeBlock(), t.getIntakeMeta()))) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('g', lazy(t -> ofBlock(t.getGearboxBlock(), t.getGearboxMeta()))) + .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 2))) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_DieselEngine.class) + .atLeast(InputHatch, InputHatch, InputHatch, Muffler, Maintenance) + .casingIndex(t.getCasingTextureIndex()) + .dot(1) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .build(); } }; protected int fuelConsumption = 0; @@ -97,53 +88,52 @@ public class GT_MetaTileEntity_DieselEngine extends protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Combustion Generator") - .addInfo("Controller block for the Large Combustion Engine") - .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") - .addInfo("Supply 40L/s of Oxygen to boost output (optional)") - .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") - .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") - .addInfo("You need to wait for it to reach 300% to output full power") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, false) - .addController("Front center") - .addCasingInfoRange("Stable Titanium Machine Casing", 16, 22, false) - .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") - .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") - .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center", 2) - .addMaintenanceHatch("One of the casings next to a Gear Box", 1) - .addMufflerHatch("Top middle back, above the rear Gear Box", 1) - .addInputHatch("Diesel Fuel, next to a Gear Box", 1) - .addInputHatch("Lubricant, next to a Gear Box", 1) - .addInputHatch("Oxygen, optional, next to a Gear Box", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large Combustion Engine") + .addInfo("Supply Diesel Fuels and 1000L of Lubricant per hour to run") + .addInfo("Supply 40L/s of Oxygen to boost output (optional)") + .addInfo("Default: Produces 2048EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 6144EU/t at 150% fuel efficiency") + .addInfo("You need to wait for it to reach 300% to output full power") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfoRange("Stable Titanium Machine Casing", 16, 22, false) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center", 2) + .addMaintenanceHatch("One of the casings next to a Gear Box", 1) + .addMufflerHatch("Top middle back, above the rear Gear Box", 1) + .addInputHatch("Diesel Fuel, next to a Gear Box", 1) + .addInputHatch("Lubricant, next to a Gear Box", 1) + .addInputHatch("Oxygen, optional, next to a Gear Box", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][50], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][50], TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DIESEL_ENGINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DIESEL_ENGINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][50] }; } @@ -238,7 +228,7 @@ public class GT_MetaTileEntity_DieselEngine extends // Deplete Lubricant. 1000L should = 1 hour of runtime (if baseEU = 2048) if ((mRuntime % 72 == 0 || mRuntime == 0) - && !depleteInput(Materials.Lubricant.getFluid((boostEu ? 2L : 1L) * getAdditiveFactor()))) + && !depleteInput(Materials.Lubricant.getFluid((boostEu ? 2L : 1L) * getAdditiveFactor()))) return false; fuelRemaining = tFluid.amount; // Record available fuel @@ -262,7 +252,7 @@ public class GT_MetaTileEntity_DieselEngine extends @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 1) && !mMufflerHatches.isEmpty() - && mMaintenanceHatches.size() == 1; + && mMaintenanceHatches.size() == 1; } public Block getCasingBlock() { @@ -295,9 +285,9 @@ public class GT_MetaTileEntity_DieselEngine extends private boolean addToMachineList(IGregTechTileEntity tTileEntity) { return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) - || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) - || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) - || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); + || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) + || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) + || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex()))); } @Override @@ -349,57 +339,57 @@ public class GT_MetaTileEntity_DieselEngine extends for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } return new String[] { EnumChatFormatting.BLUE + "Diesel Engine" + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.engine.output") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers((mEUt * mEfficiency / 10000)) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.engine.consumption") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(fuelConsumption) - + EnumChatFormatting.RESET - + " L/t", - StatCollector.translateToLocal("GT5U.engine.value") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(fuelValue) - + EnumChatFormatting.RESET - + " EU/L", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(fuelRemaining) - + EnumChatFormatting.RESET - + " L", - StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) - + EnumChatFormatting.YELLOW - + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" }; + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.engine.output") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers((mEUt * mEfficiency / 10000)) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelConsumption) + + EnumChatFormatting.RESET + + " L/t", + StatCollector.translateToLocal("GT5U.engine.value") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelValue) + + EnumChatFormatting.RESET + + " EU/L", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(fuelRemaining) + + EnumChatFormatting.RESET + + " L", + StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.YELLOW + + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index 716634998f..2d7fcdda22 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -41,9 +41,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_DistillationTower - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DistillationTower> - implements ISurvivalConstructable { +public class GT_MetaTileEntity_DistillationTower extends + GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DistillationTower> implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; @@ -53,104 +52,62 @@ public class GT_MetaTileEntity_DistillationTower private static final IStructureDefinition<GT_MetaTileEntity_DistillationTower> STRUCTURE_DEFINITION; static { - IHatchElement<GT_MetaTileEntity_DistillationTower> layeredOutputHatch = OutputHatch.withCount( - GT_MetaTileEntity_DistillationTower::getCurrentLayerOutputHatchCount) - .withAdder( - GT_MetaTileEntity_DistillationTower::addLayerOutputHatch); + IHatchElement<GT_MetaTileEntity_DistillationTower> layeredOutputHatch = OutputHatch + .withCount(GT_MetaTileEntity_DistillationTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_DistillationTower>builder() - .addShape( - STRUCTURE_PIECE_BASE, - transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) - .addShape( - STRUCTURE_PIECE_LAYER, - transpose(new String[][] { { "lll", "lcl", "lll" }, })) - .addShape( - STRUCTURE_PIECE_LAYER_HINT, - transpose(new String[][] { { "lll", "l-l", "lll" }, })) - .addShape( - STRUCTURE_PIECE_TOP_HINT, - transpose(new String[][] { { "LLL", "LLL", "LLL" }, })) - .addElement( - 'b', - ofChain( - buildHatchAdder( - GT_MetaTileEntity_DistillationTower.class).atLeast( - Energy, - OutputBus, - InputHatch, - InputBus, - Maintenance) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .build(), - onElementPass( - GT_MetaTileEntity_DistillationTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - .addElement( - 'l', - ofChain( - buildHatchAdder( - GT_MetaTileEntity_DistillationTower.class).atLeast( - layeredOutputHatch) - .casingIndex( - CASING_INDEX) - .dot( - 2) - .disallowOnly( - ForgeDirection.UP, - ForgeDirection.DOWN) - .build(), - ofHatchAdder( - GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, - CASING_INDEX, - 2), - ofHatchAdder( - GT_MetaTileEntity_DistillationTower::addLayerOutputHatch, - CASING_INDEX, - 2), - ofHatchAdder( - GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, - CASING_INDEX, - 2), - onElementPass( - GT_MetaTileEntity_DistillationTower::onCasingFound, - ofBlock(GregTech_API.sBlockCasings4, 1)))) - // hint element only used in top layer - .addElement( - 'L', - buildHatchAdder( - GT_MetaTileEntity_DistillationTower.class).atLeast( - layeredOutputHatch) - .casingIndex( - CASING_INDEX) - .dot(2) - .disallowOnly( - ForgeDirection.UP) - .buildAndChain( - GregTech_API.sBlockCasings4, - 1)) - .addElement( - 'c', - ofChain( - onElementPass( - t -> t.onTopLayerFound(false), - ofHatchAdder( - GT_MetaTileEntity_DistillationTower::addOutputToMachineList, - CASING_INDEX, - 3)), - onElementPass( - t -> t.onTopLayerFound(false), - ofHatchAdder( - GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, - CASING_INDEX, - 3)), - onElementPass( - t -> t.onTopLayerFound(true), - ofBlock(GregTech_API.sBlockCasings4, 1)), - isAir())) - .build(); + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" }, })) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" }, })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "LLL", "LLL", "LLL" }, })) + .addElement( + 'b', + ofChain( + buildHatchAdder(GT_MetaTileEntity_DistillationTower.class) + .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .build(), + onElementPass( + GT_MetaTileEntity_DistillationTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'l', + ofChain( + buildHatchAdder(GT_MetaTileEntity_DistillationTower.class).atLeast(layeredOutputHatch) + .casingIndex(CASING_INDEX) + .dot(2) + .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) + .build(), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addEnergyInputToMachineList, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addLayerOutputHatch, CASING_INDEX, 2), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, CASING_INDEX, 2), + onElementPass( + GT_MetaTileEntity_DistillationTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + // hint element only used in top layer + .addElement( + 'L', + buildHatchAdder(GT_MetaTileEntity_DistillationTower.class).atLeast(layeredOutputHatch) + .casingIndex(CASING_INDEX) + .dot(2) + .disallowOnly(ForgeDirection.UP) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'c', + ofChain( + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder(GT_MetaTileEntity_DistillationTower::addOutputToMachineList, CASING_INDEX, 3)), + onElementPass( + t -> t.onTopLayerFound(false), + ofHatchAdder( + GT_MetaTileEntity_DistillationTower::addMaintenanceToMachineList, + CASING_INDEX, + 3)), + onElementPass(t -> t.onTopLayerFound(true), ofBlock(GregTech_API.sBlockCasings4, 1)), + isAir())) + .build(); } protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>(); @@ -175,46 +132,45 @@ public class GT_MetaTileEntity_DistillationTower protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Distillery") - .addInfo("Controller block for the Distillation Tower") - .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) - .addController("Front bottom") - .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") - .addEnergyHatch("Any casing", 1, 2) - .addMaintenanceHatch("Any casing", 1, 2, 3) - .addInputHatch("Any bottom layer casing", 1) - .addOutputBus("Any bottom layer casing", 1) - .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)", 2, 3) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Distillation Tower") + .addInfo("Fluids are only put out at the correct height") + .addInfo("The correct height equals the slot number in the NEI recipe") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 12, 3, 3, true) + .addController("Front bottom") + .addOtherStructurePart("Clean Stainless Steel Machine Casing", "7 x h - 5 (minimum)") + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2, 3) + .addInputHatch("Any bottom layer casing", 1) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("2-11x Output Hatches (At least one per layer except bottom layer)", 2, 3) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.getCasingTextureForId(CASING_INDEX), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_DISTILLATION_TOWER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) }; } @@ -270,11 +226,11 @@ public class GT_MetaTileEntity_DistillationTower FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); for (FluidStack tFluid : tFluids) { tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - new FluidStack[] { tFluid }, - inputs); + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + new FluidStack[] { tFluid }, + inputs); if (tRecipe != null) { if (tRecipe.isRecipeInputEqual(true, tFluids, inputs)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); @@ -308,18 +264,17 @@ public class GT_MetaTileEntity_DistillationTower protected int getCurrentLayerOutputHatchCount() { return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 - : mOutputHatchesByLayer.get(mHeight - 1) - .size(); + : mOutputHatchesByLayer.get(mHeight - 1) + .size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) - return false; + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output tHatch)) return false; while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); tHatch.updateTexture(aBaseCasingIndex); return mOutputHatchesByLayer.get(mHeight - 1) - .add(tHatch); + .add(tHatch); } @Override @@ -350,7 +305,7 @@ public class GT_MetaTileEntity_DistillationTower return false; } if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1) - .isEmpty()) + .isEmpty()) // layer without output hatch return false; if (mTopLayerFound) { @@ -410,28 +365,28 @@ public class GT_MetaTileEntity_DistillationTower for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER_HINT, - stackSize, - 1, - i, - 0, - elementBudget, - env, - false, - true); - if (built >= 0) return built; - } - mHeight = tTotalHeight - 1; - return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, + STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, - tTotalHeight - 1, + i, 0, elementBudget, env, false, true); + if (built >= 0) return built; + } + mHeight = tTotalHeight - 1; + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 1, + tTotalHeight - 1, + 0, + elementBudget, + env, + false, + true); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java index f7993fd2f4..e7879cbe0d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java @@ -50,8 +50,8 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; public abstract class GT_MetaTileEntity_DrillerBase - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DrillerBase> - implements IChunkLoader, ISurvivalConstructable { + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_DrillerBase> + implements IChunkLoader, ISurvivalConstructable { private static final ItemStack miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0); private static final ItemStack miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0); @@ -63,41 +63,36 @@ public abstract class GT_MetaTileEntity_DrillerBase @Override protected IStructureDefinition<GT_MetaTileEntity_DrillerBase> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_DrillerBase>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { " ", " f ", " " }, { " ", " f ", " " }, - { " ", " f ", " " }, { " f ", "fcf", " f " }, - { " f ", "fcf", " f " }, { " f ", "fcf", " f " }, - { "b~b", "bbb", "bbb" }, })) - .addElement('f', lazy(t -> ofFrame(t.getFrameMaterial()))) - .addElement( - 'c', - lazy( - t -> ofBlock( - t.getCasingBlockItem() - .getBlock(), - t.getCasingBlockItem() - .get(0) - .getItemDamage()))) - .addElement( - 'b', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_DrillerBase.class).atLeastList( - t.getAllowedHatches()) - .adder( - GT_MetaTileEntity_DrillerBase::addToMachineList) - .casingIndex( - t.casingTextureIndex) - .dot(1) - .buildAndChain( - t.getCasingBlockItem() - .getBlock(), - t.getCasingBlockItem() - .get(0) - .getItemDamage()))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ", " f ", " " }, { " ", " f ", " " }, { " ", " f ", " " }, + { " f ", "fcf", " f " }, { " f ", "fcf", " f " }, { " f ", "fcf", " f " }, + { "b~b", "bbb", "bbb" }, })) + .addElement('f', lazy(t -> ofFrame(t.getFrameMaterial()))) + .addElement( + 'c', + lazy( + t -> ofBlock( + t.getCasingBlockItem() + .getBlock(), + t.getCasingBlockItem() + .get(0) + .getItemDamage()))) + .addElement( + 'b', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_DrillerBase.class).atLeastList(t.getAllowedHatches()) + .adder(GT_MetaTileEntity_DrillerBase::addToMachineList) + .casingIndex(t.casingTextureIndex) + .dot(1) + .buildAndChain( + t.getCasingBlockItem() + .getBlock(), + t.getCasingBlockItem() + .get(0) + .getItemDamage()))) + .build(); } }; @@ -139,39 +134,37 @@ public abstract class GT_MetaTileEntity_DrillerBase private void initFields() { casingBlock = getCasingBlockItem().getBlock(); casingMeta = getCasingBlockItem().get(0) - .getItemDamage(); + .getItemDamage(); int frameId = 4096 + getFrameMaterial().mMetaItemSubID; frameMeta = GregTech_API.METATILEENTITIES[frameId] != null - ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() - : W; + ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() + : W; casingTextureIndex = getCasingTextureIndex(); workState = STATE_DOWNWARD; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { getCasingTextureForId(casingTextureIndex), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ORE_DRILL_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { getCasingTextureForId(casingTextureIndex), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ORE_DRILL) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ORE_DRILL) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ORE_DRILL_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { getCasingTextureForId(casingTextureIndex) }; } @@ -197,20 +190,20 @@ public abstract class GT_MetaTileEntity_DrillerBase if (aNBT.hasKey("chunkLoadingEnabled")) mChunkLoadingEnabled = aNBT.getBoolean("chunkLoadingEnabled"); if (aNBT.getBoolean("isChunkloading")) { mCurrentChunk = new ChunkCoordIntPair( - aNBT.getInteger("loadedChunkXPos"), - aNBT.getInteger("loadedChunkZPos")); + aNBT.getInteger("loadedChunkXPos"), + aNBT.getInteger("loadedChunkZPos")); } } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { mChunkLoadingEnabled = !mChunkLoadingEnabled; GT_Utility.sendChatToPlayer( - aPlayer, - mChunkLoadingEnabled ? GT_Utility.trans("502", "Mining chunk loading enabled") - : GT_Utility.trans("503", "Mining chunk loading disabled")); + aPlayer, + mChunkLoadingEnabled ? GT_Utility.trans("502", "Mining chunk loading enabled") + : GT_Utility.trans("503", "Mining chunk loading disabled")); return true; } return super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); @@ -226,8 +219,8 @@ public abstract class GT_MetaTileEntity_DrillerBase public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide() && mCurrentChunk != null - && !mWorkChunkNeedsReload - && !aBaseMetaTileEntity.isAllowedToWork()) { + && !mWorkChunkNeedsReload + && !aBaseMetaTileEntity.isAllowedToWork()) { // if machine has stopped, stop chunkloading GT_ChunkManager.releaseTicket((TileEntity) aBaseMetaTileEntity); mWorkChunkNeedsReload = true; @@ -238,13 +231,9 @@ public abstract class GT_MetaTileEntity_DrillerBase if (yHead == yDrill) return isPickingPipes = false; if (tryOutputPipe()) { if (checkBlockAndMeta(xPipe, yHead + 1, zPipe, miningPipeBlock, W)) getBaseMetaTileEntity().getWorld() - .setBlock( - xPipe, - yHead + 1, - zPipe, - miningPipeTipBlock); + .setBlock(xPipe, yHead + 1, zPipe, miningPipeTipBlock); getBaseMetaTileEntity().getWorld() - .setBlockToAir(xPipe, yHead, zPipe); + .setBlockToAir(xPipe, yHead, zPipe); return isPickingPipes = true; } return isPickingPipes = false; @@ -284,17 +273,16 @@ public abstract class GT_MetaTileEntity_DrillerBase Block b = getBaseMetaTileEntity().getBlock(xPipe, yHead - 1, zPipe); if (b != miningPipeTipBlock && !GT_Utility.setBlockByFakePlayer( - getFakePlayer(getBaseMetaTileEntity()), - xPipe, - yHead - 1, - zPipe, - miningPipeTipBlock, - 0, - isSimulating)) - return 3; + getFakePlayer(getBaseMetaTileEntity()), + xPipe, + yHead - 1, + zPipe, + miningPipeTipBlock, + 0, + isSimulating)) return 3; if (!isSimulating) { if (yHead != yDrill) getBaseMetaTileEntity().getWorld() - .setBlock(xPipe, yHead, zPipe, miningPipeBlock); + .setBlock(xPipe, yHead, zPipe, miningPipeBlock); if (b != miningPipeBlock && b != miningPipeTipBlock) getBaseMetaTileEntity().decrStackSize(1, 1); } @@ -375,7 +363,7 @@ public abstract class GT_MetaTileEntity_DrillerBase } protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { switch (tryLowerPipeState()) { case 2 -> { mMaxProgresstime = 0; @@ -396,7 +384,7 @@ public abstract class GT_MetaTileEntity_DrillerBase } protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (tryLowerPipeState(true) == 0) { workState = STATE_DOWNWARD; return true; @@ -406,7 +394,7 @@ public abstract class GT_MetaTileEntity_DrillerBase } protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (tryPickPipe()) { return true; } else { @@ -448,8 +436,8 @@ public abstract class GT_MetaTileEntity_DrillerBase public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { updateCoordinates(); return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0) && checkHatches() - && GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier() - && mMaintenanceHatches.size() == 1; + && GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier() + && mMaintenanceHatches.size() == 1; } private void updateCoordinates() { @@ -468,7 +456,7 @@ public abstract class GT_MetaTileEntity_DrillerBase if (checkBlockAndMeta(xPipe, yHead, zPipe, miningPipeTipBlock, W) || ++yHead == yDrill) return true; // pipe column is broken - try fix getBaseMetaTileEntity().getWorld() - .setBlock(xPipe, yHead, zPipe, miningPipeTipBlock); + .setBlock(xPipe, yHead, zPipe, miningPipeTipBlock); return true; } @@ -491,7 +479,7 @@ public abstract class GT_MetaTileEntity_DrillerBase private boolean checkBlockAndMeta(int x, int y, int z, Block block, int meta) { return (meta == W || getBaseMetaTileEntity().getMetaID(x, y, z) == meta) - && getBaseMetaTileEntity().getBlock(x, y, z) == block; + && getBaseMetaTileEntity().getBlock(x, y, z) == block; } private FakePlayer mFakePlayer = null; @@ -569,17 +557,15 @@ public abstract class GT_MetaTileEntity_DrillerBase for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) { if (isValidMetaTileEntity(tHatch)) { for (int i = 0; i < tHatch.getBaseMetaTileEntity() - .getSizeInventory(); i++) { + .getSizeInventory(); i++) { if (tHatch.getBaseMetaTileEntity() - .getStackInSlot(i) - != null - && isCorrectDataItem( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i), - state)) + .getStackInSlot(i) != null && isCorrectDataItem( + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i), + state)) rList.add( - tHatch.getBaseMetaTileEntity() - .getStackInSlot(i)); + tHatch.getBaseMetaTileEntity() + .getStackInSlot(i)); } } } @@ -589,7 +575,7 @@ public abstract class GT_MetaTileEntity_DrillerBase @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return super.addToMachineList(aTileEntity, aBaseCasingIndex) - || addDataAccessToMachineList(aTileEntity, aBaseCasingIndex); + || addDataAccessToMachineList(aTileEntity, aBaseCasingIndex); } public boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -621,14 +607,14 @@ public abstract class GT_MetaTileEntity_DrillerBase protected List<IHatchElement<? super GT_MetaTileEntity_DrillerBase>> getAllowedHatches() { return ImmutableList.of( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Muffler, - Maintenance, - Energy, - DataHatchElement.DataAccess); + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Muffler, + Maintenance, + Energy, + DataHatchElement.DataAccess); } protected enum DataHatchElement implements IHatchElement<GT_MetaTileEntity_DrillerBase> { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index c4795c1507..acd87c1687 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -35,73 +35,46 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_ElectricBlastFurnace - extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_ElectricBlastFurnace> - implements ISurvivalConstructable { +public class GT_MetaTileEntity_ElectricBlastFurnace extends + GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_ElectricBlastFurnace> implements ISurvivalConstructable { private int mHeatingCapacity = 0; protected final ArrayList<GT_MetaTileEntity_Hatch_Output> mPollutionOutputHatches = new ArrayList<>(); protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; + Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; protected static final int CASING_INDEX = 11; protected static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_ElectricBlastFurnace>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ttt", "tmt", - "ttt" }, - { "CCC", "C-C", - "CCC" }, - { "CCC", "C-C", - "CCC" }, - { "b~b", "bbb", - "bbb" } })) - .addElement( - 't', - buildHatchAdder( - GT_MetaTileEntity_ElectricBlastFurnace.class).atLeast( - OutputHatch.withAdder( - GT_MetaTileEntity_ElectricBlastFurnace::addOutputHatchToTopList) - .withCount( - t -> t.mPollutionOutputHatches.size())) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .buildAndChain( - GregTech_API.sBlockCasings1, - CASING_INDEX)) - .addElement( - 'm', - Muffler.newAny( - CASING_INDEX, - 2)) - .addElement( - 'C', - ofCoil( - GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, - GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) - .addElement( - 'b', - buildHatchAdder( - GT_MetaTileEntity_ElectricBlastFurnace.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .buildAndChain( - GregTech_API.sBlockCasings1, - CASING_INDEX)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_ElectricBlastFurnace> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_ElectricBlastFurnace>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ttt", "tmt", "ttt" }, { "CCC", "C-C", "CCC" }, { "CCC", "C-C", "CCC" }, + { "b~b", "bbb", "bbb" } })) + .addElement( + 't', + buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) + .atLeast( + OutputHatch.withAdder(GT_MetaTileEntity_ElectricBlastFurnace::addOutputHatchToTopList) + .withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + ofCoil( + GT_MetaTileEntity_ElectricBlastFurnace::setCoilLevel, + GT_MetaTileEntity_ElectricBlastFurnace::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_ElectricBlastFurnace.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); public GT_MetaTileEntity_ElectricBlastFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -120,56 +93,54 @@ public class GT_MetaTileEntity_ElectricBlastFurnace protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Blast Furnace") - .addInfo("Controller block for the Electric Blast Furnace") - .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") - .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") - .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") - .addInfo( - "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") - .addInfo("Additionally gives +100K for every tier past MV") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Front bottom") - .addCasingInfoRange("Heat Proof Machine Casing", 0, 15, false) - .addOtherStructurePart("Heating Coils", "Two middle Layers") - .addEnergyHatch("Any bottom layer casing", 3) - .addMaintenanceHatch("Any bottom layer casing", 3) - .addMufflerHatch("Top middle", 2) - .addInputBus("Any bottom layer casing", 3) - .addInputHatch("Any bottom layer casing", 3) - .addOutputBus("Any bottom layer casing", 3) - .addOutputHatch("Liquid form of fluids, Any bottom layer casing") - .addOutputHatch("Gas form of fluids, Any top layer casing", 1) - .addStructureInfo("Recovery amount scales with Muffler Hatch tier") - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Electric Blast Furnace") + .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") + .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") + .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") + .addInfo( + "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") + .addInfo("Additionally gives +100K for every tier past MV") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 4, 3, true) + .addController("Front bottom") + .addCasingInfoRange("Heat Proof Machine Casing", 0, 15, false) + .addOtherStructurePart("Heating Coils", "Two middle Layers") + .addEnergyHatch("Any bottom layer casing", 3) + .addMaintenanceHatch("Any bottom layer casing", 3) + .addMufflerHatch("Top middle", 2) + .addInputBus("Any bottom layer casing", 3) + .addInputHatch("Any bottom layer casing", 3) + .addOutputBus("Any bottom layer casing", 3) + .addOutputHatch("Liquid form of fluids, Any bottom layer casing") + .addOutputHatch("Gas form of fluids, Any top layer casing", 1) + .addStructureInfo("Recovery amount scales with Muffler Hatch tier") + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @@ -204,13 +175,12 @@ public class GT_MetaTileEntity_ElectricBlastFurnace if (isValidMetaTileEntity(tBus)) { for (int i = tBus.getBaseMetaTileEntity() - .getSizeInventory() - - 1; i >= 0; i--) { + .getSizeInventory() - 1; i >= 0; i--) { if (tBus.getBaseMetaTileEntity() - .getStackInSlot(i) != null) { + .getStackInSlot(i) != null) { tInputs.add( - tBus.getBaseMetaTileEntity() - .getStackInSlot(i)); + tBus.getBaseMetaTileEntity() + .getStackInSlot(i)); } } } @@ -231,12 +201,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - V[tTier], - tFluids, - tItems); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes + .findRecipe(getBaseMetaTileEntity(), false, V[tTier], tFluids, tItems); if (tRecipe == null) return false; if (this.mHeatingCapacity < tRecipe.mSpecialValue) return false; @@ -382,66 +348,66 @@ public class GT_MetaTileEntity_ElectricBlastFurnace for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { if (!isValidMetaTileEntity(tHatch)) continue; storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-mEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxInputVoltage()) - + EnumChatFormatting.RESET - + " EU/t(*2A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(getMaxInputVoltage())] - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("GT5U.EBF.heat") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mHeatingCapacity) - + EnumChatFormatting.RESET - + " K", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity) + + EnumChatFormatting.RESET + + " K", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; } @Override @@ -459,8 +425,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java index e9ed294fc2..f156d4ffbd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java @@ -38,27 +38,27 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Combustion Generator") - .addInfo("Controller block for the Extreme Combustion Engine") - .addInfo("Supply high rating fuel and 8000L of Lubricant per hour to run") - .addInfo("Supply 40L/s of Liquid Oxygen to boost output (optional)") - .addInfo("Default: Produces 10900EU/t at 100% fuel efficiency") - .addInfo("Boosted: Produces 32700EU/t at 150% fuel efficiency") - .addInfo("You need to wait for it to reach 300% to output full power") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, false) - .addController("Front center") - .addCasingInfoRange("Robust Tungstensteel Machine Casing", 16, 22, false) - .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") - .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") - .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") - .addDynamoHatch("Back center", 2) - .addMaintenanceHatch("One of the casings next to a Gear Box", 1) - .addMufflerHatch("Top middle back, above the rear Gear Box", 1) - .addInputHatch("HOG, next to a Gear Box", 1) - .addInputHatch("Lubricant, next to a Gear Box", 1) - .addInputHatch("Liquid Oxygen, optional, next to a Gear Box", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Extreme Combustion Engine") + .addInfo("Supply high rating fuel and 8000L of Lubricant per hour to run") + .addInfo("Supply 40L/s of Liquid Oxygen to boost output (optional)") + .addInfo("Default: Produces 10900EU/t at 100% fuel efficiency") + .addInfo("Boosted: Produces 32700EU/t at 150% fuel efficiency") + .addInfo("You need to wait for it to reach 300% to output full power") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, false) + .addController("Front center") + .addCasingInfoRange("Robust Tungstensteel Machine Casing", 16, 22, false) + .addOtherStructurePart("Titanium Gear Box Machine Casing", "Inner 2 blocks") + .addOtherStructurePart("Extreme Engine Intake Machine Casing", "8x, ring around controller") + .addStructureInfo("Extreme Engine Intake Casings must not be obstructed in front (only air blocks)") + .addDynamoHatch("Back center", 2) + .addMaintenanceHatch("One of the casings next to a Gear Box", 1) + .addMufflerHatch("Top middle back, above the rear Gear Box", 1) + .addInputHatch("HOG, next to a Gear Box", 1) + .addInputHatch("Lubricant, next to a Gear Box", 1) + .addInputHatch("Liquid Oxygen, optional, next to a Gear Box", 1) + .toolTipFinisher("Gregtech"); return tt; } @@ -69,28 +69,26 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][60], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][60], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_EXTREME_DIESEL_ENGINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][60] }; } @@ -184,56 +182,56 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } return new String[] { EnumChatFormatting.BLUE + "Extreme Diesel Engine" + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.engine.output") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-mEUt * mEfficiency / 10000) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.engine.consumption") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(fuelConsumption) - + EnumChatFormatting.RESET - + " L/t", - StatCollector.translateToLocal("GT5U.engine.value") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(fuelValue) - + EnumChatFormatting.RESET - + " EU/L", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(fuelRemaining) - + EnumChatFormatting.RESET - + " L", - StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) - + EnumChatFormatting.YELLOW - + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" }; + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + getIdealStatus() == getRepairStatus() + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.engine.output") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt * mEfficiency / 10000) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.engine.consumption") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelConsumption) + + EnumChatFormatting.RESET + + " L/t", + StatCollector.translateToLocal("GT5U.engine.value") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(fuelValue) + + EnumChatFormatting.RESET + + " EU/L", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(fuelRemaining) + + EnumChatFormatting.RESET + + " L", + StatCollector.translateToLocal("GT5U.engine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.YELLOW + + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 73b26c6a59..a67b050abb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -56,8 +56,8 @@ import gregtech.common.power.FusionPower; import gregtech.common.power.Power; public abstract class GT_MetaTileEntity_FusionComputer - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer> - implements ISurvivalConstructable, IAddUIWidgets { + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer> + implements ISurvivalConstructable, IAddUIWidgets { protected FusionPower power; @@ -67,84 +67,53 @@ public abstract class GT_MetaTileEntity_FusionComputer @Override protected IStructureDefinition<GT_MetaTileEntity_FusionComputer> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_FusionComputer>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { " ", " ihi ", - " hh hh ", " h h ", " h h ", - " h h ", " i i ", " h h ", - " i i ", " h h ", " h h ", - " h h ", " hh hh ", " ihi ", - " ", }, - { " xhx ", " hhccchh ", " eccxhxcce ", - " eceh hece ", " hce ech ", - " hch hch ", "xcx xcx", - "hch hch", "xcx xcx", - " hch hch ", " hce ech ", - " eceh hece ", " eccx~xcce ", - " hhccchh ", " xhx ", }, - { " ", " ihi ", " hh hh ", - " h h ", " h h ", - " h h ", " i i ", - " h h ", " i i ", - " h h ", " h h ", - " h h ", " hh hh ", - " ihi ", " ", } })) - .addElement('c', lazy(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) - .addElement('h', lazy(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) - .addElement( - 'i', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_FusionComputer.class).atLeast( - ImmutableMap.of( - InputHatch.withAdder( - GT_MetaTileEntity_FusionComputer::addInjector), - 2)) - .hatchItemFilterAnd( - t2 -> filterByMTETier( - t2.tier(), - Integer.MAX_VALUE)) - .casingIndex(53) - .dot(1) - .buildAndChain( - t.getCasing(), - t.getCasingMeta()))) - .addElement( - 'e', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_FusionComputer.class).atLeast( - ImmutableMap.of( - Energy.withAdder( - GT_MetaTileEntity_FusionComputer::addEnergyInjector), - 16)) - .hatchItemFilterAnd( - t2 -> filterByMTETier( - t2.tier(), - Integer.MAX_VALUE)) - .casingIndex(53) - .dot(2) - .buildAndChain( - t.getCasing(), - t.getCasingMeta()))) - .addElement( - 'x', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_FusionComputer.class).atLeast( - OutputHatch.withAdder( - GT_MetaTileEntity_FusionComputer::addExtractor)) - .hatchItemFilterAnd( - t2 -> filterByMTETier( - t2.tier(), - Integer.MAX_VALUE)) - .casingIndex(53) - .dot(3) - .buildAndChain( - t.getCasing(), - t.getCasingMeta()))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " ", " ihi ", " hh hh ", " h h ", + " h h ", " h h ", " i i ", " h h ", + " i i ", " h h ", " h h ", " h h ", + " hh hh ", " ihi ", " ", }, + { " xhx ", " hhccchh ", " eccxhxcce ", " eceh hece ", + " hce ech ", " hch hch ", "xcx xcx", "hch hch", + "xcx xcx", " hch hch ", " hce ech ", " eceh hece ", + " eccx~xcce ", " hhccchh ", " xhx ", }, + { " ", " ihi ", " hh hh ", " h h ", + " h h ", " h h ", " i i ", " h h ", + " i i ", " h h ", " h h ", " h h ", + " hh hh ", " ihi ", " ", } })) + .addElement('c', lazy(t -> ofBlock(t.getFusionCoil(), t.getFusionCoilMeta()))) + .addElement('h', lazy(t -> ofBlock(t.getCasing(), t.getCasingMeta()))) + .addElement( + 'i', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) + .atLeast( + ImmutableMap.of(InputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addInjector), 2)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(1) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .addElement( + 'e', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class).atLeast( + ImmutableMap.of(Energy.withAdder(GT_MetaTileEntity_FusionComputer::addEnergyInjector), 16)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(2) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .addElement( + 'x', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_FusionComputer.class) + .atLeast(OutputHatch.withAdder(GT_MetaTileEntity_FusionComputer::addExtractor)) + .hatchItemFilterAnd(t2 -> filterByMTETier(t2.tier(), Integer.MAX_VALUE)) + .casingIndex(53) + .dot(3) + .buildAndChain(t.getCasing(), t.getCasingMeta()))) + .build(); } }; public GT_Recipe mLastRecipe; @@ -152,17 +121,17 @@ public abstract class GT_MetaTileEntity_FusionComputer static { Textures.BlockIcons.setCasingTextureForId( - 52, - TextureFactory.of( - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) - .extFacing() - .glow() - .build())); + 52, + TextureFactory.of( + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW) + .extFacing() + .glow() + .build())); } public GT_MetaTileEntity_FusionComputer(int aID, String aName, String aNameRegional, int tier) { @@ -211,20 +180,20 @@ public abstract class GT_MetaTileEntity_FusionComputer protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addController("Fusion Reactor") - .addInfo("Some kind of fusion reactor, maybe") - .addSeparator() - .addInfo("Some kind of fusion reactor, maybe") - .addStructureInfo("Should probably be built similar to other fusions") - .addStructureInfo("See controller tooltip for details") - .toolTipFinisher("Gregtech"); + .addInfo("Some kind of fusion reactor, maybe") + .addSeparator() + .addInfo("Some kind of fusion reactor, maybe") + .addStructureInfo("Should probably be built similar to other fusions") + .addStructureInfo("See controller tooltip for details") + .toolTipFinisher("Gregtech"); return tt; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { if (checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) && mInputHatches.size() > 1 - && !mOutputHatches.isEmpty() - && !mEnergyHatches.isEmpty()) { + && !mOutputHatches.isEmpty() + && !mEnergyHatches.isEmpty()) { mWrench = true; mScrewdriver = true; mSoftHammer = true; @@ -275,17 +244,16 @@ public abstract class GT_MetaTileEntity_FusionComputer @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) return new ITexture[] { TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS) - .extFacing() - .build(), - getTextureOverlay() }; + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build(), getTextureOverlay() }; if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(52) }; return new ITexture[] { TextureFactory.builder() - .addIcon(MACHINE_CASING_FUSION_GLASS) - .extFacing() - .build() }; + .addIcon(MACHINE_CASING_FUSION_GLASS) + .extFacing() + .build() }; } /** @@ -333,19 +301,11 @@ public abstract class GT_MetaTileEntity_FusionComputer FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); GT_Recipe tRecipe; - tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - false, - GT_Values.V[tier()], - tFluids); + tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes + .findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); if (tRecipe == null) { - tRecipe = GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes.findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - false, - GT_Values.V[tier()], - tFluids); + tRecipe = GT_Recipe.GT_Recipe_Map.sComplexFusionRecipes + .findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[tier()], tFluids); } if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) { @@ -411,8 +371,8 @@ public abstract class GT_MetaTileEntity_FusionComputer if (isValidMetaTileEntity(tHatch)) { long energyToMove = GT_Values.V[tier()] / 16; if (aBaseMetaTileEntity.getStoredEU() + energyToMove < maxEUStore() - && tHatch.getBaseMetaTileEntity() - .decreaseStoredEnergyUnits(energyToMove, false)) { + && tHatch.getBaseMetaTileEntity() + .decreaseStoredEnergyUnits(energyToMove, false)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(energyToMove, true); } } @@ -428,9 +388,8 @@ public abstract class GT_MetaTileEntity_FusionComputer for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack); if (mOutputFluids != null) for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack); - mEfficiency = Math.max( - 0, - Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); + mEfficiency = Math + .max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]))); mOutputItems = null; mProgresstime = 0; mMaxProgresstime = 0; @@ -438,10 +397,9 @@ public abstract class GT_MetaTileEntity_FusionComputer if (mOutputFluids != null && mOutputFluids.length > 0) { try { GT_Mod.achievements.issueAchivementHatchFluid( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName( - aBaseMetaTileEntity.getOwnerName()), - mOutputFluids[0]); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + mOutputFluids[0]); } catch (Exception ignored) {} } this.mEUStore = aBaseMetaTileEntity.getStoredEU(); @@ -449,7 +407,7 @@ public abstract class GT_MetaTileEntity_FusionComputer } } else { if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() - || aBaseMetaTileEntity.hasInventoryBeenModified()) { + || aBaseMetaTileEntity.hasInventoryBeenModified()) { turnCasingActive(mMaxProgresstime > 0); if (aBaseMetaTileEntity.isAllowedToWork()) { this.mEUStore = aBaseMetaTileEntity.getStoredEU(); @@ -457,9 +415,8 @@ public abstract class GT_MetaTileEntity_FusionComputer if (this.mEUStore < this.mLastRecipe.mSpecialValue - this.mEUt) { criticalStopMachine(); } - aBaseMetaTileEntity.decreaseStoredEnergyUnits( - this.mLastRecipe.mSpecialValue - this.mEUt, - true); + aBaseMetaTileEntity + .decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue - this.mEUt, true); } } if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000); @@ -470,8 +427,8 @@ public abstract class GT_MetaTileEntity_FusionComputer stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID( - (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); + aBaseMetaTileEntity + .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); } } @@ -522,8 +479,8 @@ public abstract class GT_MetaTileEntity_FusionComputer @Override public String[] getInfoData() { String tier = tier() == 6 ? EnumChatFormatting.RED + "I" + EnumChatFormatting.RESET - : tier() == 7 ? EnumChatFormatting.YELLOW + "II" + EnumChatFormatting.RESET - : tier() == 8 ? EnumChatFormatting.GRAY + "III" + EnumChatFormatting.RESET : "IV"; + : tier() == 7 ? EnumChatFormatting.YELLOW + "II" + EnumChatFormatting.RESET + : tier() == 8 ? EnumChatFormatting.GRAY + "III" + EnumChatFormatting.RESET : "IV"; float plasmaOut = 0; int powerRequired = 0; if (this.mLastRecipe != null) { @@ -534,25 +491,25 @@ public abstract class GT_MetaTileEntity_FusionComputer } return new String[] { EnumChatFormatting.BLUE + "Fusion Reactor MK " + EnumChatFormatting.RESET + tier, - StatCollector.translateToLocal("GT5U.fusion.req") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(powerRequired) - + EnumChatFormatting.RESET - + "EU/t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mEUStore) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEUStore()) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(plasmaOut) - + EnumChatFormatting.RESET - + "L/t" }; + StatCollector.translateToLocal("GT5U.fusion.req") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(powerRequired) + + EnumChatFormatting.RESET + + "EU/t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mEUStore) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEUStore()) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.fusion.plasma") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(plasmaOut) + + EnumChatFormatting.RESET + + "L/t" }; } @Override @@ -584,9 +541,9 @@ public abstract class GT_MetaTileEntity_FusionComputer @Override public void addGregTechLogo(ModularWindow.Builder builder) { builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(155, 145)); + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()) + .setSize(17, 17) + .setPos(155, 145)); } @Override @@ -606,79 +563,71 @@ public abstract class GT_MetaTileEntity_FusionComputer @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( + builder + .widget( new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")).setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mMachine) - .setPos(10, 8)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)) - .widget( - new TextWidget( - "Hit with Soft Mallet to (re-)start the Machine if it doesn't start.").setDefaultColor( - COLOR_TEXT_WHITE.get()) - .setTextAlignment( - Alignment.Center) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 - && !getBaseMetaTileEntity().isActive()) - .setPos( - -getGUIWidth() - / 2, - 170) - .setSize( - getGUIWidth() - * 2, - 9)) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID(val))) - .widget( - new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))) - .widget( - new TextWidget("Running perfectly.").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setTextAlignment(Alignment.Center) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0 && getBaseMetaTileEntity().isActive()) - .setPos(0, 170) - .setSize(getGUIWidth(), 9)) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID(val))) - .widget( - new ProgressBar().setProgress( - () -> (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity()) - .setDirection(ProgressBar.Direction.RIGHT) - .setTexture(GT_UITextures.PROGRESSBAR_STORED_EU, 147) - .setPos(5, 156) - .setSize(147, 5)) - .widget(TextWidget.dynamicString(() -> { - long energy = getBaseMetaTileEntity().getStoredEU(); - if (energy > 160_000_000L && energy < 160_010_000L) { - energy = 160_000_000L; - } - if (energy > 320_000_000L && energy < 320_010_000L) { - energy = 320_000_000L; - } - if (energy > 640_000_000L && energy < 640_010_000L) { - energy = 640_000_000L; - } - if (energy > 5_120_000_000L && energy < 5_120_080_000L) { - energy = 5_120_000_000L; - } - return GT_Utility.formatNumbers(energy) + " EU"; - }) - .setDefaultColor(COLOR_TEXT_RED.get()) - .setPos(50, 155)) - .widget( - new ButtonWidget().setNEITransferRect(GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName) - .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NEI) - .setPos(154, 4) - .setSize(18, 18)); + .setEnabled(widget -> !mMachine) + .setPos(10, 8)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)) + .widget( + new TextWidget("Hit with Soft Mallet to (re-)start the Machine if it doesn't start.") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setTextAlignment(Alignment.Center) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && !getBaseMetaTileEntity().isActive()) + .setPos(-getGUIWidth() / 2, 170) + .setSize(getGUIWidth() * 2, 9)) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val))) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))) + .widget( + new TextWidget("Running perfectly.").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setTextAlignment(Alignment.Center) + .setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive()) + .setPos(0, 170) + .setSize(getGUIWidth(), 9)) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val))) + .widget( + new ProgressBar() + .setProgress( + () -> (float) getBaseMetaTileEntity().getStoredEU() / getBaseMetaTileEntity().getEUCapacity()) + .setDirection(ProgressBar.Direction.RIGHT) + .setTexture(GT_UITextures.PROGRESSBAR_STORED_EU, 147) + .setPos(5, 156) + .setSize(147, 5)) + .widget(TextWidget.dynamicString(() -> { + long energy = getBaseMetaTileEntity().getStoredEU(); + if (energy > 160_000_000L && energy < 160_010_000L) { + energy = 160_000_000L; + } + if (energy > 320_000_000L && energy < 320_010_000L) { + energy = 320_000_000L; + } + if (energy > 640_000_000L && energy < 640_010_000L) { + energy = 640_000_000L; + } + if (energy > 5_120_000_000L && energy < 5_120_080_000L) { + energy = 5_120_000_000L; + } + return GT_Utility.formatNumbers(energy) + " EU"; + }) + .setDefaultColor(COLOR_TEXT_RED.get()) + .setPos(50, 155)) + .widget( + new ButtonWidget().setNEITransferRect(GT_Recipe.GT_Recipe_Map.sFusionRecipes.mNEIName) + .setBackground(GT_UITextures.BUTTON_STANDARD, GT_UITextures.OVERLAY_BUTTON_NEI) + .setPos(154, 4) + .setSize(18, 18)); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java index 382e2c6c6e..cd44756d62 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java @@ -16,15 +16,15 @@ import gregtech.common.power.FusionPower; public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1_GLOW) - .extFacing() - .glow() - .build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 6); @@ -75,22 +75,22 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Fusion Reactor") - .addInfo("It's over 9000!!!") - .addInfo("Controller block for the Fusion Reactor Mk I") - .addInfo("2048EU/t and 10M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfoRange("LuV Machine Casing", 79, 123, false) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2) - .addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3) - .addStructureInfo("ALL Hatches must be LuV or better") - .toolTipFinisher("Gregtech"); + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk I") + .addInfo("2048EU/t and 10M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfoRange("LuV Machine Casing", 79, 123, false) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Superconducting Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) + .addStructureInfo("ALL Hatches must be LuV or better") + .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java index 5a5e884cb8..7b77ddcf66 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java @@ -16,15 +16,15 @@ import gregtech.common.power.FusionPower; public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder() - .addIcon(OVERLAY_FUSION2) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION2_GLOW) - .extFacing() - .glow() - .build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION2) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION2_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 7); @@ -75,22 +75,22 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Fusion Reactor") - .addInfo("It's over 9000!!!") - .addInfo("Controller block for the Fusion Reactor Mk II") - .addInfo("8192EU/t and 20M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfoRange("Fusion Machine Casing", 79, 123, false) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2) - .addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3) - .addStructureInfo("ALL Hatches must be ZPM or better") - .toolTipFinisher("Gregtech"); + .addInfo("It's over 9000!!!") + .addInfo("Controller block for the Fusion Reactor Mk II") + .addInfo("8192EU/t and 20M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfoRange("Fusion Machine Casing", 79, 123, false) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) + .addStructureInfo("ALL Hatches must be ZPM or better") + .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java index 2d5c6111fd..271e28713d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java @@ -16,15 +16,15 @@ import gregtech.common.power.FusionPower; public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionComputer { private static final ITexture textureOverlay = TextureFactory.of( - TextureFactory.builder() - .addIcon(OVERLAY_FUSION3) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION3_GLOW) - .extFacing() - .glow() - .build()); + TextureFactory.builder() + .addIcon(OVERLAY_FUSION3) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION3_GLOW) + .extFacing() + .glow() + .build()); public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 8); @@ -75,22 +75,22 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Fusion Reactor") - .addInfo("A SUN DOWN ON EARTH") - .addInfo("Controller block for the Fusion Reactor Mk III") - .addInfo("32768EU/t and 40M EU capacity per Energy Hatch") - .addInfo("If the recipe has a startup cost greater than the") - .addInfo("number of energy hatches * cap, you can't do it") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfoRange("Fusion Machine Casing Mk II", 79, 123, false) - .addStructureInfo("Cover the coils with casing") - .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2) - .addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3) - .addStructureInfo("ALL Hatches must be UV or better") - .toolTipFinisher("Gregtech"); + .addInfo("A SUN DOWN ON EARTH") + .addInfo("Controller block for the Fusion Reactor Mk III") + .addInfo("32768EU/t and 40M EU capacity per Energy Hatch") + .addInfo("If the recipe has a startup cost greater than the") + .addInfo("number of energy hatches * cap, you can't do it") + .addSeparator() + .beginStructureBlock(15, 3, 15, false) + .addController("See diagram when placed") + .addCasingInfoRange("Fusion Machine Casing Mk II", 79, 123, false) + .addStructureInfo("Cover the coils with casing") + .addOtherStructurePart("Fusion Coil Block", "Center part of the ring") + .addEnergyHatch("1-16, Specified casings", 2) + .addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3) + .addStructureInfo("ALL Hatches must be UV or better") + .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java index ceb901c5ad..bdaf5209ce 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java @@ -36,74 +36,41 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_HeatExchanger extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger> implements ISurvivalConstructable { + GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger> implements ISurvivalConstructable { private int dryHeatCounter = 0; // Counts up to dryHeatMaximum to check for explosion conditions private static final int dryHeatMaximum = 2000; // 2000 ticks = 100 seconds private static final int CASING_INDEX = 50; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_HeatExchanger>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ccc", "cCc", - "ccc" }, - { "ccc", "cPc", - "ccc" }, - { "ccc", "cPc", - "ccc" }, - { "c~c", "cHc", - "ccc" }, })) - .addElement( - 'P', - ofBlock( - GregTech_API.sBlockCasings2, - 14)) - .addElement( - 'C', - OutputHatch.withAdder( - GT_MetaTileEntity_HeatExchanger::addColdFluidOutputToMachineList) - .withCount( - t -> isValidMetaTileEntity( - t.mOutputColdFluidHatch) - ? 1 - : 0) - .newAny( - CASING_INDEX, - 3)) - .addElement( - 'H', - OutputHatch.withAdder( - GT_MetaTileEntity_HeatExchanger::addHotFluidInputToMachineList) - .withCount( - t -> isValidMetaTileEntity( - t.mInputHotFluidHatch) - ? 1 - : 0) - .newAny( - CASING_INDEX, - 3)) - .addElement( - 'c', - buildHatchAdder( - GT_MetaTileEntity_HeatExchanger.class).atLeast( - InputBus, - InputHatch, - OutputBus, - OutputHatch, - Maintenance) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_HeatExchanger::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings4, - (byte) 2)))) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_HeatExchanger>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccc", "cCc", "ccc" }, { "ccc", "cPc", "ccc" }, { "ccc", "cPc", "ccc" }, + { "c~c", "cHc", "ccc" }, })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 14)) + .addElement( + 'C', + OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addColdFluidOutputToMachineList) + .withCount(t -> isValidMetaTileEntity(t.mOutputColdFluidHatch) ? 1 : 0) + .newAny(CASING_INDEX, 3)) + .addElement( + 'H', + OutputHatch.withAdder(GT_MetaTileEntity_HeatExchanger::addHotFluidInputToMachineList) + .withCount(t -> isValidMetaTileEntity(t.mInputHotFluidHatch) ? 1 : 0) + .newAny(CASING_INDEX, 3)) + .addElement( + 'c', + buildHatchAdder(GT_MetaTileEntity_HeatExchanger.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_HeatExchanger::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, (byte) 2)))) + .build(); public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; @@ -129,23 +96,23 @@ public class GT_MetaTileEntity_HeatExchanger extends protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Heat Exchanger") - .addInfo("Controller Block for the Large Heat Exchanger") - .addInfo("More complicated than a Fusion Reactor. Seriously") - .addInfo("Inputs are Hot Coolant or Lava") - .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") - .addInfo("Read the wiki article to understand how it works") - .addInfo("Then go to the Discord to understand the wiki") - .addSeparator() - .beginStructureBlock(3, 4, 3, false) - .addController("Front bottom") - .addCasingInfoRange("Stable Titanium Machine Casing", 20, 32, false) - .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") - .addMaintenanceHatch("Any casing", 1) - .addInputHatch("Hot fluid, bottom center", 2) - .addInputHatch("Distilled water, any casing", 1) - .addOutputHatch("Cold fluid, top center", 3) - .addOutputHatch("Steam/SH Steam, any casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Large Heat Exchanger") + .addInfo("More complicated than a Fusion Reactor. Seriously") + .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") + .addInfo("Read the wiki article to understand how it works") + .addInfo("Then go to the Discord to understand the wiki") + .addSeparator() + .beginStructureBlock(3, 4, 3, false) + .addController("Front bottom") + .addCasingInfoRange("Stable Titanium Machine Casing", 20, 32, false) + .addOtherStructurePart("Titanium Pipe Casing", "Center 2 blocks") + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Hot fluid, bottom center", 2) + .addInputHatch("Distilled water, any casing", 1) + .addOutputHatch("Cold fluid, top center", 3) + .addOutputHatch("Steam/SH Steam, any casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @@ -165,28 +132,26 @@ public class GT_MetaTileEntity_HeatExchanger extends @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_HEAT_EXCHANGER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @@ -218,7 +183,7 @@ public class GT_MetaTileEntity_HeatExchanger extends // Do we have an integrated circuit with a valid configuration? if (mInventory[1] != null && mInventory[1].getUnlocalizedName() - .startsWith("gt.integrated_circuit")) { + .startsWith("gt.integrated_circuit")) { int circuit_config = mInventory[1].getItemDamage(); if (circuit_config >= 1 && circuit_config <= 25) { // If so, apply the penalty and reduced threshold. @@ -234,25 +199,24 @@ public class GT_MetaTileEntity_HeatExchanger extends superheated_threshold /= 4f; // unchanged do_lava = true; } else if (mInputHotFluidHatch.getFluid() - .isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { - steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> - // nerf with this code back to 5x - superheated_threshold /= 5f; // 10x smaller since the Hot Things production in - // reactor is the same. - do_coolant = true; - } else - if (mInputHotFluidHatch.getFluid() - .isFluidEqual(FluidRegistry.getFluidStack("molten.solarsalthot", 1))) { - steam_output_multiplier *= 2.5f; // Solar Salt:Steam value is 5x higher than Hot - // Coolant's value - superheated_threshold /= 25f; // Given that, multiplier is 5x higher and - // threshold is 5x lower - do_solarSalt = true; - } else { - // If we're working with neither, fail out - superheated_threshold = 0; - return false; - } + .isFluidEqual(FluidRegistry.getFluidStack("ic2hotcoolant", 1))) { + steam_output_multiplier /= 2f; // was boosted x2 on top of x5 -> total x10 -> + // nerf with this code back to 5x + superheated_threshold /= 5f; // 10x smaller since the Hot Things production in + // reactor is the same. + do_coolant = true; + } else if (mInputHotFluidHatch.getFluid() + .isFluidEqual(FluidRegistry.getFluidStack("molten.solarsalthot", 1))) { + steam_output_multiplier *= 2.5f; // Solar Salt:Steam value is 5x higher than Hot + // Coolant's value + superheated_threshold /= 25f; // Given that, multiplier is 5x higher and + // threshold is 5x lower + do_solarSalt = true; + } else { + // If we're working with neither, fail out + superheated_threshold = 0; + return false; + } superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have // enough hot fluid. Used in the @@ -391,43 +355,43 @@ public class GT_MetaTileEntity_HeatExchanger extends @Override public String[] getInfoData() { return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.usage") + " " - + StatCollector.translateToLocal("GT5U.LHE.steam") - + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) - + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) - + superheated - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated") + " " - + StatCollector.translateToLocal("GT5U.LHE.threshold") - + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(superheated_threshold) - + EnumChatFormatting.RESET }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + + StatCollector.translateToLocal("GT5U.LHE.steam") + + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + + GT_Utility.formatNumbers(superheated ? -2 * mEUt : -mEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + + superheated + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + + StatCollector.translateToLocal("GT5U.LHE.threshold") + + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(superheated_threshold) + + EnumChatFormatting.RESET }; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index fede7c283d..f21d814838 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -25,7 +25,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_ImplosionCompressor - extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> { + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> { public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -44,53 +44,51 @@ public class GT_MetaTileEntity_ImplosionCompressor protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Implosion Compressor") - .addInfo("Explosions are fun") - .addInfo("Controller block for the Implosion Compressor") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfoRange("Solid Steel Machine Casing", 16, 24, false) - .addStructureInfo("Casings can be replaced with Explosion Warning Signs") - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Explosions are fun") + .addInfo("Controller block for the Implosion Compressor") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoRange("Solid Steel Machine Casing", 16, 24, false) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return super.addToMachineList(aTileEntity, aBaseCasingIndex) - || addMufflerToMachineList(aTileEntity, aBaseCasingIndex); + || addMufflerToMachineList(aTileEntity, aBaseCasingIndex); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.casingTexturePages[0][16], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.casingTexturePages[0][16], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_IMPLOSION_COMPRESSOR) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][16] }; } @@ -125,12 +123,8 @@ public class GT_MetaTileEntity_ImplosionCompressor } ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); if (!tInputList.isEmpty()) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - 9223372036854775807L, - null, - tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sImplosionRecipes + .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java index ef0eae45a8..23fa445868 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java @@ -49,192 +49,70 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_IntegratedOreFactory - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_IntegratedOreFactory> - implements ISurvivalConstructable { +public class GT_MetaTileEntity_IntegratedOreFactory extends + GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_IntegratedOreFactory> implements ISurvivalConstructable { private static final int CASING_INDEX1 = 183; private static final int CASING_INDEX2 = 49; private static final int MAX_PARA = 1024; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_IntegratedOreFactory> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_IntegratedOreFactory>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { " ", - " ", - " WWW ", - " WWW ", - " ", - " " }, - { " ", - " sss ", - " sppps", - " sppps", - " sss ", - " " }, - { " ", - " sss ", - " s s", - " s s", - " sss ", - " " }, - { " ", - " sss ", - " sppps", - " sppps", - " sss ", - " " }, - { " ", - " sss ", - " s s", - " s s", - " sss ", - " " }, - { " ", - " sss ", - " sppps", - " sppps", - " sss ", - " " }, - { "iiiiii ", - "iIIIIiisssi", - "iIIIIis s", - "iIIIIis s", - "iIIIIiisssi", - "iiiiii " }, - { "iggggi ", - "gt t isssi", - "g xx sppps", - "g xx sppps", - "gt t isssi", - "iggggi " }, - { "iggggi ", - "gt t isssi", - "g xx s s", - "g xx s s", - "gt t isssi", - "iggggi " }, - { "iggggi ", - "gt t is~si", - "g xx spppO", - "g xx spppO", - "gt t isssi", - "iggggi " }, - { "iggggi ", - "gt t isssi", - "g xx s O", - "g xx s O", - "gt t isssi", - "iggggi " }, - { "EEEEEE ", - "EEEEEEEEEEE", - "EEEEEEEEEEE", - "EEEEEEEEEEE", - "EEEEEEEEEEE", - "EEEEEE " } })) - .addElement( - 'i', - ofBlock( - GregTech_API.sBlockCasings8, - 7)) - .addElement( - 's', - ofBlock( - GregTech_API.sBlockCasings4, - 1)) - .addElement( - 'g', - ofChain( - ofBlockUnlocalizedName( - IndustrialCraft2.ID, - "blockAlloyGlass", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks2", - 0, - true), - // warded - // glass - ofBlockUnlocalizedName( - Thaumcraft.ID, - "blockCosmeticOpaque", - 2, - false))) - .addElement( - 'x', - ofBlock( - GregTech_API.sBlockCasings2, - 3)) - .addElement( - 'p', - ofBlock( - GregTech_API.sBlockCasings2, - 15)) - .addElement( - 't', - ofFrame( - Materials.TungstenSteel)) - .addElement( - 'E', - buildHatchAdder( - GT_MetaTileEntity_IntegratedOreFactory.class).atLeast( - Energy, - Maintenance) - .casingIndex( - CASING_INDEX1) - .dot( - 1) - .buildAndChain( - GregTech_API.sBlockCasings8, - 7)) - .addElement( - 'I', - buildHatchAdder( - GT_MetaTileEntity_IntegratedOreFactory.class).atLeast( - InputBus) - .casingIndex( - CASING_INDEX1) - .dot( - 2) - .buildAndChain( - GregTech_API.sBlockCasings8, - 7)) - .addElement( - 'W', - buildHatchAdder( - GT_MetaTileEntity_IntegratedOreFactory.class).atLeast( - InputHatch, - Muffler) - .casingIndex( - CASING_INDEX2) - .dot( - 3) - .buildAndChain( - GregTech_API.sBlockCasings4, - 1)) - .addElement( - 'O', - buildHatchAdder( - GT_MetaTileEntity_IntegratedOreFactory.class).atLeast( - OutputBus, - OutputHatch) - .casingIndex( - CASING_INDEX2) - .dot( - 4) - .buildAndChain( - GregTech_API.sBlockCasings4, - 1)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_IntegratedOreFactory> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_IntegratedOreFactory>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { + { " ", " ", " WWW ", " WWW ", " ", " " }, + { " ", " sss ", " sppps", " sppps", " sss ", " " }, + { " ", " sss ", " s s", " s s", " sss ", " " }, + { " ", " sss ", " sppps", " sppps", " sss ", " " }, + { " ", " sss ", " s s", " s s", " sss ", " " }, + { " ", " sss ", " sppps", " sppps", " sss ", " " }, + { "iiiiii ", "iIIIIiisssi", "iIIIIis s", "iIIIIis s", "iIIIIiisssi", "iiiiii " }, + { "iggggi ", "gt t isssi", "g xx sppps", "g xx sppps", "gt t isssi", "iggggi " }, + { "iggggi ", "gt t isssi", "g xx s s", "g xx s s", "gt t isssi", "iggggi " }, + { "iggggi ", "gt t is~si", "g xx spppO", "g xx spppO", "gt t isssi", "iggggi " }, + { "iggggi ", "gt t isssi", "g xx s O", "g xx s O", "gt t isssi", "iggggi " }, + { "EEEEEE ", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEEEEEEE", "EEEEEE " } })) + .addElement('i', ofBlock(GregTech_API.sBlockCasings8, 7)) + .addElement('s', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'g', + ofChain( + ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true), + // warded + // glass + ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false))) + .addElement('x', ofBlock(GregTech_API.sBlockCasings2, 3)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings2, 15)) + .addElement('t', ofFrame(Materials.TungstenSteel)) + .addElement( + 'E', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class).atLeast(Energy, Maintenance) + .casingIndex(CASING_INDEX1) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'I', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class).atLeast(InputBus) + .casingIndex(CASING_INDEX1) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings8, 7)) + .addElement( + 'W', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class).atLeast(InputHatch, Muffler) + .casingIndex(CASING_INDEX2) + .dot(3) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'O', + buildHatchAdder(GT_MetaTileEntity_IntegratedOreFactory.class).atLeast(OutputBus, OutputHatch) + .casingIndex(CASING_INDEX2) + .dot(4) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .build(); private static final HashSet<Integer> isCrushedOre = new HashSet<>(); private static final HashSet<Integer> isCrushedPureOre = new HashSet<>(); @@ -311,30 +189,30 @@ public class GT_MetaTileEntity_IntegratedOreFactory protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Ore Processor") - .addInfo("Controller Block for the Integrated Ore Factory") - .addInfo("It is OP. I mean ore processor.") - .addInfo("Do all ore procession in one step.") - .addInfo("Can process up to 1024 ores per time.") - .addInfo("Every ore costs 30EU/t, 2L lubricant, 200L distilled water.") - .addInfo("Process time is depend on mode.") - .addInfo("Use a screwdriver to switch mode.") - .addInfo("Sneak click with screwdriver to void the stone dusts.") - .addSeparator() - .beginStructureBlock(6, 12, 11, false) - .addController("The third layer") - .addStructureInfo("128 advanced iridium plated machine casing") - .addStructureInfo("105 clean stainless steel machine casing") - .addStructureInfo("48 reinforced glass") - .addStructureInfo("30 tungstensteel pipe casing") - .addStructureInfo("16 tungstensteel frame box") - .addStructureInfo("16 steel gear box casing") - .addEnergyHatch("Button Casing", 1) - .addMaintenanceHatch("Button Casing", 1) - .addInputBus("Input ore/crushed ore", 2) - .addInputHatch("Input lubricant/distilled water/washing chemicals", 3) - .addMufflerHatch("Output Pollution", 3) - .addOutputBus("Output products", 4) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Integrated Ore Factory") + .addInfo("It is OP. I mean ore processor.") + .addInfo("Do all ore procession in one step.") + .addInfo("Can process up to 1024 ores per time.") + .addInfo("Every ore costs 30EU/t, 2L lubricant, 200L distilled water.") + .addInfo("Process time is depend on mode.") + .addInfo("Use a screwdriver to switch mode.") + .addInfo("Sneak click with screwdriver to void the stone dusts.") + .addSeparator() + .beginStructureBlock(6, 12, 11, false) + .addController("The third layer") + .addStructureInfo("128 advanced iridium plated machine casing") + .addStructureInfo("105 clean stainless steel machine casing") + .addStructureInfo("48 reinforced glass") + .addStructureInfo("30 tungstensteel pipe casing") + .addStructureInfo("16 tungstensteel frame box") + .addStructureInfo("16 steel gear box casing") + .addEnergyHatch("Button Casing", 1) + .addMaintenanceHatch("Button Casing", 1) + .addInputBus("Input ore/crushed ore", 2) + .addInputHatch("Input lubricant/distilled water/washing chemicals", 3) + .addMufflerHatch("Output Pollution", 3) + .addOutputBus("Output products", 4) + .toolTipFinisher("Gregtech"); return tt; } @@ -405,10 +283,10 @@ public class GT_MetaTileEntity_IntegratedOreFactory int tID = GT_Utility.stackToInt(ore); if (tID == 0) continue; if (isPureDust.contains(tID) || isImpureDust.contains(tID) - || isCrushedPureOre.contains(tID) - || isThermal.contains(tID) - || isCrushedOre.contains(tID) - || isOre.contains(tID)) { + || isCrushedPureOre.contains(tID) + || isThermal.contains(tID) + || isCrushedOre.contains(tID) + || isOre.contains(tID)) { if (ore.stackSize <= tCharged) { tRealUsed += ore.stackSize; tOres.add(GT_Utility.copy(ore)); @@ -497,8 +375,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory if (aPlayer.isSneaking()) { sVoidStone = !sVoidStone; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); + aPlayer, + StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); return; } sMode = (sMode + 1) % 5; @@ -529,12 +407,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - null, - aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes + .findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -556,11 +430,11 @@ public class GT_MetaTileEntity_IntegratedOreFactory int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sOreWasherRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - new FluidStack[] { GT_ModHandler.getDistilledWater(Integer.MAX_VALUE) }, - aStack); + getBaseMetaTileEntity(), + false, + GT_Values.V[15], + new FluidStack[] { GT_ModHandler.getDistilledWater(Integer.MAX_VALUE) }, + aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -581,12 +455,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - null, - aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sThermalCentrifugeRecipes + .findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -607,12 +477,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - null, - aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes + .findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -633,12 +499,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory for (ItemStack aStack : sMidProduct) { int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sSifterRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - null, - aStack); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sSifterRecipes + .findRecipe(getBaseMetaTileEntity(), false, GT_Values.V[15], null, aStack); if (tRecipe != null) { tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize)); } else { @@ -660,14 +522,14 @@ public class GT_MetaTileEntity_IntegratedOreFactory int tID = GT_Utility.stackToInt(aStack); if (checkTypes(tID, aTables)) { GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - GT_Values.V[15], - getStoredFluids().toArray(new FluidStack[0]), - aStack); + getBaseMetaTileEntity(), + false, + GT_Values.V[15], + getStoredFluids().toArray(new FluidStack[0]), + aStack); if (tRecipe != null && tRecipe.getRepresentativeFluidInput(0) != null) { FluidStack tInputFluid = tRecipe.getRepresentativeFluidInput(0) - .copy(); + .copy(); int tStored = getFluidAmount(tInputFluid); int tWashed = Math.min(tStored / tInputFluid.amount, aStack.stackSize); depleteInput(new FluidStack(tInputFluid.getFluid(), tWashed * tInputFluid.amount)); @@ -712,13 +574,13 @@ public class GT_MetaTileEntity_IntegratedOreFactory double e = aTime * (tChance / 10000D) * (1 - (tChance / 10000D)); Random random = new Random(); int tAmount = (int) Math.ceil(Math.sqrt(e) * random.nextGaussian() + u); - tOutput.add( - GT_Utility.copyAmountUnsafe(tAmount * aRecipe.getOutput(i).stackSize, aRecipe.getOutput(i))); + tOutput + .add(GT_Utility.copyAmountUnsafe(tAmount * aRecipe.getOutput(i).stackSize, aRecipe.getOutput(i))); } } return tOutput.stream() - .filter(i -> (i != null && i.stackSize > 0)) - .collect(Collectors.toList()); + .filter(i -> (i != null && i.stackSize > 0)) + .collect(Collectors.toList()); } private void doCompress(List<ItemStack> aList) { @@ -750,7 +612,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return checkPiece(STRUCTURE_PIECE_MAIN, 8, 9, 1) && mMaintenanceHatches.size() <= 1 - && !mMufflerHatches.isEmpty(); + && !mMufflerHatches.isEmpty(); } @Override @@ -790,9 +652,9 @@ public class GT_MetaTileEntity_IntegratedOreFactory public String[] getInfoData() { List<String> informationData = new ArrayList<>(Arrays.asList(super.getInfoData())); String parallelism = StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " - + EnumChatFormatting.BLUE - + getCurrentParallelism() - + EnumChatFormatting.RESET; + + EnumChatFormatting.BLUE + + getCurrentParallelism() + + EnumChatFormatting.RESET; informationData.add(parallelism); informationData.add(StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", sVoidStone)); informationData.addAll(getDisplayMode(sMode)); @@ -801,28 +663,27 @@ public class GT_MetaTileEntity_IntegratedOreFactory @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_PROCESSING_ARRAY) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2) }; } @@ -831,13 +692,13 @@ public class GT_MetaTileEntity_IntegratedOreFactory final EnumChatFormatting AQUA = EnumChatFormatting.AQUA; final String CRUSH = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Macerate"); final String WASH = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Ore_Washer") - .replace(" ", " " + AQUA); + .replace(" ", " " + AQUA); final String THERMAL = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Thermal_Centrifuge") - .replace(" ", " " + AQUA); + .replace(" ", " " + AQUA); final String CENTRIFUGE = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Centrifuge"); final String SIFTER = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Sifter"); final String CHEM_WASH = StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.Chemical_Bathing") - .replace(" ", " " + AQUA); + .replace(" ", " " + AQUA); final String ARROW = " " + AQUA + "-> "; List<String> des = new ArrayList<>(); @@ -883,24 +744,24 @@ public class GT_MetaTileEntity_IntegratedOreFactory @Override public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); NBTTagCompound tag = accessor.getNBTData(); currenttip.add( - StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " - + EnumChatFormatting.BLUE - + tag.getInteger("currentParallelism") - + EnumChatFormatting.RESET); + StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " + + EnumChatFormatting.BLUE + + tag.getInteger("currentParallelism") + + EnumChatFormatting.RESET); currenttip.addAll(getDisplayMode(tag.getInteger("ssMode"))); - currenttip.add( - StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", tag.getBoolean("ssStone"))); + currenttip + .add(StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor.void", tag.getBoolean("ssStone"))); } @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); tag.setInteger("ssMode", sMode); tag.setBoolean("ssStone", sVoidStone); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index fa2ebcb2a4..a2086307f1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -43,8 +43,8 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -public abstract class GT_MetaTileEntity_LargeBoiler extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> implements ISurvivalConstructable { +public abstract class GT_MetaTileEntity_LargeBoiler + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeBoiler> implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>> STRUCTURE_DEFINITION = new ClassValue<>() { @@ -52,46 +52,34 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends @Override protected IStructureDefinition<GT_MetaTileEntity_LargeBoiler> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_LargeBoiler>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { "ccc", "ccc", "ccc" }, { "ccc", "cPc", "ccc" }, - { "ccc", "cPc", "ccc" }, { "ccc", "cPc", "ccc" }, - { "f~f", "fff", "fff" }, })) - .addElement('P', lazy(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) - .addElement( - 'c', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_LargeBoiler.class).atLeast(OutputHatch) - .casingIndex( - t.getCasingTextureIndex()) - .dot(2) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_LargeBoiler::onCasingAdded, - ofBlock( - t.getCasingBlock(), - t.getCasingMeta()))))) - .addElement( - 'f', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_LargeBoiler.class).atLeast( - Maintenance, - InputHatch, - InputBus, - Muffler) - .casingIndex( - t.getFireboxTextureIndex()) - .dot(1) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_LargeBoiler::onFireboxAdded, - ofBlock( - t.getFireboxBlock(), - t.getFireboxMeta()))))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "ccc", "ccc", "ccc" }, { "ccc", "cPc", "ccc" }, { "ccc", "cPc", "ccc" }, + { "ccc", "cPc", "ccc" }, { "f~f", "fff", "fff" }, })) + .addElement('P', lazy(t -> ofBlock(t.getPipeBlock(), t.getPipeMeta()))) + .addElement( + 'c', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class).atLeast(OutputHatch) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_LargeBoiler::onCasingAdded, + ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + .addElement( + 'f', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_LargeBoiler.class) + .atLeast(Maintenance, InputHatch, InputBus, Muffler) + .casingIndex(t.getFireboxTextureIndex()) + .dot(1) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_LargeBoiler::onFireboxAdded, + ofBlock(t.getFireboxBlock(), t.getFireboxMeta()))))) + .build(); } }; private boolean firstRun = true; @@ -117,46 +105,46 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Boiler") - .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler"); + .addInfo("Controller block for the Large " + getCasingMaterial() + " Boiler"); // Tooltip differs between the boilers that output Superheated Steam (Titanium and Tungstensteel) and the ones // that do not (Bronze and Steel) if (isSuperheated()) { tt.addInfo( - "Produces " + formatNumbers((getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam)) - + "L of Superheated Steam with 1 Coal at " - + formatNumbers((getEUt() * 40L) / superToNormalSteam) - + "L/s") // ? - .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") - .addInfo("Only some solid fuels are allowed (check the NEI Large Boiler tab for details)") - .addInfo("If there are any disallowed fuels in the input bus, the boiler won't run!"); + "Produces " + formatNumbers((getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam)) + + "L of Superheated Steam with 1 Coal at " + + formatNumbers((getEUt() * 40L) / superToNormalSteam) + + "L/s") // ? + .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") + .addInfo("Only some solid fuels are allowed (check the NEI Large Boiler tab for details)") + .addInfo("If there are any disallowed fuels in the input bus, the boiler won't run!"); } else { tt.addInfo( - "Produces " + formatNumbers((getEUt() * 40) * (runtimeBoost(20) / 20f)) - + "L of Steam with 1 Coal at " - + formatNumbers(getEUt() * 40) - + "L/s") // ? - .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") - .addInfo("Solid Fuels with a burn value that is too high or too low will not work"); + "Produces " + formatNumbers((getEUt() * 40) * (runtimeBoost(20) / 20f)) + + "L of Steam with 1 Coal at " + + formatNumbers(getEUt() * 40) + + "L/s") // ? + .addInfo("A programmed circuit in the main block throttles the boiler (-1000L/s per config)") + .addInfo("Solid Fuels with a burn value that is too high or too low will not work"); } tt.addInfo( - String.format( - "Diesel fuels have 1/4 efficiency - Takes %s seconds to heat up", - formatNumbers(500.0 / getEfficiencyIncrease()))) // ? check semifluid again - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 5, 3, false) - .addController("Front bottom") - .addCasingInfoRange(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24, 31, false) // ? - .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") - .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") - .addMaintenanceHatch("Any firebox", 1) - .addMufflerHatch("Any firebox", 1) - .addInputBus("Solid fuel, Any firebox", 1) - .addInputHatch("Liquid fuel, Any firebox", 1) - .addStructureInfo("You can use either, or both") - .addInputHatch("Water, Any firebox", 1) - .addOutputHatch("Steam, any casing", 2) - .toolTipFinisher("Gregtech"); + String.format( + "Diesel fuels have 1/4 efficiency - Takes %s seconds to heat up", + formatNumbers(500.0 / getEfficiencyIncrease()))) // ? check semifluid again + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 5, 3, false) + .addController("Front bottom") + .addCasingInfoRange(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24, 31, false) // ? + .addOtherStructurePart(getCasingMaterial() + " Fire Boxes", "Bottom layer, 3 minimum") + .addOtherStructurePart(getCasingMaterial() + " Pipe Casing Blocks", "Inner 3 blocks") + .addMaintenanceHatch("Any firebox", 1) + .addMufflerHatch("Any firebox", 1) + .addInputBus("Solid fuel, Any firebox", 1) + .addInputHatch("Liquid fuel, Any firebox", 1) + .addStructureInfo("You can use either, or both") + .addInputHatch("Water, Any firebox", 1) + .addOutputHatch("Steam, any casing", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -193,35 +181,34 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends public int getPollutionPerSecond(ItemStack aStack) { // allows for 0 pollution if circuit throttle is too high return Math.max( - 0, - (int) (pollutionPerSecond - * (1 - GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * getIntegratedCircuitConfig()))); + 0, + (int) (pollutionPerSecond + * (1 - GT_Mod.gregtechproxy.mPollutionReleasedByThrottle * getIntegratedCircuitConfig()))); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.getCasingTextureForId(getCasingTextureIndex()), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.getCasingTextureForId(getCasingTextureIndex()), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_LARGE_BOILER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_LARGE_BOILER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_BOILER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) }; } @@ -235,7 +222,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends if (!isSuperheated()) return true; for (ItemStack input : getStoredInputs()) { if (!GT_Recipe.GT_Recipe_Map_LargeBoilerFakeFuels.isAllowedSolidFuel(input) - && !Circuit_Integrated.isStackEqual(input, true, true)) { + && !Circuit_Integrated.isStackEqual(input, true, true)) { // if any item is not in ALLOWED_SOLID_FUELS, operation cannot be allowed because it might still be // consumed this.mMaxProgresstime = 0; @@ -281,7 +268,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends tFluid.amount = 1000; if (depleteInput(tFluid)) { this.mMaxProgresstime = adjustBurnTimeForConfig( - Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); + Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); this.mEUt = adjustEUtForConfig(getEUt()); this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); return true; @@ -296,7 +283,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends for (ItemStack tInput : tInputList) { if (tInput != GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Lava, 1)) { if (GT_Utility.getFluidForFilledItem(tInput, true) == null - && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { + && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) { this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; @@ -320,9 +307,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends // Solid fuels with burn values below getEUt are ignored (mostly items like sticks), and also // those with very high fuel values that would cause an overflow error. if (GT_Utility.getFluidForFilledItem(tInput, true) == null - && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0 - && (GT_ModHandler.getFuelValue(tInput) * 2 / this.getEUt()) > 1 - && GT_ModHandler.getFuelValue(tInput) < 100000000) { + && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0 + && (GT_ModHandler.getFuelValue(tInput) * 2 / this.getEUt()) > 1 + && GT_ModHandler.getFuelValue(tInput) < 100000000) { this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80; this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; @@ -357,10 +344,10 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if (this.mSuperEfficencyIncrease > 0) mEfficiency = Math.max( - 0, - Math.min( - mEfficiency + mSuperEfficencyIncrease, - getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); + 0, + Math.min( + mEfficiency + mSuperEfficencyIncrease, + getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { long amount = (tGeneratedEU + STEAM_PER_WATER) / STEAM_PER_WATER; @@ -371,18 +358,18 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends // Consumes only one third of the water if producing Superheated Steam, to maintain water in the // chain. if (depleteInput(Materials.Water.getFluid(amount / superToNormalSteam)) - || depleteInput(GT_ModHandler.getDistilledWater(amount / superToNormalSteam))) { + || depleteInput(GT_ModHandler.getDistilledWater(amount / superToNormalSteam))) { // Outputs Superheated Steam instead of Steam, at one third of the amount (equivalent in power // output to the normal Steam amount). addOutput( - FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU / superToNormalSteam)); + FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU / superToNormalSteam)); } else { GT_Log.exp.println("Boiler " + this.mName + " had no Water!"); explodeMultiblock(); } } else { if (depleteInput(Materials.Water.getFluid(amount)) - || depleteInput(GT_ModHandler.getDistilledWater(amount))) { + || depleteInput(GT_ModHandler.getDistilledWater(amount))) { addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } else { GT_Log.exp.println("Boiler " + this.mName + " had no Water!"); @@ -416,9 +403,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends if (mProgresstime > 0 && firstRun) { firstRun = false; GT_Mod.achievements.issueAchievement( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), - "extremepressure"); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "extremepressure"); } super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -441,9 +428,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler extends mCasingAmount = 0; mFireboxAmount = 0; return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0) && mCasingAmount >= 24 - && mFireboxAmount >= 3 - && mMaintenanceHatches.size() == 1 - && !mMufflerHatches.isEmpty(); + && mFireboxAmount >= 3 + && mMaintenanceHatches.size() == 1 + && !mMufflerHatches.isEmpty(); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java index 4c717a85a8..ee7821ddb8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java @@ -37,70 +37,39 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Single_Recipe_Check; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_LargeChemicalReactor - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeChemicalReactor> - implements ISurvivalConstructable { +public class GT_MetaTileEntity_LargeChemicalReactor extends + GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeChemicalReactor> implements ISurvivalConstructable { private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_LargeChemicalReactor>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ccc", "cxc", - "ccc" }, - { "c~c", "xPx", - "cxc" }, - { "ccc", "cxc", - "ccc" }, })) - .addElement( - 'P', - ofBlock( - GregTech_API.sBlockCasings8, - 1)) - .addElement( - 'c', - buildHatchAdder( - GT_MetaTileEntity_LargeChemicalReactor.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings8, - 0)))) - .addElement( - 'x', - buildHatchAdder( - GT_MetaTileEntity_LargeChemicalReactor.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .buildAndChain( - CoilStructureElement.INSTANCE, - onElementPass( - GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings8, - 0)))) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_LargeChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_LargeChemicalReactor>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose(new String[][] { { "ccc", "cxc", "ccc" }, { "c~c", "xPx", "cxc" }, { "ccc", "cxc", "ccc" }, })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement( + 'c', + buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings8, 0)))) + .addElement( + 'x', + buildHatchAdder(GT_MetaTileEntity_LargeChemicalReactor.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + CoilStructureElement.INSTANCE, + onElementPass( + GT_MetaTileEntity_LargeChemicalReactor::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings8, 0)))) + .build(); private int mCasingAmount; private int mCoilAmount; @@ -122,50 +91,48 @@ public class GT_MetaTileEntity_LargeChemicalReactor public GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Chemical Reactor") - .addInfo("Controller block for the Large Chemical Reactor") - .addInfo("Does not lose efficiency when overclocked") - .addInfo("Accepts fluids instead of fluid cells") - .addSeparator() - .beginStructureBlock(3, 3, 3, false) - .addController("Front center") - .addCasingInfoRange("Chemically Inert Machine Casing", 8, 22, false) - .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") - .addOtherStructurePart("Heating Coil", "Adjacent to the PTFE Pipe Machine Casing", 1) - .addEnergyHatch("Any casing", 1, 2) - .addMaintenanceHatch("Any casing", 1, 2) - .addInputBus("Any casing", 1, 2) - .addInputHatch("Any casing", 1, 2) - .addOutputBus("Any casing", 1, 2) - .addOutputHatch("Any casing", 1, 2) - .addStructureInfo("You can have multiple hatches/busses") - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large Chemical Reactor") + .addInfo("Does not lose efficiency when overclocked") + .addInfo("Accepts fluids instead of fluid cells") + .addSeparator() + .beginStructureBlock(3, 3, 3, false) + .addController("Front center") + .addCasingInfoRange("Chemically Inert Machine Casing", 8, 22, false) + .addOtherStructurePart("PTFE Pipe Machine Casing", "Center") + .addOtherStructurePart("Heating Coil", "Adjacent to the PTFE Pipe Machine Casing", 1) + .addEnergyHatch("Any casing", 1, 2) + .addMaintenanceHatch("Any casing", 1, 2) + .addInputBus("Any casing", 1, 2) + .addInputHatch("Any casing", 1, 2) + .addOutputBus("Any casing", 1, 2) + .addOutputHatch("Any casing", 1, 2) + .addStructureInfo("You can have multiple hatches/busses") + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[1][48], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[1][48], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[1][48] }; } @@ -212,16 +179,16 @@ public class GT_MetaTileEntity_LargeChemicalReactor // We're locked to a single recipe, but haven't built the recipe checker yet. // Build the checker on next successful recipe. tSingleRecipeCheckBuilder = GT_Single_Recipe_Check.builder(this) - .setBefore(); + .setBefore(); } tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - false, - gregtech.api.enums.GT_Values.V[tier], - fluids, - inputs); + getBaseMetaTileEntity(), + false, + false, + gregtech.api.enums.GT_Values.V[tier], + fluids, + inputs); if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, fluids, inputs)) { return false; @@ -229,8 +196,8 @@ public class GT_MetaTileEntity_LargeChemicalReactor if (mLockedToSingleRecipe) { mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter() - .setRecipe(tRecipe) - .build(); + .setRecipe(tRecipe) + .build(); } } @@ -268,9 +235,9 @@ public class GT_MetaTileEntity_LargeChemicalReactor mCasingAmount = 0; mCoilAmount = 0; return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) && mCasingAmount >= 8 - && mCoilAmount == 1 - && !mEnergyHatches.isEmpty() - && mMaintenanceHatches.size() == 1; + && mCoilAmount == 1 + && !mEnergyHatches.isEmpty() + && mMaintenanceHatches.size() == 1; } @Override @@ -309,7 +276,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor public boolean check(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); if (block instanceof IHeatingCoil - && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) != HeatingCoilLevel.None) { + && ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z)) != HeatingCoilLevel.None) { return t.mCoilAmount++ == 0; } else { return false; @@ -318,14 +285,14 @@ public class GT_MetaTileEntity_LargeChemicalReactor @Override public boolean spawnHint(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, - ItemStack trigger) { + ItemStack trigger) { StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockCasings5, 0); return true; } @Override public boolean placeBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, - ItemStack trigger) { + ItemStack trigger) { if (t.mCoilAmount > 0) return false; boolean b = world.setBlock(x, y, z, GregTech_API.sBlockCasings5, 0, 3); if (b) t.mCoilAmount++; @@ -334,41 +301,41 @@ public class GT_MetaTileEntity_LargeChemicalReactor @Override public PlaceResult survivalPlaceBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, - int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { return survivalPlaceBlock(t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter)); } @Override public BlocksToPlace getBlocksToPlace( - GT_MetaTileEntity_LargeChemicalReactor gt_metaTileEntity_largeChemicalReactor, World world, int x, - int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + GT_MetaTileEntity_LargeChemicalReactor gt_metaTileEntity_largeChemicalReactor, World world, int x, int y, + int z, ItemStack trigger, AutoPlaceEnvironment env) { return BlocksToPlace.create( - IntStream.range(0, 8) - .mapToObj(i -> new ItemStack(GregTech_API.sBlockCasings5, 1, i)) - .collect(Collectors.toList())); + IntStream.range(0, 8) + .mapToObj(i -> new ItemStack(GregTech_API.sBlockCasings5, 1, i)) + .collect(Collectors.toList())); } @Override public PlaceResult survivalPlaceBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, - int z, ItemStack trigger, AutoPlaceEnvironment env) { + int z, ItemStack trigger, AutoPlaceEnvironment env) { if (t.mCoilAmount > 0) return PlaceResult.SKIP; if (check(t, world, x, y, z)) return PlaceResult.SKIP; if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return PlaceResult.REJECT; ItemStack result = env.getSource() - .takeOne(ItemStackPredicate.from(GregTech_API.sBlockCasings5), true); + .takeOne(ItemStackPredicate.from(GregTech_API.sBlockCasings5), true); if (result == null) return PlaceResult.REJECT; PlaceResult ret = StructureUtility.survivalPlaceBlock( - result, - ItemStackPredicate.NBTMode.EXACT, - null, - true, - world, - x, - y, - z, - env.getSource(), - env.getActor(), - env.getChatter()); + result, + ItemStackPredicate.NBTMode.EXACT, + null, + true, + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); if (ret == PlaceResult.ACCEPT) t.mCoilAmount++; return ret; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java index d14b06313f..8ffd401646 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java @@ -40,8 +40,8 @@ import gregtech.api.util.LightingHelper; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.render.GT_RenderUtil; -public abstract class GT_MetaTileEntity_LargeTurbine extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbine> implements ISurvivalConstructable { +public abstract class GT_MetaTileEntity_LargeTurbine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_LargeTurbine> implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>> STRUCTURE_DEFINITION = new ClassValue<>() { @@ -49,34 +49,25 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends @Override protected IStructureDefinition<GT_MetaTileEntity_LargeTurbine> computeValue(Class<?> type) { return StructureDefinition.<GT_MetaTileEntity_LargeTurbine>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { { " ", " ", " ", " ", " ", }, - { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, - { " --- ", " c~c ", " h-h ", " h-h ", " hdh ", }, - { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, - { " ", " ", " ", " ", " ", }, })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) - .addElement( - 'h', - lazy( - t -> buildHatchAdder( - GT_MetaTileEntity_LargeTurbine.class).atLeast( - Maintenance, - InputHatch, - OutputHatch, - OutputBus, - InputBus, - Muffler) - .casingIndex( - t.getCasingTextureIndex()) - .dot(2) - .buildAndChain( - t.getCasingBlock(), - t.getCasingMeta()))) - .build(); + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ", " ", " ", " ", " ", }, + { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, + { " --- ", " c~c ", " h-h ", " h-h ", " hdh ", }, + { " --- ", " ccc ", " hhh ", " hhh ", " hhh ", }, + { " ", " ", " ", " ", " ", }, })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('d', lazy(t -> Dynamo.newAny(t.getCasingTextureIndex(), 1))) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GT_MetaTileEntity_LargeTurbine.class) + .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + .casingIndex(t.getCasingTextureIndex()) + .dot(2) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .build(); } }; @@ -116,7 +107,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1 - && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0); + && mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0); } public abstract Block getCasingBlock(); @@ -172,21 +163,21 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends // we skip the occlusion test, as we always require a working turbine to have a block of air before it // so the front face cannot be occluded whatsoever in the most cases. Tessellator.instance.setBrightness( - tBlock.getMixedBrightnessForBlock( - aWorld, - aX + tDirection.offsetX, - tY + tDirection.offsetY, - aZ + tDirection.offsetZ)); + tBlock.getMixedBrightnessForBlock( + aWorld, + aX + tDirection.offsetX, + tY + tDirection.offsetY, + aZ + tDirection.offsetZ)); tLighting.setupLighting(tBlock, tX, tY, tZ, tFacing) - .setupColor(tFacing, Dyes._NULL.mRGBa); + .setupColor(tFacing, Dyes._NULL.mRGBa); GT_RenderUtil.renderBlockIcon( - aRenderer, - tBlock, - tX + tDirection.offsetX * 0.01, - tY + tDirection.offsetY * 0.01, - tZ + tDirection.offsetZ * 0.01, - tTextures[i].getIcon(), - tFacing); + aRenderer, + tBlock, + tX + tDirection.offsetX * 0.01, + tY + tDirection.offsetY * 0.01, + tZ + tDirection.offsetZ * 0.01, + tTextures[i].getIcon(), + tFacing); } if (++tABCCoord[0] == 2) { tABCCoord[0] = -1; @@ -213,9 +204,9 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends @Override public boolean addToMachineList(IGregTechTileEntity tTileEntity, int aBaseCasingIndex) { return addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex()) - || addInputToMachineList(tTileEntity, getCasingTextureIndex()) - || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) - || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); + || addInputToMachineList(tTileEntity, getCasingTextureIndex()) + || addOutputToMachineList(tTileEntity, getCasingTextureIndex()) + || addMufflerToMachineList(tTileEntity, getCasingTextureIndex()); } @Override @@ -231,8 +222,8 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends @Override public boolean checkRecipe(ItemStack aStack) { if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) - || aStack.getItemDamage() < 170 - || aStack.getItemDamage() > 179)) { + || aStack.getItemDamage() < 170 + || aStack.getItemDamage() > 179)) { stopMachine(); return false; } @@ -240,21 +231,21 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends if (!tFluids.isEmpty()) { if (baseEff == 0 || optFlow == 0 - || counter >= 512 - || this.getBaseMetaTileEntity() - .hasWorkJustBeenEnabled() - || this.getBaseMetaTileEntity() - .hasInventoryBeenModified()) { + || counter >= 512 + || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity() + .hasInventoryBeenModified()) { counter = 0; baseEff = GT_Utility.safeInt( - (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = GT_Utility.safeInt( + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + optFlow = GT_Utility + .safeInt( (long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) - .getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50)); + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + .getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); overflowMultiplier = getOverflowMultiplier(aStack); @@ -301,7 +292,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends } abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, - float[] flowMultipliers); + float[] flowMultipliers); abstract float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier); @@ -361,21 +352,21 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends } String tRunning = mMaxProgresstime > 0 - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") + + EnumChatFormatting.RESET; String tMaintainance = getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { tDura = GT_Utility.safeInt( - (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) - * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); + (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) + * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); } long storedEnergy = 0; @@ -383,73 +374,70 @@ public abstract class GT_MetaTileEntity_LargeTurbine extends for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } String[] ret = new String[] { - // 8 Lines available for information panels - tRunning + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(((long) mEUt * mEfficiency) / 10000) - + EnumChatFormatting.RESET - + " EU/t", /* 1 */ - tMaintainance, /* 2 */ - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) - + EnumChatFormatting.RESET - + "%", /* 2 */ - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + /* 3 */ EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) - + EnumChatFormatting.RESET - + " L/t" - + /* 4 */ EnumChatFormatting.YELLOW - + " (" - + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") - : StatCollector.translateToLocal("GT5U.turbine.tight")) - + ")", /* 5 */ - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(storedFluid) - + EnumChatFormatting.RESET - + "L", /* 6 */ - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " - + EnumChatFormatting.RED - + tDura - + EnumChatFormatting.RESET - + "%", /* 7 */ - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" /* 8 */ + // 8 Lines available for information panels + tRunning + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(((long) mEUt * mEfficiency) / 10000) + + EnumChatFormatting.RESET + + " EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.RESET + + "%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + /* 3 */ EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + + EnumChatFormatting.RESET + + " L/t" + + /* 4 */ EnumChatFormatting.YELLOW + + " (" + + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + + EnumChatFormatting.RESET + + "L", /* 6 */ + StatCollector.translateToLocal( + "GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + tDura + EnumChatFormatting.RESET + "%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" /* 8 */ }; if (!this.getClass() - .getName() - .contains("Steam")) + .getName() + .contains("Steam")) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.safeInt((long) realOptFlow) - + EnumChatFormatting.RESET - + " L/t"; + + EnumChatFormatting.YELLOW + + GT_Utility.safeInt((long) realOptFlow) + + EnumChatFormatting.RESET + + " L/t"; return ret; } public boolean hasTurbine() { return getBaseMetaTileEntity() != null && getBaseMetaTileEntity().isClientSide() ? mHasTurbine - : this.getMaxEfficiency(mInventory[1]) > 0; + : this.getMaxEfficiency(mInventory[1]) > 0; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index 6b7abb526e..d48f27a7a4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -31,39 +31,39 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], aFacing - == aSide ? (aActive ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_ACTIVE5) - .build() - : hasTurbine() ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW5) - .build() - : TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_EMPTY5) - .build()) - : casingTexturePages[0][58] }; + boolean aActive, boolean aRedstone) { + return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? (aActive ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_ACTIVE5) + .build() + : hasTurbine() ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW5) + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_EMPTY5) + .build()) + : casingTexturePages[0][58] }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Gas Turbine") - .addInfo("Controller block for the Large Gas Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Warning: Will be capped at 8192 EU/t in a future update") - .addInfo("See the Advanced Large Gas Turbine as the next, uncapped, option") - // .addInfo("The excess fuel that gets consumed will be voided!") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfoRange("Stainless Steel Turbine Casing", 8, 30, false) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addMufflerHatch("Side centered", 2) - .addInputHatch("Gas Fuel, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large Gas Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Warning: Will be capped at 8192 EU/t in a future update") + .addInfo("See the Advanced Large Gas Turbine as the next, uncapped, option") + // .addInfo("The excess fuel that gets consumed will be voided!") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoRange("Stainless Steel Turbine Casing", 8, 30, false) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addMufflerHatch("Side centered", 2) + .addInputHatch("Gas Fuel, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -106,7 +106,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, - float[] flowMultipliers) { + float[] flowMultipliers) { if (aFluids.size() >= 1) { int tEU = 0; int actualOptimalFlow = 0; @@ -189,7 +189,7 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT if (totalFlow > actualOptimalFlow) { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) - / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java index 559f7ae32f..81bd201b38 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java @@ -31,39 +31,39 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], aFacing - == aSide ? (aActive ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_ACTIVE5) - .build() - : hasTurbine() ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW5) - .build() - : TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_EMPTY5) - .build()) - : casingTexturePages[1][57] }; + boolean aActive, boolean aRedstone) { + return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? (aActive ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_ACTIVE5) + .build() + : hasTurbine() ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW5) + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_EMPTY5) + .build()) + : casingTexturePages[1][57] }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Gas Turbine") - .addInfo("Warning: This is an experimental multiblock, subject to changes ") - .addInfo("Controller block for the Large Advanced Gas Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Only accepts gases above 800k EU/bucket") - .addInfo("Has no maximum EU/t output, only depends on the Dynamo Hatch") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfoRange("Advanced Gas Turbine Casing", 8, 30, false) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addMufflerHatch("Side centered", 2) - .addInputHatch("Gas Fuel, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Warning: This is an experimental multiblock, subject to changes ") + .addInfo("Controller block for the Large Advanced Gas Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Only accepts gases above 800k EU/bucket") + .addInfo("Has no maximum EU/t output, only depends on the Dynamo Hatch") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoRange("Advanced Gas Turbine Casing", 8, 30, false) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addMufflerHatch("Side centered", 2) + .addInputHatch("Gas Fuel, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -106,7 +106,7 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, - float[] flowMultipliers) { + float[] flowMultipliers) { if (aFluids.size() >= 1) { int tEU = 0; int actualOptimalFlow = 0; @@ -187,7 +187,7 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit if (totalFlow > actualOptimalFlow) { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) - / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1)); } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index ef288cf1ec..fc1e7fe3ce 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -37,38 +37,38 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], aFacing - == aSide ? (aActive ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_ACTIVE5) - .build() - : hasTurbine() ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW5) - .build() - : TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_EMPTY5) - .build()) - : casingTexturePages[0][59] }; + boolean aActive, boolean aRedstone) { + return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? (aActive ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_ACTIVE5) + .build() + : hasTurbine() ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW5) + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_EMPTY5) + .build()) + : casingTexturePages[0][59] }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Steam Turbine") - .addInfo("Controller block for the Large High Pressure Steam Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Outputs Steam as well as producing power") - .addInfo("Power output depends on turbine and fitting") - .addInfo("Use screwdriver to adjust fitting of turbine") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfoRange("Titanium Turbine Casing", 8, 31, false) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addInputHatch("Superheated Steam, Side centered", 2) - .addOutputHatch("Steam, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large High Pressure Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Steam as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoRange("Titanium Turbine Casing", 8, 31, false) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Superheated Steam, Side centered", 2) + .addOutputHatch("Steam, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -99,7 +99,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency, - float[] flowMultipliers) { + float[] flowMultipliers) { if (looseFit) { float[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); aOptFlow = GT_Utility.safeInt((long) calculatedFlow[0]); @@ -133,12 +133,12 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La if (!achievement) { try { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity() - .getWorld() - .getPlayerEntityByName( - this.getBaseMetaTileEntity() - .getOwnerName()), - "efficientsteam"); + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity() + .getOwnerName()), + "efficientsteam"); } catch (Exception ignored) {} achievement = true; } @@ -153,9 +153,9 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); } else { float efficiency = getOverflowEfficiency( - totalFlow, - (GT_Utility.safeInt((long) realOptFlow)), - overflowMultiplier); + totalFlow, + (GT_Utility.safeInt((long) realOptFlow)), + overflowMultiplier); tEU *= efficiency; tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L)); } @@ -182,8 +182,8 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) - / ((float) actualOptimalFlow * (overflowMultiplier + 2)); + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * (overflowMultiplier + 2)); } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -196,9 +196,9 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, - looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") - : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); + aPlayer, + looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") + : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index e6a707b9a1..c6a4155b03 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -37,36 +37,36 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], aFacing - == aSide ? (aActive ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_ACTIVE5) - .build() - : hasTurbine() ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW5) - .build() - : TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_EMPTY5) - .build()) - : casingTexturePages[0][60] }; + boolean aActive, boolean aRedstone) { + return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? (aActive ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_ACTIVE5) + .build() + : hasTurbine() ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW5) + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_EMPTY5) + .build()) + : casingTexturePages[0][60] }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Plasma Turbine") - .addInfo("Controller block for the Large Plasma Generator") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Use your Fusion Reactor to produce the Plasma") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfoRange("Tungstensteel Turbine Casing", 8, 31, false) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addInputHatch("Plasma Fluid, Side centered", 2) - .addOutputHatch("Molten Fluid, optional, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large Plasma Generator") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Use your Fusion Reactor to produce the Plasma") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoRange("Tungstensteel Turbine Casing", 8, 31, false) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Plasma Fluid, Side centered", 2) + .addOutputHatch("Molten Fluid, optional, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -104,7 +104,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, - float[] flowMultipliers) { + float[] flowMultipliers) { if (aFluids.size() >= 1) { aOptFlow *= 800; // CHANGED THINGS HERE, check recipe runs once per 20 ticks int tEU = 0; @@ -114,8 +114,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. // Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); - actualOptimalFlow = GT_Utility.safeInt( - (long) Math.ceil((double) aOptFlow * flowMultipliers[2] / (double) fuelValue)); + actualOptimalFlow = GT_Utility + .safeInt((long) Math.ceil((double) aOptFlow * flowMultipliers[2] / (double) fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info // Allowed to use up to 550% optimal flow rate, depending on the value of overflowMultiplier. @@ -188,7 +188,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar if (totalFlow > actualOptimalFlow) { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) - / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1)); + / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1)); } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -199,30 +199,29 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar @Override public boolean checkRecipe(ItemStack aStack) { if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) - || aStack.getItemDamage() < 170 - || aStack.getItemDamage() > 179)) { + || aStack.getItemDamage() < 170 + || aStack.getItemDamage() > 179)) { stopMachine(); return false; } ArrayList<FluidStack> tFluids = getStoredFluids(); if (!tFluids.isEmpty()) { if (baseEff == 0 || optFlow == 0 - || counter >= 512 - || this.getBaseMetaTileEntity() - .hasWorkJustBeenEnabled() - || this.getBaseMetaTileEntity() - .hasInventoryBeenModified()) { + || counter >= 512 + || this.getBaseMetaTileEntity() + .hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity() + .hasInventoryBeenModified()) { counter = 0; baseEff = GT_Utility.safeInt( - (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + (long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); optFlow = GT_Utility.safeInt( - (long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) - .getSpeedMultiplier() - * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial( - aStack).mToolSpeed - * 50)); + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) + .getSpeedMultiplier() + * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed + * 50)); overflowMultiplier = getOverflowMultiplier(aStack); flowMultipliers[0] = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mSteamMultiplier; @@ -279,21 +278,21 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar } String tRunning = mMaxProgresstime > 0 - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") + + EnumChatFormatting.RESET; String tMaintainance = getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") - + EnumChatFormatting.RESET - : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") - + EnumChatFormatting.RESET; + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + + EnumChatFormatting.RESET + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + + EnumChatFormatting.RESET; int tDura = 0; if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { tDura = GT_Utility.safeInt( - (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) - * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); + (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) + * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1)); } long storedEnergy = 0; @@ -301,67 +300,64 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar for (GT_MetaTileEntity_Hatch_Dynamo tHatch : mDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } String[] ret = new String[] { - // 8 Lines available for information panels - tRunning + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(((long) mEUt * mEfficiency) / 10000) - + EnumChatFormatting.RESET - + " EU/t", /* 1 */ - tMaintainance, /* 2 */ - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " - + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) - + EnumChatFormatting.RESET - + "%", /* 2 */ - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + /* 3 */ EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) - + EnumChatFormatting.RESET - + " L/s" - + /* 4 */ EnumChatFormatting.YELLOW - + " (" - + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") - : StatCollector.translateToLocal("GT5U.turbine.tight")) - + ")", /* 5 */ - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " - + EnumChatFormatting.GOLD - + GT_Utility.formatNumbers(storedFluid) - + EnumChatFormatting.RESET - + "L", /* 6 */ - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " - + EnumChatFormatting.RED - + tDura - + EnumChatFormatting.RESET - + "%", /* 7 */ - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" /* 8 */ + // 8 Lines available for information panels + tRunning + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(((long) mEUt * mEfficiency) / 10000) + + EnumChatFormatting.RESET + + " EU/t", /* 1 */ + tMaintainance, /* 2 */ + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.RESET + + "%", /* 2 */ + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + /* 3 */ EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(GT_Utility.safeInt((long) realOptFlow)) + + EnumChatFormatting.RESET + + " L/s" + + /* 4 */ EnumChatFormatting.YELLOW + + " (" + + (looseFit ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", /* 5 */ + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(storedFluid) + + EnumChatFormatting.RESET + + "L", /* 6 */ + StatCollector.translateToLocal( + "GT5U.turbine.dmg") + ": " + EnumChatFormatting.RED + tDura + EnumChatFormatting.RESET + "%", /* 7 */ + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" /* 8 */ }; if (!this.getClass() - .getName() - .contains("Steam")) + .getName() + .contains("Steam")) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.safeInt((long) realOptFlow) - + EnumChatFormatting.RESET - + " L/s"; + + EnumChatFormatting.YELLOW + + GT_Utility.safeInt((long) realOptFlow) + + EnumChatFormatting.RESET + + " L/s"; return ret; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 1f5c7a5bb6..1a6a6f678a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -38,38 +38,38 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], aFacing - == aSide ? (aActive ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_ACTIVE5) - .build() - : hasTurbine() ? TextureFactory.builder() - .addIcon(LARGETURBINE_NEW5) - .build() - : TextureFactory.builder() - .addIcon(LARGETURBINE_NEW_EMPTY5) - .build()) - : casingTexturePages[0][57] }; + boolean aActive, boolean aRedstone) { + return new ITexture[] { MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? (aActive ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_ACTIVE5) + .build() + : hasTurbine() ? TextureFactory.builder() + .addIcon(LARGETURBINE_NEW5) + .build() + : TextureFactory.builder() + .addIcon(LARGETURBINE_NEW_EMPTY5) + .build()) + : casingTexturePages[0][57] }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Steam Turbine") - .addInfo("Controller block for the Large Steam Turbine") - .addInfo("Needs a Turbine, place inside controller") - .addInfo("Outputs Distilled Water as well as producing power") - .addInfo("Power output depends on turbine and fitting") - .addInfo("Use screwdriver to adjust fitting of turbine") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfoRange("Turbine Casing", 8, 31, false) - .addDynamoHatch("Back center", 1) - .addMaintenanceHatch("Side centered", 2) - .addInputHatch("Steam, Side centered", 2) - .addOutputHatch("Distilled Water, Side centered", 2) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Large Steam Turbine") + .addInfo("Needs a Turbine, place inside controller") + .addInfo("Outputs Distilled Water as well as producing power") + .addInfo("Power output depends on turbine and fitting") + .addInfo("Use screwdriver to adjust fitting of turbine") + .addSeparator() + .beginStructureBlock(3, 3, 4, true) + .addController("Front center") + .addCasingInfoRange("Turbine Casing", 8, 31, false) + .addDynamoHatch("Back center", 1) + .addMaintenanceHatch("Side centered", 2) + .addInputHatch("Steam, Side centered", 2) + .addOutputHatch("Distilled Water, Side centered", 2) + .toolTipFinisher("Gregtech"); return tt; } @@ -107,7 +107,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency, - float[] flowMultipliers) { + float[] flowMultipliers) { if (looseFit) { float[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff); aOptFlow = GT_Utility.safeInt((long) calculatedFlow[0]); @@ -141,12 +141,12 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg totalFlow += flow; // track total input used if (!achievement) { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity() - .getWorld() - .getPlayerEntityByName( - this.getBaseMetaTileEntity() - .getOwnerName()), - "muchsteam"); + this.getBaseMetaTileEntity() + .getWorld() + .getPlayerEntityByName( + this.getBaseMetaTileEntity() + .getOwnerName()), + "muchsteam"); achievement = true; } } else if (GT_ModHandler.isSuperHeatedSteam(aFluidStack)) { @@ -161,9 +161,9 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L); } else { float efficiency = getOverflowEfficiency( - totalFlow, - (GT_Utility.safeInt((long) realOptFlow)), - overflowMultiplier); + totalFlow, + (GT_Utility.safeInt((long) realOptFlow)), + overflowMultiplier); tEU *= efficiency; tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L)); } @@ -189,8 +189,8 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg float efficiency = 0; if (totalFlow > actualOptimalFlow) { - efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow)) - / ((float) actualOptimalFlow * (overflowMultiplier + 1)); + efficiency = 1.0f + - Math.abs((totalFlow - actualOptimalFlow)) / ((float) actualOptimalFlow * (overflowMultiplier + 1)); } else { efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); } @@ -237,9 +237,9 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, - looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") - : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); + aPlayer, + looseFit ? GT_Utility.trans("500", "Fitting: Loose - More Flow") + : GT_Utility.trans("501", "Fitting: Tight - More Efficiency")); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java index 0d90438020..c9f32c76f7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java @@ -41,58 +41,35 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_MultiFurnace extends - GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_MultiFurnace> implements ISurvivalConstructable { +public class GT_MetaTileEntity_MultiFurnace + extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_MultiFurnace> implements ISurvivalConstructable { private int mLevel = 0; private int mCostDiscount = 1; private static final int CASING_INDEX = 11; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_MultiFurnace> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_MultiFurnace>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "ccc", "cmc", - "ccc" }, - { "CCC", "C-C", - "CCC" }, - { "b~b", "bbb", - "bbb" } })) - .addElement( - 'c', - ofBlock( - GregTech_API.sBlockCasings1, - CASING_INDEX)) - .addElement( - 'm', - Muffler.newAny( - CASING_INDEX, - 2)) - .addElement( - 'C', - GT_StructureUtility.ofCoil( - GT_MetaTileEntity_MultiFurnace::setCoilLevel, - GT_MetaTileEntity_MultiFurnace::getCoilLevel)) - .addElement( - 'b', - ofChain( - GT_StructureUtility.<GT_MetaTileEntity_MultiFurnace>buildHatchAdder() - .atLeast( - Maintenance, - InputBus, - OutputBus, - Energy) - .casingIndex( - CASING_INDEX) - .dot( - 1) - .build(), - ofBlock( - GregTech_API.sBlockCasings1, - CASING_INDEX))) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_MultiFurnace> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_MultiFurnace>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose(new String[][] { { "ccc", "cmc", "ccc" }, { "CCC", "C-C", "CCC" }, { "b~b", "bbb", "bbb" } })) + .addElement('c', ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + GT_StructureUtility + .ofCoil(GT_MetaTileEntity_MultiFurnace::setCoilLevel, GT_MetaTileEntity_MultiFurnace::getCoilLevel)) + .addElement( + 'b', + ofChain( + GT_StructureUtility.<GT_MetaTileEntity_MultiFurnace>buildHatchAdder() + .atLeast(Maintenance, InputBus, OutputBus, Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .build(), + ofBlock(GregTech_API.sBlockCasings1, CASING_INDEX))) + .build(); public GT_MetaTileEntity_MultiFurnace(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -111,47 +88,46 @@ public class GT_MetaTileEntity_MultiFurnace extends protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Furnace") - .addInfo("Controller Block for the Multi Smelter") - .addInfo("Smelts up to 8-8192 items at once") - .addInfo("Items smelted increases with coil tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front bottom") - .addCasingInfoRange("Heat Proof Machine Casing", 8, 14, false) - .addOtherStructurePart("Heating Coils", "Middle layer") - .addEnergyHatch("Any bottom casing", 1) - .addMaintenanceHatch("Any bottom casing", 1) - .addMufflerHatch("Top Middle", 2) - .addInputBus("Any bottom casing", 1) - .addOutputBus("Any bottom casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Multi Smelter") + .addInfo("Smelts up to 8-8192 items at once") + .addInfo("Items smelted increases with coil tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front bottom") + .addCasingInfoRange("Heat Proof Machine Casing", 8, 14, false) + .addOtherStructurePart("Heating Coils", "Middle layer") + .addEnergyHatch("Any bottom casing", 1) + .addMaintenanceHatch("Any bottom casing", 1) + .addMufflerHatch("Top Middle", 2) + .addInputBus("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != aFacing) return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_MULTI_SMELTER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon(OVERLAY_FRONT_MULTI_SMELTER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_MULTI_SMELTER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_MULTI_SMELTER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_MULTI_SMELTER_GLOW) + .extFacing() + .glow() + .build() }; } @Override @@ -256,9 +232,9 @@ public class GT_MetaTileEntity_MultiFurnace extends if ((xPos == tX) && (zPos == tZ)) continue; tUsedMeta = aBaseMetaTileEntity.getMetaID(xPos, tY + 1, zPos); if (tUsedMeta >= 12 && tUsedMeta <= 14 - && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) + && aBaseMetaTileEntity.getBlock(xPos, tY + 1, zPos) == GregTech_API.sBlockCasings1) aBaseMetaTileEntity.getWorld() - .setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); + .setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); } } @@ -272,69 +248,69 @@ public class GT_MetaTileEntity_MultiFurnace extends long maxEnergy = 0; for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-mEUt) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxInputVoltage()) - + EnumChatFormatting.RESET - + " EU/t(*2A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(getMaxInputVoltage())] - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("GT5U.MS.multismelting") + ": " - + EnumChatFormatting.GREEN - + mLevel - + EnumChatFormatting.RESET - + " Discount: (EU/t) / " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mCostDiscount) - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %" }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.MS.multismelting") + ": " + + EnumChatFormatting.GREEN + + mLevel + + EnumChatFormatting.RESET + + " Discount: (EU/t) / " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mCostDiscount) + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; } @Override @@ -347,8 +323,8 @@ public class GT_MetaTileEntity_MultiFurnace extends IMetaTileEntity tMTE = aTileEntity.getMetaTileEntity(); if (tMTE == null) return false; return tMTE instanceof GT_MetaTileEntity_Hatch_Energy || tMTE instanceof GT_MetaTileEntity_Hatch_InputBus - || tMTE instanceof GT_MetaTileEntity_Hatch_OutputBus - || tMTE instanceof GT_MetaTileEntity_Hatch_Maintenance; + || tMTE instanceof GT_MetaTileEntity_Hatch_OutputBus + || tMTE instanceof GT_MetaTileEntity_Hatch_Maintenance; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java index c4d4c3548c..9d8912f0c5 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java @@ -46,13 +46,14 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Casings8; public class GT_MetaTileEntity_NanoForge extends - GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_NanoForge> implements ISurvivalConstructable { + GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_NanoForge> implements ISurvivalConstructable { private static final String STRUCTURE_PIECE_MAIN = "main"; private static final String STRUCTURE_PIECE_TIER2 = "tier2"; private static final String STRUCTURE_PIECE_TIER3 = "tier3"; - private static final IStructureDefinition<GT_MetaTileEntity_NanoForge> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_NanoForge>builder() - // spotless:off + private static final IStructureDefinition<GT_MetaTileEntity_NanoForge> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_NanoForge>builder() + // spotless:off .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { {" "," "," F "," C "," C "," C "," C "," F "," "," "}, {" "," "," F "," C "," C "," C "," C "," F "," "," "}, @@ -140,39 +141,17 @@ public class GT_MetaTileEntity_NanoForge extends {" CCCCCC ", "CCCCCCCC", "CCCCCCCC", "CCCCCCCC", "CCCCCCCC", "CCCCCCCC", "CCCCCCCC", " CCCCCC "} })) //spotless:on - .addElement( - 'F', - ofFrame( - Materials.StellarAlloy)) - .addElement( - 'C', - ofBlock( - GregTech_API.sBlockCasings8, - 10)) - .addElement( - 'A', - ofBlock( - GregTech_API.sBlockCasings2, - 5)) - .addElement( - 'B', - buildHatchAdder( - GT_MetaTileEntity_NanoForge.class).atLeast( - InputHatch, - OutputBus, - InputBus, - Maintenance, - Energy.or( - ExoticEnergy)) - .dot( - 1) - .casingIndex( - ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex( - 10)) - .buildAndChain( - GregTech_API.sBlockCasings8, - 10)) - .build(); + .addElement('F', ofFrame(Materials.StellarAlloy)) + .addElement('C', ofBlock(GregTech_API.sBlockCasings8, 10)) + .addElement('A', ofBlock(GregTech_API.sBlockCasings2, 5)) + .addElement( + 'B', + buildHatchAdder(GT_MetaTileEntity_NanoForge.class) + .atLeast(InputHatch, OutputBus, InputBus, Maintenance, Energy.or(ExoticEnergy)) + .dot(1) + .casingIndex(((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(10)) + .buildAndChain(GregTech_API.sBlockCasings8, 10)) + .build(); private byte mSpecialTier = 0; public GT_MetaTileEntity_NanoForge(int aID, String aName, String aNameRegional) { @@ -206,33 +185,33 @@ public class GT_MetaTileEntity_NanoForge extends @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { - BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { - BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) - .extFacing() - .glow() - .build() }; + BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { - BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)) }; + BlockIcons.getCasingTextureForId(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 10)) }; } @Override @@ -271,15 +250,8 @@ public class GT_MetaTileEntity_NanoForge extends mOutputItems = null; mOutputFluids = null; long tTotalEU = getMaxInputEu(); - GT_Recipe tRecipe = map.findRecipe( - getBaseMetaTileEntity(), - null, - false, - false, - tTotalEU, - tFluidInputs, - null, - tItemInputs); + GT_Recipe tRecipe = map + .findRecipe(getBaseMetaTileEntity(), null, false, false, tTotalEU, tFluidInputs, null, tItemInputs); if (tRecipe == null) return false; @@ -291,11 +263,11 @@ public class GT_MetaTileEntity_NanoForge extends this.mMaxProgresstime = tRecipe.mDuration; this.lEUt = -tRecipe.mEUt; calculateOverclockedNessMultiInternal( - tRecipe.mEUt, - tRecipe.mDuration, - 1, - tTotalEU, - tRecipe.mSpecialValue < mSpecialTier); + tRecipe.mEUt, + tRecipe.mDuration, + 1, + tTotalEU, + tRecipe.mSpecialValue < mSpecialTier); if (this.lEUt == Long.MAX_VALUE - 1 || this.mMaxProgresstime == Integer.MAX_VALUE - 1) return false; @@ -330,19 +302,19 @@ public class GT_MetaTileEntity_NanoForge extends } if (aStack.isItemEqual(Materials.Neutronium.getNanite(1)) && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1) - && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4)) { + && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4)) { mSpecialTier = 2; } if (aStack.isItemEqual(Materials.TranscendentMetal.getNanite(1)) && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1) - && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4) - && checkPiece(STRUCTURE_PIECE_TIER3, 14, 26, 4)) { + && checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4) + && checkPiece(STRUCTURE_PIECE_TIER3, 14, 26, 4)) { mSpecialTier = 3; } if (mMaintenanceHatches.size() != 1 || mInputBusses.isEmpty() - || mOutputBusses.isEmpty() - || mInputHatches.isEmpty()) { + || mOutputBusses.isEmpty() + || mInputHatches.isEmpty()) { return false; } @@ -406,111 +378,109 @@ public class GT_MetaTileEntity_NanoForge extends public IAlignmentLimits getAlignmentLimits() { // The nano forge should only be buildable upright return IAlignmentLimits.Builder.allowAll() - .deny(ForgeDirection.DOWN) - .deny(ForgeDirection.UP) - .deny(Rotation.UPSIDE_DOWN) - .deny(Rotation.CLOCKWISE) - .deny(Rotation.COUNTER_CLOCKWISE) - .build(); + .deny(ForgeDirection.DOWN) + .deny(ForgeDirection.UP) + .deny(Rotation.UPSIDE_DOWN) + .deny(Rotation.CLOCKWISE) + .deny(Rotation.COUNTER_CLOCKWISE) + .build(); } @Override protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) { super.drawTexts(screenElements, inventorySlot); - screenElements.widget( - new TextWidget( - StatCollector.translateToLocal("GT5U.gui.button.tier") + " " + mSpecialTier).setDefaultColor( - COLOR_TEXT_WHITE.get()) - .setEnabled( - widget -> getBaseMetaTileEntity().getErrorDisplayID() - == 0)) - .widget( - new FakeSyncWidget.IntegerSyncer( - () -> (int) mSpecialTier, - val -> mSpecialTier = (byte) (val % Byte.MAX_VALUE))); + screenElements + .widget( + new TextWidget(StatCollector.translateToLocal("GT5U.gui.button.tier") + " " + mSpecialTier) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0)) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> (int) mSpecialTier, + val -> mSpecialTier = (byte) (val % Byte.MAX_VALUE))); } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Nanite Fabricator") - .addInfo("Controller block for the Nano Forge") - .addInfo("Requires insane amounts of power to create nanites. Each tier") - .addInfo("the multi gains a new building next to it. The nanite in the") - .addInfo("controller slot controls the tier.") - .addInfo("--------------------------------------------") - .addInfo("Requires a Carbon Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 1) - .addInfo("Requires a Neutronium Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 2) - .addInfo("Requires a Transcendent Metal Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 3) - .addInfo("--------------------------------------------") - .addInfo("If a recipe's tier is lower than the tier of the Nano Forge") - .addInfo("it gains " + EnumChatFormatting.RED + "perfect overclock" + EnumChatFormatting.GRAY + ".") - .addInfo(AuthorBlueWeabo) - .addSeparator() - .beginStructureBlock(30, 38, 13, false) - .addStructureInfo("Nano Forge Structure is too complex! See schematic for details.") - .addStructureInfo("--------------------------------------------") - .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 1 + EnumChatFormatting.GRAY) - .addStructureInfo( - EnumChatFormatting.GOLD + "527" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "171" + EnumChatFormatting.GRAY + " Stellar Alloy Frame Box") - .addStructureInfo("--------------------------------------------") - .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 2 + EnumChatFormatting.GRAY) - .addStructureInfo( - EnumChatFormatting.GOLD + "148" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") - .addStructureInfo("--------------------------------------------") - .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 3 + EnumChatFormatting.GRAY) - .addStructureInfo( - EnumChatFormatting.GOLD + "228" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "84" + EnumChatFormatting.GRAY + " Stellar Alloy Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") - .addStructureInfo("--------------------------------------------") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + "1" - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + "2" - + EnumChatFormatting.GRAY - + " energy hatches or " - + EnumChatFormatting.GOLD - + "1" - + EnumChatFormatting.GRAY - + " TT energy hatch.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + 1 - + EnumChatFormatting.GRAY - + "+" - + EnumChatFormatting.GRAY - + " input hatches.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + 0 - + EnumChatFormatting.GRAY - + "+" - + EnumChatFormatting.GRAY - + " output hatches.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + 1 - + EnumChatFormatting.GRAY - + "+" - + EnumChatFormatting.GRAY - + " input busses.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + 1 - + EnumChatFormatting.GRAY - + "+" - + EnumChatFormatting.GRAY - + " output busses.") - .addStructureInfo("--------------------------------------------") - .toolTipFinisher("GregTech"); + .addInfo("Controller block for the Nano Forge") + .addInfo("Requires insane amounts of power to create nanites. Each tier") + .addInfo("the multi gains a new building next to it. The nanite in the") + .addInfo("controller slot controls the tier.") + .addInfo("--------------------------------------------") + .addInfo("Requires a Carbon Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 1) + .addInfo("Requires a Neutronium Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 2) + .addInfo("Requires a Transcendent Metal Nanite to use tier " + EnumChatFormatting.DARK_PURPLE + 3) + .addInfo("--------------------------------------------") + .addInfo("If a recipe's tier is lower than the tier of the Nano Forge") + .addInfo("it gains " + EnumChatFormatting.RED + "perfect overclock" + EnumChatFormatting.GRAY + ".") + .addInfo(AuthorBlueWeabo) + .addSeparator() + .beginStructureBlock(30, 38, 13, false) + .addStructureInfo("Nano Forge Structure is too complex! See schematic for details.") + .addStructureInfo("--------------------------------------------") + .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 1 + EnumChatFormatting.GRAY) + .addStructureInfo( + EnumChatFormatting.GOLD + "527" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "171" + EnumChatFormatting.GRAY + " Stellar Alloy Frame Box") + .addStructureInfo("--------------------------------------------") + .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 2 + EnumChatFormatting.GRAY) + .addStructureInfo( + EnumChatFormatting.GOLD + "148" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") + .addStructureInfo("--------------------------------------------") + .addStructureInfo("Tier " + EnumChatFormatting.DARK_PURPLE + 3 + EnumChatFormatting.GRAY) + .addStructureInfo( + EnumChatFormatting.GOLD + "228" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "84" + EnumChatFormatting.GRAY + " Stellar Alloy Frame Box") + .addStructureInfo(EnumChatFormatting.GOLD + "16" + EnumChatFormatting.GRAY + " Assembling Line Casing") + .addStructureInfo("--------------------------------------------") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + "1" + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + "2" + + EnumChatFormatting.GRAY + + " energy hatches or " + + EnumChatFormatting.GOLD + + "1" + + EnumChatFormatting.GRAY + + " TT energy hatch.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + 1 + + EnumChatFormatting.GRAY + + "+" + + EnumChatFormatting.GRAY + + " input hatches.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + 0 + + EnumChatFormatting.GRAY + + "+" + + EnumChatFormatting.GRAY + + " output hatches.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + 1 + + EnumChatFormatting.GRAY + + "+" + + EnumChatFormatting.GRAY + + " input busses.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + 1 + + EnumChatFormatting.GRAY + + "+" + + EnumChatFormatting.GRAY + + " output busses.") + .addStructureInfo("--------------------------------------------") + .toolTipFinisher("GregTech"); return tt; } @@ -518,8 +488,8 @@ public class GT_MetaTileEntity_NanoForge extends public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index 1f2feb3657..233e754548 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -38,86 +38,59 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_OilCracker> - implements ISurvivalConstructable { + implements ISurvivalConstructable { private static final byte CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_OilCracker> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_OilCracker>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - transpose( - new String[][] { - { "lcmcr", - "lcmcr", - "lcmcr" }, - { "lc~cr", - "l---r", - "lcmcr" }, - { "lcmcr", - "lcmcr", - "lcmcr" }, })) - .addElement( - 'c', - ofCoil( - GT_MetaTileEntity_OilCracker::setCoilLevel, - GT_MetaTileEntity_OilCracker::getCoilLevel)) - .addElement( - 'l', - buildHatchAdder( - GT_MetaTileEntity_OilCracker.class).atLeast( - GT_HatchElement.InputHatch.withAdder( - GT_MetaTileEntity_OilCracker::addLeftHatchToMachineList), - GT_HatchElement.Energy, - GT_HatchElement.Maintenance) - .dot( - 2) - .casingIndex( - CASING_INDEX) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_OilCracker::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings4, - 1)))) - .addElement( - 'r', - buildHatchAdder( - GT_MetaTileEntity_OilCracker.class).atLeast( - GT_HatchElement.OutputHatch.withAdder( - GT_MetaTileEntity_OilCracker::addRightHatchToMachineList), - GT_HatchElement.Energy, - GT_HatchElement.Maintenance) - .dot( - 3) - .casingIndex( - CASING_INDEX) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_OilCracker::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings4, - 1)))) - .addElement( - 'm', - buildHatchAdder( - GT_MetaTileEntity_OilCracker.class).atLeast( - GT_HatchElement.InputHatch.withAdder( - GT_MetaTileEntity_OilCracker::addMiddleInputToMachineList) - .withCount( - t -> t.mMiddleInputHatches.size()), - GT_HatchElement.Energy, - GT_HatchElement.Maintenance) - .dot( - 1) - .casingIndex( - CASING_INDEX) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_OilCracker::onCasingAdded, - ofBlock( - GregTech_API.sBlockCasings4, - 1)))) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_OilCracker> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_OilCracker>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { "lcmcr", "lcmcr", "lcmcr" }, { "lc~cr", "l---r", "lcmcr" }, + { "lcmcr", "lcmcr", "lcmcr" }, })) + .addElement('c', ofCoil(GT_MetaTileEntity_OilCracker::setCoilLevel, GT_MetaTileEntity_OilCracker::getCoilLevel)) + .addElement( + 'l', + buildHatchAdder(GT_MetaTileEntity_OilCracker.class) + .atLeast( + GT_HatchElement.InputHatch.withAdder(GT_MetaTileEntity_OilCracker::addLeftHatchToMachineList), + GT_HatchElement.Energy, + GT_HatchElement.Maintenance) + .dot(2) + .casingIndex(CASING_INDEX) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'r', + buildHatchAdder(GT_MetaTileEntity_OilCracker.class) + .atLeast( + GT_HatchElement.OutputHatch.withAdder(GT_MetaTileEntity_OilCracker::addRightHatchToMachineList), + GT_HatchElement.Energy, + GT_HatchElement.Maintenance) + .dot(3) + .casingIndex(CASING_INDEX) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'm', + buildHatchAdder(GT_MetaTileEntity_OilCracker.class) + .atLeast( + GT_HatchElement.InputHatch.withAdder(GT_MetaTileEntity_OilCracker::addMiddleInputToMachineList) + .withCount(t -> t.mMiddleInputHatches.size()), + GT_HatchElement.Energy, + GT_HatchElement.Maintenance) + .dot(1) + .casingIndex(CASING_INDEX) + .buildAndChain( + onElementPass( + GT_MetaTileEntity_OilCracker::onCasingAdded, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .build(); private HeatingCoilLevel heatLevel; protected final List<GT_MetaTileEntity_Hatch_Input> mMiddleInputHatches = new ArrayList<>(); // 0 -> left, 1 -> right, any other -> not found @@ -137,55 +110,53 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Cracker") - .addInfo("Controller block for the Oil Cracking Unit") - .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") - .addInfo("More efficient than the Chemical Reactor") - .addInfo("Gives different benefits whether it hydro or steam-cracks:") - .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") - .addInfo("Steam - Outputs 50% more cracked fluid") - .addInfo("(Values compared to cracking in the Chemical Reactor)") - .addInfo("Place the appropriate circuit in the controller") - .addSeparator() - .beginStructureBlock(5, 3, 3, true) - .addController("Front center") - .addCasingInfoRange("Clean Stainless Steel Machine Casing", 18, 21, false) - .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") - .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") - .addEnergyHatch("Any casing", 1, 2, 3) - .addMaintenanceHatch("Any casing", 1, 2, 3) - .addInputHatch("Steam/Hydrogen ONLY, Any middle ring casing", 1) - .addInputHatch("Any left/right side casing", 2, 3) - .addOutputHatch("Any right/left side casing", 2, 3) - .addStructureInfo("Input/Output Hatches must be on opposite sides!") - .addStructureHint("GT5U.cracker.io_side") - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Oil Cracking Unit") + .addInfo("Thermally cracks heavy hydrocarbons into lighter fractions") + .addInfo("More efficient than the Chemical Reactor") + .addInfo("Gives different benefits whether it hydro or steam-cracks:") + .addInfo("Hydro - Consumes 20% less Hydrogen and outputs 25% more cracked fluid") + .addInfo("Steam - Outputs 50% more cracked fluid") + .addInfo("(Values compared to cracking in the Chemical Reactor)") + .addInfo("Place the appropriate circuit in the controller") + .addSeparator() + .beginStructureBlock(5, 3, 3, true) + .addController("Front center") + .addCasingInfoRange("Clean Stainless Steel Machine Casing", 18, 21, false) + .addOtherStructurePart("2 Rings of 8 Coils", "Each side of the controller") + .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") + .addEnergyHatch("Any casing", 1, 2, 3) + .addMaintenanceHatch("Any casing", 1, 2, 3) + .addInputHatch("Steam/Hydrogen ONLY, Any middle ring casing", 1) + .addInputHatch("Any left/right side casing", 2, 3) + .addOutputHatch("Any right/left side casing", 2, 3) + .addStructureInfo("Input/Output Hatches must be on opposite sides!") + .addStructureHint("GT5U.cracker.io_side") + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_OIL_CRACKER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][CASING_INDEX], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_OIL_CRACKER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { casingTexturePages[0][CASING_INDEX] }; } @@ -203,11 +174,11 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluidInputs, - mInventory[1]); + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluidInputs, + mInventory[1]); if (tRecipe == null) return false; @@ -319,10 +290,10 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult mOutputOnSide = -1; replaceDeprecatedCoils(aBaseMetaTileEntity); return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0) && mInputOnSide != -1 - && mOutputOnSide != -1 - && mCasingAmount >= 18 - && mMaintenanceHatches.size() == 1 - && !mMiddleInputHatches.isEmpty(); + && mOutputOnSide != -1 + && mCasingAmount >= 18 + && mMaintenanceHatches.size() == 1 + && !mMiddleInputHatches.isEmpty(); } @Override @@ -366,7 +337,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) continue; aBaseMetaTileEntity.getWorld() - .setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); + .setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java index 310703cd3f..c945e8c861 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java @@ -55,28 +55,26 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { getCasingTextureForId(casingTextureIndex), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_OIL_DRILL_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { getCasingTextureForId(casingTextureIndex), TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_OIL_DRILL) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_OIL_DRILL) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_DRILL_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { getCasingTextureForId(casingTextureIndex) }; } @@ -97,27 +95,27 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) { String casings = getCasingBlockItem().get(0) - .getDisplayName(); + .getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Pump") - .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) - .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") - .addInfo("Use a Screwdriver to configure range") - .addInfo("Use Programmed Circuits to ignore near exhausted oil field") - .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.") // doesn't - // work - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes or Circuits, optional, any base casing", 1) - .addOutputHatch("Any base casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Oil/Gas/Fluid Drilling Rig " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") + .addInfo("Use a Screwdriver to configure range") + .addInfo("Use Programmed Circuits to ignore near exhausted oil field") + .addInfo("If total circuit # is greater than output amount it will halt. If it worked right.") // doesn't + // work + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes or Circuits, optional, any base casing", 1) + .addOutputHatch("Any base casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @@ -140,12 +138,12 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D } if (oldChunkRange != chunkRangeConfig) mOilFieldChunks.clear(); GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + chunkRangeConfig - + "x" - + chunkRangeConfig - + StatCollector.translateToLocal("GT5U.machines.chunks")); // TODO Add translation support + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + + chunkRangeConfig + + "x" + + chunkRangeConfig + + StatCollector.translateToLocal("GT5U.machines.chunks")); // TODO Add translation support } @Override @@ -165,9 +163,9 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D int tier = Math.max(0, GT_Utility.getTier(getMaxInputVoltage())); this.mEUt = -7 << (tier << 1); // (1/4) A of current tier when at bottom (7/8) A of current tier while mining this.mMaxProgresstime = Math.max( - 1, - (workState == STATE_AT_BOTTOM ? (64 * (chunkRangeConfig * chunkRangeConfig)) >> (getMinTier() - 1) - : 120) >> tier); + 1, + (workState == STATE_AT_BOTTOM ? (64 * (chunkRangeConfig * chunkRangeConfig)) >> (getMinTier() - 1) : 120) + >> tier); } protected float computeSpeed() { @@ -176,7 +174,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { switch (tryLowerPipeState(true)) { case 0 -> { workState = STATE_DOWNWARD; @@ -222,9 +220,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D if (mOilFieldChunks.isEmpty()) { Chunk tChunk = getBaseMetaTileEntity().getWorld() - .getChunkFromBlockCoords( - getBaseMetaTileEntity().getXCoord(), - getBaseMetaTileEntity().getZCoord()); + .getChunkFromBlockCoords(getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); int range = chunkRangeConfig; int xChunk = Math.floorDiv(tChunk.xPosition, range) * range; // Java was written by idiots. For negative // values, / returns rounded towards zero. @@ -232,13 +228,13 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D int zChunk = Math.floorDiv(tChunk.zPosition, range) * range; if (debugDriller) { GT_Log.out.println( - "tChunk.xPosition = " + tChunk.xPosition - + " tChunk.zPosition = " - + tChunk.zPosition - + " xChunk = " - + xChunk - + " zChunk = " - + zChunk); + "tChunk.xPosition = " + tChunk.xPosition + + " tChunk.zPosition = " + + tChunk.zPosition + + " xChunk = " + + xChunk + + " zChunk = " + + zChunk); } for (int i = 0; i < range; i++) { for (int j = 0; j < range; j++) { @@ -246,12 +242,12 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D GT_Log.out.println(" getChunkX = " + (xChunk + i) + " getChunkZ = " + (zChunk + j)); } tChunk = getBaseMetaTileEntity().getWorld() - .getChunkFromChunkCoords(xChunk + i, zChunk + j); + .getChunkFromChunkCoords(xChunk + i, zChunk + j); tFluid = undergroundOilReadInformation(tChunk); if (debugDriller) { GT_Log.out.println( - " Fluid in chunk = " + tFluid.getFluid() - .getID()); + " Fluid in chunk = " + tFluid.getFluid() + .getID()); } if (tOil.isFluidEqual(tFluid) && tFluid.amount > 0) { mOilFieldChunks.add(tChunk); @@ -282,9 +278,9 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D tFluid = undergroundOil(tChunk, speed); if (debugDriller) { GT_Log.out.println( - " chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos - + " chunkZ = " - + tChunk.getChunkCoordIntPair().chunkZPos); + " chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos + + " chunkZ = " + + tChunk.getChunkCoordIntPair().chunkZPos); if (tFluid != null) { GT_Log.out.println(" Fluid pumped = " + tFluid.amount); } else { @@ -309,27 +305,25 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D @Override public String[] getInfoData() { List<String> l = new ArrayList<>( - Arrays.asList( - EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.oilfluidpump") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea") + ": " - + EnumChatFormatting.GREEN - + (chunkRangeConfig) - + " x " - + (chunkRangeConfig) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.machines.chunks"), - "Drilling fluid: " + EnumChatFormatting.GREEN - + (mOilId > 0 ? FluidRegistry.getFluid(mOilId) - .getName() - : "None") - + EnumChatFormatting.RESET, - "Drilling flow: " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers( - this.mMaxProgresstime > 0 ? (mOilFlow / this.mMaxProgresstime) : 0) - + EnumChatFormatting.RESET - + " L/t")); + Arrays.asList( + EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.oilfluidpump") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + + EnumChatFormatting.GREEN + + (chunkRangeConfig) + + " x " + + (chunkRangeConfig) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.machines.chunks"), + "Drilling fluid: " + EnumChatFormatting.GREEN + + (mOilId > 0 ? FluidRegistry.getFluid(mOilId) + .getName() : "None") + + EnumChatFormatting.RESET, + "Drilling flow: " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(this.mMaxProgresstime > 0 ? (mOilFlow / this.mMaxProgresstime) : 0) + + EnumChatFormatting.RESET + + " L/t")); l.addAll(Arrays.asList(super.getInfoData())); return l.toArray(new String[0]); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java index b92fcfae7f..2c86218bfb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java @@ -24,23 +24,23 @@ public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDri @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { String casings = getCasingBlockItem().get(0) - .getDisplayName(); + .getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Pump") - .addInfo("Controller Block for the Infinite Oil/Gas/Fluid Drilling Rig ") - .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes or Circuits, optional, any base casing", 1) - .addOutputHatch("Any base casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Infinite Oil/Gas/Fluid Drilling Rig ") + .addInfo("Works on " + getRangeInChunks() + "x" + getRangeInChunks() + " chunks") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes or Circuits, optional, any base casing", 1) + .addOutputHatch("Any base casing", 1) + .toolTipFinisher("Gregtech"); return tt; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index ba6a2604a5..de6b5c5144 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -86,16 +86,16 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile if (chunkRadiusConfig > getRadiusInChunks()) chunkRadiusConfig = 1; } GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.workareaset") + " " - + (chunkRadiusConfig << 4) - + " " - + StatCollector.translateToLocal("GT5U.machines.radius")); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + + (chunkRadiusConfig << 4) + + " " + + StatCollector.translateToLocal("GT5U.machines.radius")); } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { replaceWithCobblestone = !replaceWithCobblestone; GT_Utility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone); return true; @@ -103,7 +103,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile @Override protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (yHead != oldYHead) oreBlockPositions.clear(); if (mWorkChunkNeedsReload && mChunkLoadingEnabled) { // ask to load machine itself @@ -146,7 +146,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile if (GT_Utility.eraseBlockByFakePlayer(getFakePlayer(getBaseMetaTileEntity()), x, y, z, true)) oreBlock = getBaseMetaTileEntity().getBlock(x, y, z); oreBlockMetadata = getBaseMetaTileEntity().getWorld() - .getBlockMetadata(x, y, z); + .getBlockMetadata(x, y, z); } if (!tryConsumeDrillingFluid()) { @@ -164,19 +164,10 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile ItemStack cobble = GT_Utility.getCobbleForOre(oreBlock, metaData); if (replaceWithCobblestone) { getBaseMetaTileEntity().getWorld() - .setBlock( - x, - y, - z, - Block.getBlockFromItem(cobble.getItem()), - cobble.getItemDamage(), - 3); + .setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3); } else { getBaseMetaTileEntity().getWorld() - .setBlockToAir( - oreBlockPos.chunkPosX, - oreBlockPos.chunkPosY, - oreBlockPos.chunkPosZ); + .setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ); } mOutputItems = getOutputByDrops(oreBlockDrops); } @@ -185,7 +176,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile @Override protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (!mChunkLoadingEnabled) return super.workingAtBottom(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); @@ -217,15 +208,15 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile final int leftRight = (getXDrill() - (centerX << 4)) < 8 ? 0 : 1; final int topBottom = (getZDrill() - (centerZ << 4)) < 8 ? 0 : 1; mCurrentChunk = new ChunkCoordIntPair( - centerX - chunkRadiusConfig + leftRight, - centerZ - chunkRadiusConfig + topBottom); + centerX - chunkRadiusConfig + leftRight, + centerZ - chunkRadiusConfig + topBottom); GT_ChunkManager.requestChunkLoad((TileEntity) getBaseMetaTileEntity(), mCurrentChunk); mWorkChunkNeedsReload = false; } @Override protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, - int yHead, int oldYHead) { + int yHead, int oldYHead) { if (!mChunkLoadingEnabled || oreBlockPositions.isEmpty()) return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead); boolean result = processOreList(); @@ -263,17 +254,16 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile return false; } mCurrentChunk = new ChunkCoordIntPair(nextChunkX, nextChunkZ); - GT_ChunkManager.requestChunkLoad( - (TileEntity) getBaseMetaTileEntity(), - new ChunkCoordIntPair(nextChunkX, nextChunkZ)); + GT_ChunkManager + .requestChunkLoad((TileEntity) getBaseMetaTileEntity(), new ChunkCoordIntPair(nextChunkX, nextChunkZ)); return true; } @Override protected boolean checkHatches() { return !mMaintenanceHatches.isEmpty() && !mInputHatches.isEmpty() - && !mOutputBusses.isEmpty() - && !mEnergyHatches.isEmpty(); + && !mOutputBusses.isEmpty() + && !mEnergyHatches.isEmpty(); } @Override @@ -288,7 +278,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile int tier = Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEUt = -3 * (1 << (tier << 1)); this.mMaxProgresstime = ((workState == STATE_DOWNWARD || workState == STATE_AT_BOTTOM) ? getBaseProgressTime() - : 80) / (1 << tier); + : 80) / (1 << tier); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); } @@ -300,12 +290,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile outputItems.add(multiplyStackSize(currentItem)); return; } - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - voltage, - null, - currentItem); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes + .findRecipe(getBaseMetaTileEntity(), false, voltage, null, currentItem); if (tRecipe == null) { outputItems.add(currentItem); return; @@ -323,13 +309,13 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile private boolean doUseMaceratorRecipe(ItemStack currentItem) { ItemData itemData = GT_OreDictUnificator.getItemData(currentItem); return itemData == null || itemData.mPrefix != OrePrefixes.crushed && itemData.mPrefix != OrePrefixes.dustImpure - && itemData.mPrefix != OrePrefixes.dust - && itemData.mPrefix != OrePrefixes.gem - && itemData.mPrefix != OrePrefixes.gemChipped - && itemData.mPrefix != OrePrefixes.gemExquisite - && itemData.mPrefix != OrePrefixes.gemFlawed - && itemData.mPrefix != OrePrefixes.gemFlawless - && itemData.mMaterial.mMaterial != Materials.Oilsands; + && itemData.mPrefix != OrePrefixes.dust + && itemData.mPrefix != OrePrefixes.gem + && itemData.mPrefix != OrePrefixes.gemChipped + && itemData.mPrefix != OrePrefixes.gemExquisite + && itemData.mPrefix != OrePrefixes.gemFlawed + && itemData.mPrefix != OrePrefixes.gemFlawless + && itemData.mMaterial.mMaterial != Materials.Oilsands; } private ItemStack multiplyStackSize(ItemStack itemStack) { @@ -399,30 +385,30 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile protected GT_Multiblock_Tooltip_Builder createTooltip(String tierSuffix) { String casings = getCasingBlockItem().get(0) - .getDisplayName(); + .getDisplayName(); final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner") - .addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : "")) - .addInfo("Use a Screwdriver to configure block radius") - .addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks") - .addInfo("Use Soldering iron to turn off chunk mode") - .addInfo("Use Wire Cutter to toggle replacing mined blocks with cobblestone") - .addInfo("In chunk mode, working area center is the chunk corner nearest to the drill") - .addInfo("Gives ~3x as much crushed ore vs normal processing") - .addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores") - .addSeparator() - .beginStructureBlock(3, 7, 3, false) - .addController("Front bottom") - .addOtherStructurePart(casings, "form the 3x1x3 Base") - .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") - .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") - .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) - .addMaintenanceHatch("Any base casing", 1) - .addInputBus("Mining Pipes, optional, any base casing", 1) - .addInputHatch("Drilling Fluid, any base casing", 1) - .addOutputBus("Any base casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Ore Drilling Plant " + (tierSuffix != null ? tierSuffix : "")) + .addInfo("Use a Screwdriver to configure block radius") + .addInfo("Maximum radius is " + (getRadiusInChunks() << 4) + " blocks") + .addInfo("Use Soldering iron to turn off chunk mode") + .addInfo("Use Wire Cutter to toggle replacing mined blocks with cobblestone") + .addInfo("In chunk mode, working area center is the chunk corner nearest to the drill") + .addInfo("Gives ~3x as much crushed ore vs normal processing") + .addInfo("Fortune bonus of " + (mTier + 3) + ". Only works on small ores") + .addSeparator() + .beginStructureBlock(3, 7, 3, false) + .addController("Front bottom") + .addOtherStructurePart(casings, "form the 3x1x3 Base") + .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") + .addOtherStructurePart(getFrameMaterial().mName + " Frame Boxes", "Each pillar's side and 1x3x1 on top") + .addEnergyHatch(VN[getMinTier()] + "+, Any base casing", 1) + .addMaintenanceHatch("Any base casing", 1) + .addInputBus("Mining Pipes, optional, any base casing", 1) + .addInputHatch("Drilling Fluid, any base casing", 1) + .addOutputBus("Any base casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @@ -435,15 +421,15 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile public String[] getInfoData() { final int diameter = chunkRadiusConfig * 2; return new String[] { - EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.minermulti") - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.workarea") + ": " - + EnumChatFormatting.GREEN - + diameter - + "x" - + diameter - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.machines.chunks") }; + EnumChatFormatting.BLUE + StatCollector.translateToLocal("GT5U.machines.minermulti") + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.workarea") + ": " + + EnumChatFormatting.GREEN + + diameter + + "x" + + diameter + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.machines.chunks") }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java index 8e6508b465..759500b767 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java @@ -76,7 +76,7 @@ import gregtech.common.blocks.GT_Block_Casings8; @SuppressWarnings("SpellCheckingInspection") public class GT_MetaTileEntity_PCBFactory extends - GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_PCBFactory> implements ISurvivalConstructable { + GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_PCBFactory> implements ISurvivalConstructable { private static final String tier1 = "tier1"; private static final String tier2 = "tier2"; @@ -88,7 +88,7 @@ public class GT_MetaTileEntity_PCBFactory extends private int mTier = 1, mSetTier = 1, mUpgradesInstalled = 0, mCurrentParallel = 0, mMaxParallel = 0; private boolean mBioUpgrade = false, mBioRotate = false, mOCTier1 = false, mOCTier2 = false; private int[] mBioOffsets = new int[] { -5, -1 }, mOCTier1Offsets = new int[] { 2, -11 }, - mOCTier2Offsets = new int[] { 2, -11 }; + mOCTier2Offsets = new int[] { 2, -11 }; private GT_MetaTileEntity_Hatch_Input mCoolantInputHatch; private static final int mBioRotateBitMap = 0b1000000; private static final int mOCTier2BitMap = 0b100000; @@ -98,12 +98,13 @@ public class GT_MetaTileEntity_PCBFactory extends private static final int mTier2BitMap = 0b10; private static final int mTier1BitMap = 0b1; private static final int COOLANT_CONSUMED_PER_SEC = 10; - private static final IStructureDefinition<GT_MetaTileEntity_PCBFactory> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_PCBFactory>builder() - .addShape( - tier1, - transpose( - new String[][] { - // spotless:off + private static final IStructureDefinition<GT_MetaTileEntity_PCBFactory> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_PCBFactory>builder() + .addShape( + tier1, + transpose( + new String[][] { + // spotless:off {" ","E E","E E","EEEEEEE","E E","E E"," "}, {"EEEEEEE","CAAAAAC","CAAAAAC","CCCCCCC","CCCCCCC","CCCCCCC","E E"}, {"EAAAAAE","C-----C","C-----C","C-----C","C-----C","C-----C","ECCCCCE"}, @@ -111,12 +112,12 @@ public class GT_MetaTileEntity_PCBFactory extends {"EAAAAAE","C-----C","B-FFF-B","B-FFF-B","B-FFF-B","C-----C","EPPPPPE"}, {"ECC~CCE","CDDDDDC","CDDDDDC","CDDDDDC","CDDDDDC","CDDDDDC","EPPPPPE"} //spotless:on - })) - .addShape( - tier2, - transpose( - new String[][] { - // spotless:off + })) + .addShape( + tier2, + transpose( + new String[][] { + // spotless:off {" "," "," ","HGGH","HGGH","HGGH","HGGH","HGGH"," "," "," "}, {" "," ","HGGH","GGGG","GGGG","GGGG","GGGG","GGGG","HGGH"," "," "}, {" ","HGGH","GGGG","G G","G G","G G","G G","G G","GGGG","HGGH"," "}, @@ -125,12 +126,12 @@ public class GT_MetaTileEntity_PCBFactory extends {"HGGH","G G","G G","G G","G G","G G","G G","G G","G G","G G","HGGH"}, {"HGGH","GGGG","GGGG","GGGG","GGGG","GGGG","GGGG","GGGG","GGGG","GGGG","HGGH"} //spotless:on - })) - .addShape( - tier3, - transpose( - new String[][] { - // spotless:off + })) + .addShape( + tier3, + transpose( + new String[][] { + // spotless:off {" "," "," "," "," I "," I "," "," "," "," "}, {" "," "," "," I "," I "," I "," I "," "," "," "}, {" "," "," KKK "," KIK "," K K "," K K "," I "," "," "," "}, @@ -154,12 +155,12 @@ public class GT_MetaTileEntity_PCBFactory extends {" "," III "," I I "," I I "," I I "," I I "," I I "," I I "," III "," "}, {" II~II ","IIJJJII","IJJJJJI","IJJJJJI","IJJJJJI","IJJJJJI","IJJJJJI","IJJJJJI","IIJJJII"," IIIII "} //spotless:on - })) - .addShape( - bioUpgrade, - transpose( - new String[][] { - // spotless:off + })) + .addShape( + bioUpgrade, + transpose( + new String[][] { + // spotless:off {" "," "," LLLLLL "," "," "}, {" "," "," L L "," "," "}, {"E E E E"," LLL LLL "," LLL LLL "," LLL LLL ","E E E E"}, @@ -168,12 +169,12 @@ public class GT_MetaTileEntity_PCBFactory extends {"EAAAE EAAAE","A A A A","A A A A","A A A A","EAAAE EAAAE"}, {"ELLLE ELLLE","LLLLL LLLLL","LLLLL LLLLL","LLLLL LLLLL","ELLLE ELLLE"} //spotless:on - })) - .addShape( - ocTier1Upgrade, - transpose( - new String[][] { - // spotless:off + })) + .addShape( + ocTier1Upgrade, + transpose( + new String[][] { + // spotless:off {"EKKKE","K K","K K","K K","EKKKE"}, {"E E"," KKK "," K K "," KKK ","E E"}, {"E E"," NNN "," N N "," NNN ","E E"}, @@ -185,12 +186,12 @@ public class GT_MetaTileEntity_PCBFactory extends {"ENNNE","NKKKN","NK KN","NKKKN","ENNNE"}, {"EGGGE","GGGGG","GGMGG","GGGGG","EGGGE"} //spotless:on - })) - .addShape( - ocTier2Upgrade, - transpose( - new String[][] { - // spotless:off + })) + .addShape( + ocTier2Upgrade, + transpose( + new String[][] { + // spotless:off {"RGGGR","G G","G G","G G","RGGGR"}, {"R R"," GGG "," GTG "," GGG ","R R"}, {"R R"," NNN "," NTN "," NNN ","R R"}, @@ -202,172 +203,60 @@ public class GT_MetaTileEntity_PCBFactory extends {"RNNNR","NQQQN","NQTQN","NQQQN","RNNNR"}, {"RGGGR","GGGGG","GGSGG","GGGGG","RGGGR"} //spotless:on - })) - .addElement( - 'E', - ofFrame( - Materials.DamascusSteel)) - .addElement( - 'C', - ofBlock( - GregTech_API.sBlockCasings8, - 11)) - .addElement( - 'D', - ofBlock( - GregTech_API.sBlockReinforced, - 2)) - .addElement( - 'A', - ofChain( - ofBlockUnlocalizedName( - IndustrialCraft2.ID, - "blockAlloyGlass", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks", - 0, - true), - ofBlockUnlocalizedName( - BartWorks.ID, - "BW_GlasBlocks2", - 0, - true), - // warded - // glass - ofBlockUnlocalizedName( - Thaumcraft.ID, - "blockCosmeticOpaque", - 2, - false))) - .addElement( - 'B', - ofBlock( - GregTech_API.sBlockCasings3, - 10)) - .addElement( - 'F', - ofFrame( - Materials.VibrantAlloy)) - .addElement( - 'P', - buildHatchAdder( - GT_MetaTileEntity_PCBFactory.class).atLeast( - InputHatch, - OutputBus, - InputBus, - Maintenance, - Energy.or( - ExoticEnergy)) - .dot( - 1) - .casingIndex( - ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex( - 11)) - .buildAndChain( - GregTech_API.sBlockCasings8, - 11)) - .addElement( - 'H', - ofFrame( - Materials.Duranium)) - .addElement( - 'G', - ofBlock( - GregTech_API.sBlockCasings8, - 12)) - .addElement( - 'I', - ofBlock( - GregTech_API.sBlockCasings8, - 13)) - .addElement( - 'K', - ofBlock( - GregTech_API.sBlockCasings8, - 10)) - .addElement( - 'J', - buildHatchAdder( - GT_MetaTileEntity_PCBFactory.class).atLeast( - InputHatch, - OutputBus, - InputBus, - Maintenance, - Energy.or( - ExoticEnergy)) - .dot( - 1) - .casingIndex( - ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex( - 13)) - .buildAndChain( - GregTech_API.sBlockCasings8, - 13)) - .addElement( - 'L', - ofBlock( - GregTech_API.sBlockCasings4, - 1)) - .addElement( - 'M', - buildHatchAdder( - GT_MetaTileEntity_PCBFactory.class).hatchClass( - GT_MetaTileEntity_Hatch_Input.class) - .adder( - GT_MetaTileEntity_PCBFactory::addCoolantInputToMachineList) - .casingIndex( - GT_Utility.getCasingTextureIndex( - GregTech_API.sBlockCasings8, - 12)) - .dot( - 2) - .buildAndChain( - GregTech_API.sBlockCasings8, - 12)) - .addElement( - 'N', - ofBlock( - GregTech_API.sBlockCasings2, - 15)) - .addElement( - 'O', - ofBlock( - GregTech_API.sBlockCasings8, - 4)) - .addElement( - 'S', - buildHatchAdder( - GT_MetaTileEntity_PCBFactory.class).hatchClass( - GT_MetaTileEntity_Hatch_Input.class) - .adder( - GT_MetaTileEntity_PCBFactory::addCoolantInputToMachineList) - .casingIndex( - GT_Utility.getCasingTextureIndex( - GregTech_API.sBlockCasings8, - 12)) - .dot( - 2) - .buildAndChain( - GregTech_API.sBlockCasings8, - 12)) - .addElement( - 'R', - ofFrame( - Materials.Americium)) - .addElement( - 'Q', - ofBlock( - GregTech_API.sBlockCasings8, - 14)) - .addElement( - 'T', - ofBlock( - GregTech_API.sBlockCasings1, - 15)) - .build(); + })) + .addElement('E', ofFrame(Materials.DamascusSteel)) + .addElement('C', ofBlock(GregTech_API.sBlockCasings8, 11)) + .addElement('D', ofBlock(GregTech_API.sBlockReinforced, 2)) + .addElement( + 'A', + ofChain( + ofBlockUnlocalizedName(IndustrialCraft2.ID, "blockAlloyGlass", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks", 0, true), + ofBlockUnlocalizedName(BartWorks.ID, "BW_GlasBlocks2", 0, true), + // warded + // glass + ofBlockUnlocalizedName(Thaumcraft.ID, "blockCosmeticOpaque", 2, false))) + .addElement('B', ofBlock(GregTech_API.sBlockCasings3, 10)) + .addElement('F', ofFrame(Materials.VibrantAlloy)) + .addElement( + 'P', + buildHatchAdder(GT_MetaTileEntity_PCBFactory.class) + .atLeast(InputHatch, OutputBus, InputBus, Maintenance, Energy.or(ExoticEnergy)) + .dot(1) + .casingIndex(((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(11)) + .buildAndChain(GregTech_API.sBlockCasings8, 11)) + .addElement('H', ofFrame(Materials.Duranium)) + .addElement('G', ofBlock(GregTech_API.sBlockCasings8, 12)) + .addElement('I', ofBlock(GregTech_API.sBlockCasings8, 13)) + .addElement('K', ofBlock(GregTech_API.sBlockCasings8, 10)) + .addElement( + 'J', + buildHatchAdder(GT_MetaTileEntity_PCBFactory.class) + .atLeast(InputHatch, OutputBus, InputBus, Maintenance, Energy.or(ExoticEnergy)) + .dot(1) + .casingIndex(((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(13)) + .buildAndChain(GregTech_API.sBlockCasings8, 13)) + .addElement('L', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'M', + buildHatchAdder(GT_MetaTileEntity_PCBFactory.class).hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GT_MetaTileEntity_PCBFactory::addCoolantInputToMachineList) + .casingIndex(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 12)) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings8, 12)) + .addElement('N', ofBlock(GregTech_API.sBlockCasings2, 15)) + .addElement('O', ofBlock(GregTech_API.sBlockCasings8, 4)) + .addElement( + 'S', + buildHatchAdder(GT_MetaTileEntity_PCBFactory.class).hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GT_MetaTileEntity_PCBFactory::addCoolantInputToMachineList) + .casingIndex(GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 12)) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings8, 12)) + .addElement('R', ofFrame(Materials.Americium)) + .addElement('Q', ofBlock(GregTech_API.sBlockCasings8, 14)) + .addElement('T', ofBlock(GregTech_API.sBlockCasings1, 15)) + .build(); @Override public void construct(ItemStack stackSize, boolean hintsOnly) { @@ -384,18 +273,18 @@ public class GT_MetaTileEntity_PCBFactory extends if (mBioRotate) { final IGregTechTileEntity tTile = getBaseMetaTileEntity(); getStructureDefinition().buildOrHints( - this, - stackSize, - bioUpgrade, - tTile.getWorld(), - transformFacing(getExtendedFacing()), - tTile.getXCoord(), - tTile.getYCoord(), - tTile.getZCoord(), - mBioOffsets[1], - 6, - mBioOffsets[0], - hintsOnly); + this, + stackSize, + bioUpgrade, + tTile.getWorld(), + transformFacing(getExtendedFacing()), + tTile.getXCoord(), + tTile.getYCoord(), + tTile.getZCoord(), + mBioOffsets[1], + 6, + mBioOffsets[0], + hintsOnly); } else { buildPiece(bioUpgrade, stackSize, hintsOnly, mBioOffsets[0], 6, mBioOffsets[1]); } @@ -426,57 +315,57 @@ public class GT_MetaTileEntity_PCBFactory extends if (mBioRotate) { final IGregTechTileEntity tTile = getBaseMetaTileEntity(); getStructureDefinition().survivalBuild( - this, - stackSize, - bioUpgrade, - tTile.getWorld(), - transformFacing(getExtendedFacing()), - tTile.getXCoord(), - tTile.getYCoord(), - tTile.getZCoord(), - mBioOffsets[1], - 6, - mBioOffsets[0], - elementBudget, - env, - false); + this, + stackSize, + bioUpgrade, + tTile.getWorld(), + transformFacing(getExtendedFacing()), + tTile.getXCoord(), + tTile.getYCoord(), + tTile.getZCoord(), + mBioOffsets[1], + 6, + mBioOffsets[0], + elementBudget, + env, + false); } else { built += survivialBuildPiece( - bioUpgrade, - stackSize, - mBioOffsets[0], - 6, - mBioOffsets[1], - elementBudget, - env, - false, - true); - } - } - - if (mOCTier1 && !mOCTier2) { - built += survivialBuildPiece( - ocTier1Upgrade, + bioUpgrade, stackSize, - mOCTier1Offsets[0], - 9, - mOCTier1Offsets[1], + mBioOffsets[0], + 6, + mBioOffsets[1], elementBudget, env, false, true); + } + } + + if (mOCTier1 && !mOCTier2) { + built += survivialBuildPiece( + ocTier1Upgrade, + stackSize, + mOCTier1Offsets[0], + 9, + mOCTier1Offsets[1], + elementBudget, + env, + false, + true); } if (!mOCTier1 && mOCTier2) { built += survivialBuildPiece( - ocTier2Upgrade, - stackSize, - mOCTier2Offsets[0], - 9, - mOCTier2Offsets[1], - elementBudget, - env, - false, - true); + ocTier2Upgrade, + stackSize, + mOCTier2Offsets[0], + 9, + mOCTier2Offsets[1], + elementBudget, + env, + false, + true); } return built; @@ -497,38 +386,39 @@ public class GT_MetaTileEntity_PCBFactory extends @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[] { + if (aActive) + return new ITexture[] { BlockIcons.getCasingTextureForId( - getTier() < 3 ? GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 11) - : GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 13)), + getTier() < 3 ? GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 11) + : GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 13)), TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) - .extFacing() - .build(), + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { - BlockIcons.getCasingTextureForId( - getTier() < 3 ? GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 11) - : GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 13)), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) - .extFacing() - .glow() - .build() }; + BlockIcons.getCasingTextureForId( + getTier() < 3 ? GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 11) + : GT_Utility.getCasingTextureIndex(GregTech_API.sBlockCasings8, 13)), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { BlockIcons.getCasingTextureForId( - mSetTier < 3 ? ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(11) - : ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(13)) }; + mSetTier < 3 ? ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(11) + : ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(13)) }; } @Override @@ -564,17 +454,17 @@ public class GT_MetaTileEntity_PCBFactory extends if (mBioRotate) { final IGregTechTileEntity tTile = getBaseMetaTileEntity(); if (!getStructureDefinition().check( - this, - bioUpgrade, - tTile.getWorld(), - transformFacing(getExtendedFacing()), - tTile.getXCoord(), - tTile.getYCoord(), - tTile.getZCoord(), - mBioOffsets[1], - 6, - mBioOffsets[0], - !mMachine)) { + this, + bioUpgrade, + tTile.getWorld(), + transformFacing(getExtendedFacing()), + tTile.getXCoord(), + tTile.getYCoord(), + tTile.getZCoord(), + mBioOffsets[1], + 6, + mBioOffsets[0], + !mMachine)) { return false; } } else { @@ -608,8 +498,8 @@ public class GT_MetaTileEntity_PCBFactory extends getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData()); if (mMaintenanceHatches.size() != 1 || mOutputBusses.isEmpty() - || mInputBusses.isEmpty() - || mInputHatches.isEmpty()) { + || mInputBusses.isEmpty() + || mInputHatches.isEmpty()) { return false; } @@ -649,7 +539,7 @@ public class GT_MetaTileEntity_PCBFactory extends } private boolean processRecipe(ItemStack aStack, ItemStack[] aItemInputs, FluidStack[] aFluidInputs, - GT_Recipe.GT_Recipe_Map aMap) { + GT_Recipe.GT_Recipe_Map aMap) { mOutputItems = null; mOutputFluids = null; if (aItemInputs == null || aFluidInputs == null) { @@ -660,15 +550,8 @@ public class GT_MetaTileEntity_PCBFactory extends long amps = getMaxInputAmps(); int tier = GT_Utility.getTier(voltage); - GT_Recipe tRecipe = aMap.findRecipe( - getBaseMetaTileEntity(), - null, - true, - false, - V[tier], - aFluidInputs, - aStack, - aItemInputs); + GT_Recipe tRecipe = aMap + .findRecipe(getBaseMetaTileEntity(), null, true, false, V[tier], aFluidInputs, aStack, aItemInputs); if (tRecipe == null) { return false; @@ -696,19 +579,19 @@ public class GT_MetaTileEntity_PCBFactory extends } boolean recipeAllowed = (((recipeBitMap & mTier1BitMap) == mTier1BitMap && (mTier >= 1)) - || ((recipeBitMap & mTier2BitMap) == mTier2BitMap && (mTier >= 2)) - || ((recipeBitMap & mTier3BitMap) == mTier3BitMap && (mTier >= 3))) - && ((recipeBitMap & mBioBitMap) == 0 || ((recipeBitMap & mBioBitMap) == mBioBitMap && mBioUpgrade)); + || ((recipeBitMap & mTier2BitMap) == mTier2BitMap && (mTier >= 2)) + || ((recipeBitMap & mTier3BitMap) == mTier3BitMap && (mTier >= 3))) + && ((recipeBitMap & mBioBitMap) == 0 || ((recipeBitMap & mBioBitMap) == mBioBitMap && mBioUpgrade)); if (recipeAllowed) { GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setMaxParallel(aMaxParallel) - .setAvailableEUt(getMaxInputEu()) - .setEUtModifier(aExtraPower) - .enableConsumption() - .build(); + .setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs) + .setMaxParallel(aMaxParallel) + .setAvailableEUt(getMaxInputEu()) + .setEUtModifier(aExtraPower) + .enableConsumption() + .build(); mCurrentParallel = helper.getCurrentParallel(); if (mCurrentParallel > 0) { @@ -719,14 +602,11 @@ public class GT_MetaTileEntity_PCBFactory extends if (mOCTier1 || mOCTier2) { GT_OverclockCalculator calc = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) - .setDuration(tRecipe.mDuration) - .setEUt(voltage) - .setAmperage(amps) - .setEUtDiscount(aExtraPower) - .setSpeedBoost( - (float) Math.pow( - mRoughnessMultiplier, - 2)); + .setDuration(tRecipe.mDuration) + .setEUt(voltage) + .setAmperage(amps) + .setEUtDiscount(aExtraPower) + .setSpeedBoost((float) Math.pow(mRoughnessMultiplier, 2)); if (mOCTier2) { calc.enablePerfectOC(); } @@ -895,7 +775,7 @@ public class GT_MetaTileEntity_PCBFactory extends } } else if (curRotation == Rotation.CLOCKWISE || curRotation == Rotation.COUNTER_CLOCKWISE) { newFlip = curRotation == Rotation.CLOCKWISE ? curFlip == Flip.NONE ? Flip.NONE : Flip.HORIZONTAL - : curFlip != Flip.NONE ? Flip.NONE : Flip.HORIZONTAL; + : curFlip != Flip.NONE ? Flip.NONE : Flip.HORIZONTAL; newDirection = curRotation == Rotation.CLOCKWISE ? ForgeDirection.UP : ForgeDirection.DOWN; } else { newDirection = switch (curDirection) { @@ -936,7 +816,7 @@ public class GT_MetaTileEntity_PCBFactory extends @Override protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, - boolean perfectOC) { + boolean perfectOC) { int hatches = Math.max(getExoticEnergyHatches().size(), 1); long zMaxInputVoltage = maxInputVoltage; long zTime = aDuration; @@ -982,8 +862,8 @@ public class GT_MetaTileEntity_PCBFactory extends public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } @Override @@ -1000,181 +880,180 @@ public class GT_MetaTileEntity_PCBFactory extends for (GT_MetaTileEntity_Hatch tHatch : getExoticAndNormalEnergyHatchList()) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } long voltage = getAverageInputVoltage(); long amps = getMaxInputAmps(); return new String[] { - /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(getActualEnergyUsage()) - + EnumChatFormatting.RESET - + " EU/t", - /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(voltage) - + EnumChatFormatting.RESET - + " EU/t(*" - + amps - + " A)" - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier(voltage)] - + EnumChatFormatting.RESET, - /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " - + EnumChatFormatting.GREEN - + mPollutionReduction - + EnumChatFormatting.RESET - + " %", - /* 7 */ StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " - + EnumChatFormatting.GREEN - + mMaxParallel, - /* 8 */ StatCollector.translateToLocal("GT5U.multiblock.curparallelism") + ": " - + EnumChatFormatting.GREEN - + mCurrentParallel }; + /* 1 */ StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + /* 2 */ StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + /* 3 */ StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(getActualEnergyUsage()) + + EnumChatFormatting.RESET + + " EU/t", + /* 4 */ StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(voltage) + + EnumChatFormatting.RESET + + " EU/t(*" + + amps + + " A)" + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility.getTier(voltage)] + + EnumChatFormatting.RESET, + /* 5 */ StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + /* 6 */ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %", + /* 7 */ StatCollector.translateToLocal("GT5U.multiblock.parallelism") + ": " + + EnumChatFormatting.GREEN + + mMaxParallel, + /* 8 */ StatCollector.translateToLocal("GT5U.multiblock.curparallelism") + ": " + + EnumChatFormatting.GREEN + + mCurrentParallel }; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Circuit Board Fabricator") - .addInfo("Controller for the PCB Factory") - .addInfo( - EnumChatFormatting.GOLD.toString() + EnumChatFormatting.BOLD - + "IMPORTANT!" - + " Check the configuration menu before building.") - .addInfo("Tier of the machine determines the available recipes.") - .addInfo("Machine tier (1-3) is set in the controller GUI.") - .addInfo("The configuration menu can be used to add upgrades.") - .addInfo("Each tier and upgrade requires additional structures.") - .addInfo("Power consumption is multiplied by Sqrt(structures).") - .addInfo("Tier 2 and 3 allow parallel by using extra nanites.") - .addInfo("Every doubling of nanites adds one parallel.") - .addInfo("1x->1, 2x->2, 4x->3, 8x->4 with no limit.") - .addInfo("Recipes require a cooling upgrade to be overclocked.") - .addInfo("Liquid Cooling uses 10 L/s of distilled water and enables default overclocks.") - .addInfo("Thermosink uses 10 L/s of Space Coolant and enables perfect overclocks.") - .addInfo("Trace size can be changed to modify the material usage and machine speed.") - .addInfo(AuthorBlueWeabo) - .beginStructureBlock(30, 38, 13, false) - .addSeparator() - .addMaintenanceHatch(EnumChatFormatting.GOLD + "1", 1) - .addEnergyHatch(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) - .addInputBus(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) - .addOutputBus(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) - .addInputHatch(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) - .addStructureInfo( - "Coolant Hatch (Input Hatch): " + EnumChatFormatting.GOLD - + "1" - + EnumChatFormatting.GRAY - + "Center of the Liquid Cooling/Thermosink") - .addStructureInfo( - EnumChatFormatting.BLUE + "Base Multi (Tier " - + EnumChatFormatting.DARK_PURPLE - + 1 - + EnumChatFormatting.BLUE - + "):") - .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "9" + EnumChatFormatting.GRAY + " Vibrant Alloy Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "25" + EnumChatFormatting.GRAY + " Reinforced Glass") - .addStructureInfo( - EnumChatFormatting.GOLD + "77" + EnumChatFormatting.GRAY + " Basic Photolithography Framework Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "12" + EnumChatFormatting.GRAY + " Grate Machine Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "25" + EnumChatFormatting.GRAY + " Plascrete Block") - .addStructureInfo( - EnumChatFormatting.BLUE + "Tier " - + EnumChatFormatting.DARK_PURPLE - + 2 - + EnumChatFormatting.BLUE - + " (Adds to Tier " - + EnumChatFormatting.DARK_PURPLE - + 1 - + EnumChatFormatting.BLUE - + "):") - .addStructureInfo(EnumChatFormatting.GOLD + "34" + EnumChatFormatting.GRAY + " Duranium Frame Box") - .addStructureInfo( - EnumChatFormatting.GOLD + "158" - + EnumChatFormatting.GRAY - + " Reinforced Photolithography Framework Casing") - .addStructureInfo( - EnumChatFormatting.BLUE + "Tier " - + EnumChatFormatting.DARK_PURPLE - + 3 - + EnumChatFormatting.BLUE - + ":") - .addStructureInfo( - EnumChatFormatting.GOLD + "292" - + EnumChatFormatting.GRAY - + " Radiation Proof Photolithography Framework Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "76" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.BLUE + "Biochamber Upgrade") - .addStructureInfo( - EnumChatFormatting.GOLD + "68" + EnumChatFormatting.GRAY + " Clean Stainless Steel Machine Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "72" + EnumChatFormatting.GRAY + " Reinforced Glass") - .addStructureInfo( - EnumChatFormatting.BLUE + "Liquid Cooling Tower (Tier " - + EnumChatFormatting.DARK_PURPLE - + 1 - + EnumChatFormatting.BLUE - + "):") - .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") - .addStructureInfo(EnumChatFormatting.GOLD + "68" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "12" + EnumChatFormatting.GRAY + " Extreme Engine Intake Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "20" + EnumChatFormatting.GRAY + " Tungstensteel Pipe Casing") - .addStructureInfo( - EnumChatFormatting.GOLD + "21" - + EnumChatFormatting.GRAY - + " Reinforced Photolithography Framework Casing") - .addStructureInfo( - EnumChatFormatting.BLUE + "Thermosink Radiator(Tier " - + EnumChatFormatting.DARK_PURPLE - + 2 - + EnumChatFormatting.BLUE - + "):") - .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Americium Frame Box") - .addStructureInfo( - EnumChatFormatting.GOLD + "41" - + EnumChatFormatting.GRAY - + " Reinforced Photolithography Framework Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "8" + EnumChatFormatting.GRAY + " Superconducting Coil Block") - .addStructureInfo(EnumChatFormatting.GOLD + "20" + EnumChatFormatting.GRAY + " Tungstensteel Pipe Casing") - .addStructureInfo(EnumChatFormatting.GOLD + "48" + EnumChatFormatting.GRAY + " Infinity Cooled Casing") - .toolTipFinisher("GregTech"); + .addInfo("Controller for the PCB Factory") + .addInfo( + EnumChatFormatting.GOLD.toString() + EnumChatFormatting.BOLD + + "IMPORTANT!" + + " Check the configuration menu before building.") + .addInfo("Tier of the machine determines the available recipes.") + .addInfo("Machine tier (1-3) is set in the controller GUI.") + .addInfo("The configuration menu can be used to add upgrades.") + .addInfo("Each tier and upgrade requires additional structures.") + .addInfo("Power consumption is multiplied by Sqrt(structures).") + .addInfo("Tier 2 and 3 allow parallel by using extra nanites.") + .addInfo("Every doubling of nanites adds one parallel.") + .addInfo("1x->1, 2x->2, 4x->3, 8x->4 with no limit.") + .addInfo("Recipes require a cooling upgrade to be overclocked.") + .addInfo("Liquid Cooling uses 10 L/s of distilled water and enables default overclocks.") + .addInfo("Thermosink uses 10 L/s of Space Coolant and enables perfect overclocks.") + .addInfo("Trace size can be changed to modify the material usage and machine speed.") + .addInfo(AuthorBlueWeabo) + .beginStructureBlock(30, 38, 13, false) + .addSeparator() + .addMaintenanceHatch(EnumChatFormatting.GOLD + "1", 1) + .addEnergyHatch(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) + .addInputBus(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) + .addOutputBus(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) + .addInputHatch(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + "+", 1) + .addStructureInfo( + "Coolant Hatch (Input Hatch): " + EnumChatFormatting.GOLD + + "1" + + EnumChatFormatting.GRAY + + "Center of the Liquid Cooling/Thermosink") + .addStructureInfo( + EnumChatFormatting.BLUE + "Base Multi (Tier " + + EnumChatFormatting.DARK_PURPLE + + 1 + + EnumChatFormatting.BLUE + + "):") + .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") + .addStructureInfo(EnumChatFormatting.GOLD + "9" + EnumChatFormatting.GRAY + " Vibrant Alloy Frame Box") + .addStructureInfo(EnumChatFormatting.GOLD + "25" + EnumChatFormatting.GRAY + " Reinforced Glass") + .addStructureInfo( + EnumChatFormatting.GOLD + "77" + EnumChatFormatting.GRAY + " Basic Photolithography Framework Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "12" + EnumChatFormatting.GRAY + " Grate Machine Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "25" + EnumChatFormatting.GRAY + " Plascrete Block") + .addStructureInfo( + EnumChatFormatting.BLUE + "Tier " + + EnumChatFormatting.DARK_PURPLE + + 2 + + EnumChatFormatting.BLUE + + " (Adds to Tier " + + EnumChatFormatting.DARK_PURPLE + + 1 + + EnumChatFormatting.BLUE + + "):") + .addStructureInfo(EnumChatFormatting.GOLD + "34" + EnumChatFormatting.GRAY + " Duranium Frame Box") + .addStructureInfo( + EnumChatFormatting.GOLD + "158" + + EnumChatFormatting.GRAY + + " Reinforced Photolithography Framework Casing") + .addStructureInfo( + EnumChatFormatting.BLUE + "Tier " + EnumChatFormatting.DARK_PURPLE + 3 + EnumChatFormatting.BLUE + ":") + .addStructureInfo( + EnumChatFormatting.GOLD + "292" + + EnumChatFormatting.GRAY + + " Radiation Proof Photolithography Framework Casing") + .addStructureInfo( + EnumChatFormatting.GOLD + "76" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") + .addStructureInfo(EnumChatFormatting.BLUE + "Biochamber Upgrade") + .addStructureInfo( + EnumChatFormatting.GOLD + "68" + EnumChatFormatting.GRAY + " Clean Stainless Steel Machine Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") + .addStructureInfo(EnumChatFormatting.GOLD + "72" + EnumChatFormatting.GRAY + " Reinforced Glass") + .addStructureInfo( + EnumChatFormatting.BLUE + "Liquid Cooling Tower (Tier " + + EnumChatFormatting.DARK_PURPLE + + 1 + + EnumChatFormatting.BLUE + + "):") + .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box") + .addStructureInfo( + EnumChatFormatting.GOLD + "68" + EnumChatFormatting.GRAY + " Radiant Naquadah Alloy Casing") + .addStructureInfo( + EnumChatFormatting.GOLD + "12" + EnumChatFormatting.GRAY + " Extreme Engine Intake Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "20" + EnumChatFormatting.GRAY + " Tungstensteel Pipe Casing") + .addStructureInfo( + EnumChatFormatting.GOLD + "21" + + EnumChatFormatting.GRAY + + " Reinforced Photolithography Framework Casing") + .addStructureInfo( + EnumChatFormatting.BLUE + "Thermosink Radiator(Tier " + + EnumChatFormatting.DARK_PURPLE + + 2 + + EnumChatFormatting.BLUE + + "):") + .addStructureInfo(EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Americium Frame Box") + .addStructureInfo( + EnumChatFormatting.GOLD + "41" + + EnumChatFormatting.GRAY + + " Reinforced Photolithography Framework Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "8" + EnumChatFormatting.GRAY + " Superconducting Coil Block") + .addStructureInfo(EnumChatFormatting.GOLD + "20" + EnumChatFormatting.GRAY + " Tungstensteel Pipe Casing") + .addStructureInfo(EnumChatFormatting.GOLD + "48" + EnumChatFormatting.GRAY + " Infinity Cooled Casing") + .toolTipFinisher("GregTech"); return tt; } @@ -1265,35 +1144,35 @@ public class GT_MetaTileEntity_PCBFactory extends super.addUIWidgets(builder, buildContext); buildContext.addSyncedWindow(10, this::createConfigurationWindow); builder.widget( - new ButtonWidget().setOnClick( - (clickData, widget) -> { - if (!widget.isClient()) widget.getContext() - .openSyncedWindow(10); - }) - .setSize(16, 16) - .setBackground(() -> { - List<UITexture> ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - ret.add(GT_UITextures.OVERLAY_BUTTON_CYCLIC); - return ret.toArray(new IDrawable[0]); - }) - .addTooltip("Configuration Menu") - .setPos(174, 130)) - .widget( - new TextWidget(new Text("Tier")).setTextAlignment(Alignment.Center) - .setScale(0.91f) - .setSize(20, 16) - .setPos(173, 98)) - .widget( - new TextFieldWidget().setGetterInt(() -> mSetTier) - .setSetterInt(val -> mSetTier = val) - .setNumbers(1, 3) - .setTextColor(Color.WHITE.normal) - .setTextAlignment(Alignment.Center) - .addTooltip("PCB Factory Tier") - .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize(18, 18) - .setPos(173, 110)); + new ButtonWidget().setOnClick( + (clickData, widget) -> { + if (!widget.isClient()) widget.getContext() + .openSyncedWindow(10); + }) + .setSize(16, 16) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + ret.add(GT_UITextures.OVERLAY_BUTTON_CYCLIC); + return ret.toArray(new IDrawable[0]); + }) + .addTooltip("Configuration Menu") + .setPos(174, 130)) + .widget( + new TextWidget(new Text("Tier")).setTextAlignment(Alignment.Center) + .setScale(0.91f) + .setSize(20, 16) + .setPos(173, 98)) + .widget( + new TextFieldWidget().setGetterInt(() -> mSetTier) + .setSetterInt(val -> mSetTier = val) + .setNumbers(1, 3) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("PCB Factory Tier") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(18, 18) + .setPos(173, 110)); } protected ModularWindow createConfigurationWindow(final EntityPlayer player) { @@ -1301,350 +1180,189 @@ public class GT_MetaTileEntity_PCBFactory extends builder.setBackground(GT_UITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); builder.setGuiTint(getGUIColorization()); builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setPos(5, 5) - .setSize(16, 16)) - .widget(new TextWidget("Configuration Menu").setPos(25, 9)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(185, 3)) - .widget( - new DynamicPositionedColumn().setSynced(false) - .widget( - new MultiChildWidget().addChild( - new CycleButtonWidget().setToggle( - () -> mBioUpgrade, - val -> { - mBioUpgrade = val; - if (!mBioUpgrade) { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "339.1", - "Biochamber Upgrade Disabled")); - } else { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "339", - "Biochamber Upgrade Enabled")); - } - }) - .setVariableBackground( - GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setSize(90, 18) - .addTooltip( - "Enables nanites to construct organic circuitry. Required for Bioware and Wetware boards.")) - .addChild( - new DrawableWidget().setDrawable( - GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setSize( - 18, - 18)) - .addChild( - new TextWidget( - "Biochamber").setTextAlignment( - Alignment.Center) - .setPos( - 23, - 5)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new MultiChildWidget().addChild( - new CycleButtonWidget().setToggle( - () -> mBioRotate, - val -> { - mBioRotate = val; - if (!mBioRotate) { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "340.1", - "Rotated biochamber disabled")); - } else { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "340", - "Rotated biochamber enabled")); - } - }) - .setVariableBackground( - GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setSize(90, 18) - .addTooltip( - "Rotates the biochamber by 90 degrees.")) - .addChild( - new DrawableWidget().setDrawable( - GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setSize( - 18, - 18)) - .addChild( - new TextWidget( - "Bio Rotation").setTextAlignment( - Alignment.Center) - .setPos( - 23, - 5)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new MultiChildWidget().addChild( - new CycleButtonWidget().setToggle( - () -> mOCTier1, - val -> { - mOCTier1 = val; - if (!mOCTier1) { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "341.1", - "Tier 1 cooling disabled")); - } else { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "341", - "Tier 1 cooling enabled")); - } - }) - .setVariableBackground( - GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setSize(90, 18) - .addTooltip( - "Allows for overclocking. Requires 10 L/s of distilled water. Cooling upgrades are mutually exclusive.")) - .addChild( - new DrawableWidget().setDrawable( - GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setSize( - 18, - 18)) - .addChild( - new TextWidget( - "Liquid Cooling").setTextAlignment( - Alignment.Center) - .setPos( - 20, - 5)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new MultiChildWidget().addChild( - new CycleButtonWidget().setToggle( - () -> mOCTier2, - val -> { - mOCTier2 = val; - if (!mOCTier2) { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "342.1", - "Tier 2 cooling disabled")); - } else { - GT_Utility.sendChatToPlayer( - player, - GT_Utility.trans( - "342", - "Tier 2 cooling enabled")); - } - }) - .setVariableBackground( - GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setSize(90, 18) - .addTooltip( - "Enables perfect overclocking by allowing nanites to work with extreme speed and efficiency. Uses 10 L/s of space coolant.")) - .addChild( - new DrawableWidget().setDrawable( - GT_UITextures.OVERLAY_BUTTON_CYCLIC) - .setSize( - 18, - 18)) - .addChild( - new TextWidget( - "Thermosink").setTextAlignment( - Alignment.Center) - .setPos( - 20, - 5)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new TextWidget(new Text("Trace Size")).setSize(90, 18) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive()) - .setPos(0, 4)) - .widget( - new TextFieldWidget().setGetterInt( - () -> (int) ((1f / mRoughnessMultiplier) * 100f)) - .setSetterInt( - val -> mRoughnessMultiplier = 100f - / val) - .setNumbers(50, 200) - .setTextColor(Color.WHITE.normal) - .setTextAlignment(Alignment.Center) - .addTooltip( - "Set the trace size. Smaller traces allow material savings but take longer to fabricate. Larger traces waste material but are fast. 50-200 μm.") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize(90, 16)) - .widget( - new DrawableWidget().setDrawable( - GT_UITextures.OVERLAY_BUTTON_CROSS) - .setSize(18, 18) - .addTooltip( - new Text( - "Can't change configuration when running !").color( - Color.RED.dark( - 3))) - .setEnabled( - widget -> getBaseMetaTileEntity().isActive())) - .setPos(10, 25)) - .widget( - new DynamicPositionedColumn().setSynced(false) - .widget( - new TextWidget( - new Text("Bio Upgrade Offsets")).setSize(72, 18) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new DynamicPositionedRow().setSynced(false) - .widget( - new TextFieldWidget().setGetterInt( - () -> mBioOffsets[0]) - .setSetterInt( - val -> mBioOffsets[0] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "X Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .widget( - new TextFieldWidget().setGetterInt( - () -> mBioOffsets[1]) - .setSetterInt( - val -> mBioOffsets[1] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "Z Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new TextWidget( - new Text("Cooler Tier 1 Offsets")).setSize(72, 18) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new DynamicPositionedRow().setSynced(false) - .widget( - new TextFieldWidget().setGetterInt( - () -> mOCTier1Offsets[0]) - .setSetterInt( - val -> mOCTier1Offsets[0] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "X Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .widget( - new TextFieldWidget().setGetterInt( - () -> mOCTier1Offsets[1]) - .setSetterInt( - val -> mOCTier1Offsets[1] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "Z Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new TextWidget( - new Text("Cooler Tier 2 Offsets")).setSize(72, 18) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .widget( - new DynamicPositionedRow().setSynced(false) - .widget( - new TextFieldWidget().setGetterInt( - () -> mOCTier2Offsets[0]) - .setSetterInt( - val -> mOCTier2Offsets[0] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "X Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .widget( - new TextFieldWidget().setGetterInt( - () -> mOCTier2Offsets[1]) - .setSetterInt( - val -> mOCTier2Offsets[1] = val) - .setNumbers( - -16, - 16) - .setTextColor( - Color.WHITE.normal) - .setTextAlignment( - Alignment.Center) - .addTooltip( - "Z Offset") - .setBackground( - GT_UITextures.BACKGROUND_TEXT_FIELD) - .setSize( - 36, - 18)) - .setEnabled( - widget -> !getBaseMetaTileEntity().isActive())) - .setPos(110, 25)); + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setPos(5, 5) + .setSize(16, 16)) + .widget(new TextWidget("Configuration Menu").setPos(25, 9)) + .widget( + ButtonWidget.closeWindowButton(true) + .setPos(185, 3)) + .widget( + new DynamicPositionedColumn().setSynced(false) + .widget( + new MultiChildWidget().addChild(new CycleButtonWidget().setToggle(() -> mBioUpgrade, val -> { + mBioUpgrade = val; + if (!mBioUpgrade) { + GT_Utility + .sendChatToPlayer(player, GT_Utility.trans("339.1", "Biochamber Upgrade Disabled")); + } else { + GT_Utility + .sendChatToPlayer(player, GT_Utility.trans("339", "Biochamber Upgrade Enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setSize(90, 18) + .addTooltip( + "Enables nanites to construct organic circuitry. Required for Bioware and Wetware boards.")) + .addChild( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setSize(18, 18)) + .addChild( + new TextWidget("Biochamber").setTextAlignment(Alignment.Center) + .setPos(23, 5)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget(new MultiChildWidget().addChild(new CycleButtonWidget().setToggle(() -> mBioRotate, val -> { + mBioRotate = val; + if (!mBioRotate) { + GT_Utility + .sendChatToPlayer(player, GT_Utility.trans("340.1", "Rotated biochamber disabled")); + } else { + GT_Utility.sendChatToPlayer(player, GT_Utility.trans("340", "Rotated biochamber enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setSize(90, 18) + .addTooltip("Rotates the biochamber by 90 degrees.")) + .addChild( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setSize(18, 18)) + .addChild( + new TextWidget("Bio Rotation").setTextAlignment(Alignment.Center) + .setPos(23, 5)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget(new MultiChildWidget().addChild(new CycleButtonWidget().setToggle(() -> mOCTier1, val -> { + mOCTier1 = val; + if (!mOCTier1) { + GT_Utility.sendChatToPlayer(player, GT_Utility.trans("341.1", "Tier 1 cooling disabled")); + } else { + GT_Utility.sendChatToPlayer(player, GT_Utility.trans("341", "Tier 1 cooling enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setSize(90, 18) + .addTooltip( + "Allows for overclocking. Requires 10 L/s of distilled water. Cooling upgrades are mutually exclusive.")) + .addChild( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setSize(18, 18)) + .addChild( + new TextWidget("Liquid Cooling").setTextAlignment(Alignment.Center) + .setPos(20, 5)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget(new MultiChildWidget().addChild(new CycleButtonWidget().setToggle(() -> mOCTier2, val -> { + mOCTier2 = val; + if (!mOCTier2) { + GT_Utility.sendChatToPlayer(player, GT_Utility.trans("342.1", "Tier 2 cooling disabled")); + } else { + GT_Utility.sendChatToPlayer(player, GT_Utility.trans("342", "Tier 2 cooling enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setSize(90, 18) + .addTooltip( + "Enables perfect overclocking by allowing nanites to work with extreme speed and efficiency. Uses 10 L/s of space coolant.")) + .addChild( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CYCLIC) + .setSize(18, 18)) + .addChild( + new TextWidget("Thermosink").setTextAlignment(Alignment.Center) + .setPos(20, 5)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new TextWidget(new Text("Trace Size")).setSize(90, 18) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive()) + .setPos(0, 4)) + .widget( + new TextFieldWidget().setGetterInt(() -> (int) ((1f / mRoughnessMultiplier) * 100f)) + .setSetterInt(val -> mRoughnessMultiplier = 100f / val) + .setNumbers(50, 200) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip( + "Set the trace size. Smaller traces allow material savings but take longer to fabricate. Larger traces waste material but are fast. 50-200 μm.") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(90, 16)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.OVERLAY_BUTTON_CROSS) + .setSize(18, 18) + .addTooltip(new Text("Can't change configuration when running !").color(Color.RED.dark(3))) + .setEnabled(widget -> getBaseMetaTileEntity().isActive())) + .setPos(10, 25)) + .widget( + new DynamicPositionedColumn().setSynced(false) + .widget( + new TextWidget(new Text("Bio Upgrade Offsets")).setSize(72, 18) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new DynamicPositionedRow().setSynced(false) + .widget( + new TextFieldWidget().setGetterInt(() -> mBioOffsets[0]) + .setSetterInt(val -> mBioOffsets[0] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("X Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .widget( + new TextFieldWidget().setGetterInt(() -> mBioOffsets[1]) + .setSetterInt(val -> mBioOffsets[1] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("Z Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new TextWidget(new Text("Cooler Tier 1 Offsets")).setSize(72, 18) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new DynamicPositionedRow().setSynced(false) + .widget( + new TextFieldWidget().setGetterInt(() -> mOCTier1Offsets[0]) + .setSetterInt(val -> mOCTier1Offsets[0] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("X Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .widget( + new TextFieldWidget().setGetterInt(() -> mOCTier1Offsets[1]) + .setSetterInt(val -> mOCTier1Offsets[1] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("Z Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new TextWidget(new Text("Cooler Tier 2 Offsets")).setSize(72, 18) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .widget( + new DynamicPositionedRow().setSynced(false) + .widget( + new TextFieldWidget().setGetterInt(() -> mOCTier2Offsets[0]) + .setSetterInt(val -> mOCTier2Offsets[0] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("X Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .widget( + new TextFieldWidget().setGetterInt(() -> mOCTier2Offsets[1]) + .setSetterInt(val -> mOCTier2Offsets[1] = val) + .setNumbers(-16, 16) + .setTextColor(Color.WHITE.normal) + .setTextAlignment(Alignment.Center) + .addTooltip("Z Offset") + .setBackground(GT_UITextures.BACKGROUND_TEXT_FIELD) + .setSize(36, 18)) + .setEnabled(widget -> !getBaseMetaTileEntity().isActive())) + .setPos(110, 25)); return builder.build(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java index 25c3b7157e..5f32ec190d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java @@ -44,7 +44,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_PlasmaForge> - implements ISurvivalConstructable { + implements ISurvivalConstructable { // 3600 seconds in an hour, 8 hours, 20 ticks in a second. private static final double max_efficiency_time_in_ticks = 3600d * 8d * 20d; @@ -52,8 +52,7 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul // Valid fuels which the discount will get applied to. private static final FluidStack[] valid_fuels = { Materials.ExcitedDTEC.getFluid(1L), - Materials.ExcitedDTRC.getFluid(1L), Materials.ExcitedDTPC.getFluid(1L), - Materials.ExcitedDTCC.getFluid(1L), }; + Materials.ExcitedDTRC.getFluid(1L), Materials.ExcitedDTPC.getFluid(1L), Materials.ExcitedDTCC.getFluid(1L), }; // Saves recomputing this every recipe check for overclocking. private static final double log4 = log(4); @@ -75,403 +74,399 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul private long EU_per_tick = 0; @SuppressWarnings("SpellCheckingInspection") - private static final String[][] structure_string = new String[][] { - { " ", " N N N N ", - " N N N N ", " N N N N ", - " ", " ", - " ", " N N N N ", - " N N N N ", " NNN NNN N N NNN NNN ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " NNN NNN NNN NNN " }, - { " N N N N ", " bCCCb bCCCb ", - " bCCCb bCCCb ", " bCCCb bCCCb ", - " N N N N ", " ", - " N N N N ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbN NbbbN NbbbN NbbbN", - " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN N N NbbbN NbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " NNNbbbbbNNsNNbbbbbNNN ", " ss bCCCb bCCCb ss ", - " s N N N N s ", " s s ", - " N N N N N N ", " N bCCCb bCCCb N ", - " N sbbbbbNNsNNbbbbbs N ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", - " s s s s ", " NNN NNN NNN NNN ", - " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " ss bCCCb bCCCb ss ", " bCCCb bCCCb ", - " s NCCCN NCCCN s ", " s NCCCN NCCCN s ", - " NCCCN NCCCN ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", - " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN", }, - { " ", " N N N N ", - " s N N N N s ", " s NCCCN NCCCN s ", - " ", " ", - " ", " NCCCN NCCCN ", - " N N N N ", " NNN NN N N NN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NbN NNN NNN ", }, - { " ", " ", - " s s ", " s NCCCN NCCCN s ", - " ", " ", - " ", " NCCCN NCCCN ", - " ", " N N N N ", - " C C C C ", " C C C C ", - " C C C C ", " N N N N ", - " ", " ", - " ", " ", - " ", " N N N N ", - " C C C C ", " C C C C ", - " C C C C ", " N N NbN N N ", }, - { " ", " N N N N ", - " N N N N N N ", " NCCCN NCCCN ", - " ", " ", - " ", " NCCCN NCCCN ", - " N N N N ", " NNN NN N N NN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NbN NNN NNN ", }, - { " N N N N ", " bCCCb bCCCb ", - " N bCCCb bCCCb N ", " bCCCb bCCCb ", - " NCCCN NCCCN ", " NCCCN NCCCN ", - " NCCCN NCCCN ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", - " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " N sbbbbbNNsNNbbbbbs N ", " bCCCb bCCCb ", - " N N N N ", " ", - " N N N N ", " bCCCb bCCCb ", - " s sbbbbbNNsNNbbbbbs s ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", - " s s s s ", " NNN NNN NNN NNN ", - " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, - { " NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " NNN NNN N N NNN NNN ", " N N N N ", - " NNN NNN N N NNN NNN ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NNNN NNNCCCb bCCCNNN NNNN", - " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbN NbbbN NbbbN NbbbN", - " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbN NbbbN NbbbN", }, - { " ", " CCC CCC N N CCC CCC ", - " CbC CbC N N CbC CbC ", " CCCCCCCCC N N CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC N N CCCCCCCCC ", - " CbC CbC N N CbC CbC ", " CCC CCC N N CCC CCC ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " NNN NNN NbN NNN NNN ", }, - { " ", " CCC CCC CCC CCC ", - " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC CCCCCCCCC ", - " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbN N N ", }, - { " ", " CCC CCC CCC CCC ", - " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC CCCCCCCCC ", - " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbN N N ", }, - { " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - "NbbbN NbbbN NbbbN NbbbN", "NbbbNNNbbbN NbbbNNNbbbN", - " NNN NNN NNN NNN ", " N N N N ", - " NNN NNN NNN NNN ", "NbbbNNNbbbN NbbbNNNbbbN", - "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NsNsN N N ", }, - { " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbbbbbN N N ", }, - { " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " N ", " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", }, - { " ", " ", - " s s s s ", " ", - " ", " ", - " ", " ", - " s s s s ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ~ ", - " NNN ", " NbbbbbNbbbbNbbbbbNbbbbNbbbbbN ", }, - { " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " N ", " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", }, - { " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " N N N N ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbbbbbN N N ", }, - { " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - "NbbbN NbbbN NbbbN NbbbN", "NbbbNNNbbbN NbbbNNNbbbN", - " NNN NNN NNN NNN ", " N N N N ", - " NNN NNN NNN NNN ", "NbbbNNNbbbN NbbbNNNbbbN", - "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NsNsN N N ", }, - { " ", " CCC CCC CCC CCC ", - " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC CCCCCCCCC ", - " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbN N N ", }, - { " ", " CCC CCC CCC CCC ", - " CbC CbC CbC CbC ", " CCCCCCCCC CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC CCCCCCCCC ", - " CbC CbC CbC CbC ", " CCC CCC CCC CCC ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " ", - " ", " N N NbN N N ", }, - { " ", " CCC CCC N N CCC CCC ", - " CbC CbC N N CbC CbC ", " CCCCCCCCC N N CCCCCCCCC ", - " C C C C ", " C C C C ", - " C C C C ", " CCCCCCCCC N N CCCCCCCCC ", - " CbC CbC N N CbC CbC ", " CCC CCC N N CCC CCC ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " NNN NNN NbN NNN NNN ", }, - { " NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " NNN NNN N N NNN NNN ", " N N N N ", - " NNN NNN N N NNN NNN ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NNNN NNNCCCb bCCCNNN NNNN", - " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbN NbbbN NbbbN NbbbN", - " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbN NbbbN NbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " N sbbbbbNNsNNbbbbbs N ", " bCCCb bCCCb ", - " N N N N ", " ", - " N N N N ", " bCCCb bCCCb ", - " s sbbbbbNNsNNbbbbbs s ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", - " s s s s ", " NNN NNN NNN NNN ", - " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " N bCCCb bCCCb N ", " bCCCb bCCCb ", - " NCCCN NCCCN ", " NCCCN NCCCN ", - " NCCCN NCCCN ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", - " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN", }, - { " ", " N N N N ", - " N N N N N N ", " NCCCN NCCCN ", - " ", " ", - " ", " NCCCN NCCCN ", - " N N N N ", " NNN NN N N NN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NbN NNN NNN ", }, - { " ", " ", - " s s ", " s NCCCN NCCCN s ", - " ", " ", - " ", " NCCCN NCCCN ", - " ", " N N N N ", - " C C C C ", " C C C C ", - " C C C C ", " N N N N ", - " ", " ", - " ", " ", - " ", " N N N N ", - " C C C C ", " C C C C ", - " C C C C ", " N N NbN N N ", }, - { " ", " N N N N ", - " s N N N N s ", " s NCCCN NCCCN s ", - " ", " ", - " ", " NCCCN NCCCN ", - " N N N N ", " NNN NN N N NN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " C C C C ", " C C C C ", - " C C C C ", " NNN NNN NbN NNN NNN ", }, - { " N N N N ", " bCCCb bCCCb ", - " ss bCCCb bCCCb ss ", " bCCCb bCCCb ", - " s NCCCN NCCCN s ", " s NCCCN NCCCN s ", - " NCCCN NCCCN ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", - " CCCCCCCCC N N CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbbbNNNbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbNNNbbbN NbbbNNNbbbN", - " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", - " CCCCCCCCC CCCCCCCCC ", "NbbbNNNbbbN NbN NbbbNNNbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " NNNbbbbbNNsNNbbbbbNNN ", " ss bCCCb bCCCb ss ", - " s N N N N s ", " s s ", - " N N N N N N ", " N bCCCb bCCCb N ", - " N sbbbbbNNsNNbbbbbs N ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CbC CbC N N CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbN NbbbN NbbbN", - " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", - " s s s s ", " NNN NNN NNN NNN ", - " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", - " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", - " CbC CbC CbC CbC ", "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, - { " N N N N ", " bCCCb bCCCb ", - " bCCCb bCCCb ", " bCCCb bCCCb ", - " N N N N ", " ", - " N N N N ", " bCCCb bCCCb ", - " bCCCb bCCCb ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", - " CCC CCC N N CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN NbbbN NbbbN", - " N N N N ", " N N N N ", - " ", " N N N N ", - " N N N N ", "NbbbN NbbbN NbbbN NbbbN", - " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", - " CCC CCC CCC CCC ", "NbbbN NbbbN N N NbbbN NbbbN", }, - { " ", " N N N N ", - " N N N N ", " N N N N ", - " ", " ", - " ", " N N N N ", - " N N N N ", " NNN NNN N N NNN NNN ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " ", - " ", " NNN NNN NNN NNN ", - " ", " ", - " ", " NNN NNN NNN NNN ", } }; + private static final String[][] structure_string = new String[][] { { " ", + " N N N N ", " N N N N ", " N N N N ", + " ", " ", " ", + " N N N N ", " N N N N ", " NNN NNN N N NNN NNN ", + " ", " ", " ", + " NNN NNN NNN NNN ", " ", " ", + " ", " ", " ", + " NNN NNN NNN NNN ", " ", " ", + " ", " NNN NNN NNN NNN " }, + { " N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", + " bCCCb bCCCb ", " N N N N ", + " ", " N N N N ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN N N NbbbN NbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " NNNbbbbbNNsNNbbbbbNNN ", + " ss bCCCb bCCCb ss ", " s N N N N s ", + " s s ", " N N N N N N ", + " N bCCCb bCCCb N ", " N sbbbbbNNsNNbbbbbs N ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", " s s s s ", + " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " ss bCCCb bCCCb ss ", + " bCCCb bCCCb ", " s NCCCN NCCCN s ", + " s NCCCN NCCCN s ", " NCCCN NCCCN ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", }, + { " ", " N N N N ", " s N N N N s ", + " s NCCCN NCCCN s ", " ", + " ", " ", + " NCCCN NCCCN ", " N N N N ", + " NNN NN N N NN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NbN NNN NNN ", }, + { " ", " ", " s s ", + " s NCCCN NCCCN s ", " ", + " ", " ", + " NCCCN NCCCN ", " ", + " N N N N ", " C C C C ", + " C C C C ", " C C C C ", + " N N N N ", " ", + " ", " ", + " ", " ", + " N N N N ", " C C C C ", + " C C C C ", " C C C C ", + " N N NbN N N ", }, + { " ", " N N N N ", " N N N N N N ", + " NCCCN NCCCN ", " ", + " ", " ", + " NCCCN NCCCN ", " N N N N ", + " NNN NN N N NN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NbN NNN NNN ", }, + { " N N N N ", " bCCCb bCCCb ", " N bCCCb bCCCb N ", + " bCCCb bCCCb ", " NCCCN NCCCN ", + " NCCCN NCCCN ", " NCCCN NCCCN ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " N sbbbbbNNsNNbbbbbs N ", + " bCCCb bCCCb ", " N N N N ", + " ", " N N N N ", + " bCCCb bCCCb ", " s sbbbbbNNsNNbbbbbs s ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", " s s s s ", + " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, + { " NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " NNN NNN N N NNN NNN ", + " N N N N ", " NNN NNN N N NNN NNN ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NNNN NNNCCCb bCCCNNN NNNN", " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbN NbbbN NbbbN", }, + { " ", " CCC CCC N N CCC CCC ", " CbC CbC N N CbC CbC ", + " CCCCCCCCC N N CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC N N CCCCCCCCC ", " CbC CbC N N CbC CbC ", + " CCC CCC N N CCC CCC ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " NNN NNN NbN NNN NNN ", }, + { " ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbN N N ", }, + { " ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbN N N ", }, + { " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", + "NbbbNNNbbbN NbbbNNNbbbN", " NNN NNN NNN NNN ", + " N N N N ", " NNN NNN NNN NNN ", + "NbbbNNNbbbN NbbbNNNbbbN", "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NsNsN N N ", }, + { " ", " ", " N N N N ", + " ", " ", + " ", " ", + " ", " N N N N ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbbbbbN N N ", }, + { " ", " ", " N N N N ", + " ", " ", + " ", " ", + " ", " N N N N ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " N ", + " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", }, + { " ", " ", " s s s s ", + " ", " ", + " ", " ", + " ", " s s s s ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ~ ", " NNN ", + " NbbbbbNbbbbNbbbbbNbbbbNbbbbbN ", }, + { " ", " ", " N N N N ", + " ", " ", + " ", " ", + " ", " N N N N ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " N ", + " NsNNNNNsNNNNsbbbbbsNNNNsNNNNNsN ", }, + { " ", " ", " N N N N ", + " ", " ", + " ", " ", + " ", " N N N N ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbbbbbN N N ", }, + { " NNN NNN NNN NNN ", "NbbbN NbbbN NbbbN NbbbN", "NbbbN NbbbN NbbbN NbbbN", + "NbbbNNNbbbN NbbbNNNbbbN", " NNN NNN NNN NNN ", + " N N N N ", " NNN NNN NNN NNN ", + "NbbbNNNbbbN NbbbNNNbbbN", "NbbbN NbbbN NbbbN NbbbN", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NsNsN N N ", }, + { " ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbN N N ", }, + { " ", " CCC CCC CCC CCC ", " CbC CbC CbC CbC ", + " CCCCCCCCC CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC CCCCCCCCC ", " CbC CbC CbC CbC ", + " CCC CCC CCC CCC ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " ", " ", + " N N NbN N N ", }, + { " ", " CCC CCC N N CCC CCC ", " CbC CbC N N CbC CbC ", + " CCCCCCCCC N N CCCCCCCCC ", " C C C C ", + " C C C C ", " C C C C ", + " CCCCCCCCC N N CCCCCCCCC ", " CbC CbC N N CbC CbC ", + " CCC CCC N N CCC CCC ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " NNN NNN NbN NNN NNN ", }, + { " NNN NNN N N NNN NNN ", "NbbbN NbbNCCCb bCCCNbbN NbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " NNN NNN N N NNN NNN ", + " N N N N ", " NNN NNN N N NNN NNN ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", "NbbbN NbbNCCCb bCCCNbbN NbbbN", + "NNNN NNNCCCb bCCCNNN NNNN", " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbN NbbbN NbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " N sbbbbbNNsNNbbbbbs N ", + " bCCCb bCCCb ", " N N N N ", + " ", " N N N N ", + " bCCCb bCCCb ", " s sbbbbbNNsNNbbbbbs s ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", " s s s s ", + " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " N bCCCb bCCCb N ", + " bCCCb bCCCb ", " NCCCN NCCCN ", + " NCCCN NCCCN ", " NCCCN NCCCN ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", }, + { " ", " N N N N ", " N N N N N N ", + " NCCCN NCCCN ", " ", + " ", " ", + " NCCCN NCCCN ", " N N N N ", + " NNN NN N N NN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NbN NNN NNN ", }, + { " ", " ", " s s ", + " s NCCCN NCCCN s ", " ", + " ", " ", + " NCCCN NCCCN ", " ", + " N N N N ", " C C C C ", + " C C C C ", " C C C C ", + " N N N N ", " ", + " ", " ", + " ", " ", + " N N N N ", " C C C C ", + " C C C C ", " C C C C ", + " N N NbN N N ", }, + { " ", " N N N N ", " s N N N N s ", + " s NCCCN NCCCN s ", " ", + " ", " ", + " NCCCN NCCCN ", " N N N N ", + " NNN NN N N NN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " C C C C ", + " C C C C ", " C C C C ", + " NNN NNN NbN NNN NNN ", }, + { " N N N N ", " bCCCb bCCCb ", " ss bCCCb bCCCb ss ", + " bCCCb bCCCb ", " s NCCCN NCCCN s ", + " s NCCCN NCCCN s ", " NCCCN NCCCN ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbNNNbbNCCCb bCCCNbbNNNbbbN", " CCCCCCCCC N N CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbbbNNNbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbNNNbbbN NbbbNNNbbbN", " CCCCCCCCC CCCCCCCCC ", + " CCCCCCCCC CCCCCCCCC ", " CCCCCCCCC CCCCCCCCC ", + "NbbbNNNbbbN NbN NbbbNNNbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " NNNbbbbbNNsNNbbbbbNNN ", + " ss bCCCb bCCCb ss ", " s N N N N s ", + " s s ", " N N N N N N ", + " N bCCCb bCCCb N ", " N sbbbbbNNsNNbbbbbs N ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CbC CbC N N CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbN NbbbN NbbbN", " NNN NNN NNN NNN ", + " NNN NNN NNN NNN ", " s s s s ", + " NNN NNN NNN NNN ", " NNN NNN NNN NNN ", + "NbbbN NbbbN NbbbN NbbbN", " CbC CbC CbC CbC ", + " CbC CbC CbC CbC ", " CbC CbC CbC CbC ", + "NbbbN NbbbNNNNNsNsNNNNNbbbN NbbbN", }, + { " N N N N ", " bCCCb bCCCb ", " bCCCb bCCCb ", + " bCCCb bCCCb ", " N N N N ", + " ", " N N N N ", + " bCCCb bCCCb ", " bCCCb bCCCb ", + "NbbbN NbbNCCCb bCCCNbbN NbbbN", " CCC CCC N N CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN NbbbN NbbbN", " N N N N ", + " N N N N ", " ", + " N N N N ", " N N N N ", + "NbbbN NbbbN NbbbN NbbbN", " CCC CCC CCC CCC ", + " CCC CCC CCC CCC ", " CCC CCC CCC CCC ", + "NbbbN NbbbN N N NbbbN NbbbN", }, + { " ", " N N N N ", " N N N N ", + " N N N N ", " ", + " ", " ", + " N N N N ", " N N N N ", + " NNN NNN N N NNN NNN ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " ", " ", + " NNN NNN NNN NNN ", " ", + " ", " ", + " NNN NNN NNN NNN ", } }; protected static final int DIM_TRANS_CASING = 12; protected static final int DIM_INJECTION_CASING = 13; @@ -480,44 +475,22 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul private boolean isMultiChunkloaded = true; protected static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_MetaTileEntity_PlasmaForge> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_PlasmaForge>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - structure_string) - .addElement( - 'C', - ofCoil( - GT_MetaTileEntity_PlasmaForge::setCoilLevel, - GT_MetaTileEntity_PlasmaForge::getCoilLevel)) - .addElement( - 'b', - buildHatchAdder( - GT_MetaTileEntity_PlasmaForge.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Energy, - ExoticEnergy, - Maintenance) - .casingIndex( - DIM_INJECTION_CASING) - .dot( - 3) - .buildAndChain( - GregTech_API.sBlockCasings1, - DIM_INJECTION_CASING)) - .addElement( - 'N', - ofBlock( - GregTech_API.sBlockCasings1, - DIM_TRANS_CASING)) - .addElement( - 's', - ofBlock( - GregTech_API.sBlockCasings1, - DIM_BRIDGE_CASING)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_PlasmaForge> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_PlasmaForge>builder() + .addShape(STRUCTURE_PIECE_MAIN, structure_string) + .addElement( + 'C', + ofCoil(GT_MetaTileEntity_PlasmaForge::setCoilLevel, GT_MetaTileEntity_PlasmaForge::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_PlasmaForge.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy, Maintenance) + .casingIndex(DIM_INJECTION_CASING) + .dot(3) + .buildAndChain(GregTech_API.sBlockCasings1, DIM_INJECTION_CASING)) + .addElement('N', ofBlock(GregTech_API.sBlockCasings1, DIM_TRANS_CASING)) + .addElement('s', ofBlock(GregTech_API.sBlockCasings1, DIM_BRIDGE_CASING)) + .build(); @Override protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -542,87 +515,87 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addInfo("Transcending Dimensional Boundaries.") - .addInfo( - "Takes " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(max_efficiency_time_in_ticks / (3600 * 20)) - + EnumChatFormatting.GRAY - + " hours of continuous run time to fully breach dimensional") - .addInfo("boundaries and achieve maximum efficiency. This reduces fuel") - .addInfo( - "consumption by up to " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(100 * maximum_discount) - + "%" - + EnumChatFormatting.GRAY - + ". Supports overclocking beyond MAX voltage.") - .addInfo(AuthorColen) - .addSeparator() - .beginStructureBlock(33, 24, 33, false) - .addStructureInfo("DTPF Structure is too complex! See schematic for details.") - .addStructureInfo(EnumChatFormatting.GOLD + "2,112" + EnumChatFormatting.GRAY + " Heating coils required.") - .addStructureInfo( - EnumChatFormatting.GOLD + "120" + EnumChatFormatting.GRAY + " Dimensional bridge blocks required.") - .addStructureInfo( - EnumChatFormatting.GOLD + "1,270" - + EnumChatFormatting.GRAY - + " Dimensional injection casings required.") - .addStructureInfo( - EnumChatFormatting.GOLD + "2,121" - + EnumChatFormatting.GRAY - + " Dimensionally transcendent casings required.") - .addStructureInfo("--------------------------------------------") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + "1" - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + "2" - + EnumChatFormatting.GRAY - + " energy hatches or " - + EnumChatFormatting.GOLD - + "1" - + EnumChatFormatting.GRAY - + " TT energy hatch.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + min_input_hatch - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + max_input_hatch - + EnumChatFormatting.GRAY - + " input hatches.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + min_output_hatch - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + max_output_hatch - + EnumChatFormatting.GRAY - + " output hatches.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + min_input_bus - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + max_input_bus - + EnumChatFormatting.GRAY - + " input busses.") - .addStructureInfo( - "Requires " + EnumChatFormatting.GOLD - + min_output_bus - + EnumChatFormatting.GRAY - + "-" - + EnumChatFormatting.GOLD - + max_input_bus - + EnumChatFormatting.GRAY - + " output busses.") - .addStructureInfo("--------------------------------------------") - .toolTipFinisher("Gregtech"); + .addInfo( + "Takes " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(max_efficiency_time_in_ticks / (3600 * 20)) + + EnumChatFormatting.GRAY + + " hours of continuous run time to fully breach dimensional") + .addInfo("boundaries and achieve maximum efficiency. This reduces fuel") + .addInfo( + "consumption by up to " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(100 * maximum_discount) + + "%" + + EnumChatFormatting.GRAY + + ". Supports overclocking beyond MAX voltage.") + .addInfo(AuthorColen) + .addSeparator() + .beginStructureBlock(33, 24, 33, false) + .addStructureInfo("DTPF Structure is too complex! See schematic for details.") + .addStructureInfo(EnumChatFormatting.GOLD + "2,112" + EnumChatFormatting.GRAY + " Heating coils required.") + .addStructureInfo( + EnumChatFormatting.GOLD + "120" + EnumChatFormatting.GRAY + " Dimensional bridge blocks required.") + .addStructureInfo( + EnumChatFormatting.GOLD + "1,270" + + EnumChatFormatting.GRAY + + " Dimensional injection casings required.") + .addStructureInfo( + EnumChatFormatting.GOLD + "2,121" + + EnumChatFormatting.GRAY + + " Dimensionally transcendent casings required.") + .addStructureInfo("--------------------------------------------") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + "1" + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + "2" + + EnumChatFormatting.GRAY + + " energy hatches or " + + EnumChatFormatting.GOLD + + "1" + + EnumChatFormatting.GRAY + + " TT energy hatch.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " maintenance hatch.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + min_input_hatch + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + max_input_hatch + + EnumChatFormatting.GRAY + + " input hatches.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + min_output_hatch + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + max_output_hatch + + EnumChatFormatting.GRAY + + " output hatches.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + min_input_bus + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + max_input_bus + + EnumChatFormatting.GRAY + + " input busses.") + .addStructureInfo( + "Requires " + EnumChatFormatting.GOLD + + min_output_bus + + EnumChatFormatting.GRAY + + "-" + + EnumChatFormatting.GOLD + + max_input_bus + + EnumChatFormatting.GRAY + + " output busses.") + .addStructureInfo("--------------------------------------------") + .toolTipFinisher("Gregtech"); return tt; } @@ -634,22 +607,21 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING], TextureFactory.builder() - .addIcon( - OVERLAY_DTPF_ON) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_DTPF_ON) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING], TextureFactory.builder() - .addIcon(OVERLAY_DTPF_OFF) - .extFacing() - .build() }; + .addIcon(OVERLAY_DTPF_OFF) + .extFacing() + .build() }; } return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING] }; } @@ -692,12 +664,8 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul long tTotalEU = GT_ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()); // Look up recipe. If not found it will return null. - GT_Recipe tRecipe_0 = GT_Recipe.GT_Recipe_Map.sPlasmaForgeRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - tTotalEU, - tFluids, - tItems); + GT_Recipe tRecipe_0 = GT_Recipe.GT_Recipe_Map.sPlasmaForgeRecipes + .findRecipe(getBaseMetaTileEntity(), false, tTotalEU, tFluids, tItems); // Check if recipe found. if (tRecipe_0 == null) return false; @@ -847,69 +815,67 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } return new String[] { "------------ Critical Information ------------", - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime) - + EnumChatFormatting.RESET - + "t / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime) - + EnumChatFormatting.RESET - + "t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-EU_per_tick) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers( - GT_ExoticEnergyInputHelper.getAverageInputVoltageMulti( - getExoticAndNormalEnergyHatchList())) - + EnumChatFormatting.RESET - + " EU/t(*" - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers( - GT_ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti( - getExoticAndNormalEnergyHatchList())) - + EnumChatFormatting.RESET - + "A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier( - GT_ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()))] - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.EBF.heat") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mHeatingCapacity) - + EnumChatFormatting.RESET - + " K", - "Ticks run: " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(running_time) - + EnumChatFormatting.RESET - + ", Fuel Discount: " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(100 * (1 - discount)) - + EnumChatFormatting.RESET - + "%", - "-----------------------------------------" }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime) + + EnumChatFormatting.RESET + + "t / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime) + + EnumChatFormatting.RESET + + "t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-EU_per_tick) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getAverageInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + + " EU/t(*" + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxWorkingInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + + "A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility + .getTier(GT_ExoticEnergyInputHelper.getTotalEuMulti(getExoticAndNormalEnergyHatchList()))] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.EBF.heat") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mHeatingCapacity) + + EnumChatFormatting.RESET + + " K", + "Ticks run: " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(running_time) + + EnumChatFormatting.RESET + + ", Fuel Discount: " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(100 * (1 - discount)) + + EnumChatFormatting.RESET + + "%", + "-----------------------------------------" }; } public List<GT_MetaTileEntity_Hatch> getExoticAndNormalEnergyHatchList() { @@ -941,32 +907,32 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul int ControllerZCoordinate = ((TileEntity) aBaseMetaTileEntity).zCoord; GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate + 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate + 16)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate - 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate, ControllerZCoordinate - 16)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate + 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate + 16)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate - 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate + 16, ControllerZCoordinate - 16)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate + 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate + 16)); GT_ChunkManager.requestChunkLoad( - (TileEntity) aBaseMetaTileEntity, - new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate - 16)); + (TileEntity) aBaseMetaTileEntity, + new ChunkCoordIntPair(ControllerXCoordinate - 16, ControllerZCoordinate - 16)); isMultiChunkloaded = true; } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java index 4c847e0fb7..ccd536d341 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -44,7 +44,7 @@ import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; import gregtech.common.GT_Pollution; public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEntity - implements IAlignment, ISurvivalConstructable, IAddUIWidgets, IGetTitleColor { + implements IAlignment, ISurvivalConstructable, IAddUIWidgets, IGetTitleColor { public static final int INPUT_SLOTS = 3, OUTPUT_SLOTS = 3; private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_PrimitiveBlastFurnace>> STRUCTURE_DEFINITION = new ClassValue<>() { @@ -52,20 +52,16 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override protected IStructureDefinition<GT_MetaTileEntity_PrimitiveBlastFurnace> computeValue(Class<?> type) { return IStructureDefinition.<GT_MetaTileEntity_PrimitiveBlastFurnace>builder() - .addShape( - "main", - transpose( - new String[][] { { "ccc", "c-c", "ccc" }, - { "ccc", "clc", "ccc" }, { "c~c", "clc", "ccc" }, - { "ccc", "ccc", "ccc" }, })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMetaID()))) - .addElement( - 'l', - ofChain( - isAir(), - ofBlockAnyMeta(Blocks.lava, 1), - ofBlockAnyMeta(Blocks.flowing_lava, 1))) - .build(); + .addShape( + "main", + transpose( + new String[][] { { "ccc", "c-c", "ccc" }, { "ccc", "clc", "ccc" }, { "c~c", "clc", "ccc" }, + { "ccc", "ccc", "ccc" }, })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMetaID()))) + .addElement( + 'l', + ofChain(isAir(), ofBlockAnyMeta(Blocks.lava, 1), ofBlockAnyMeta(Blocks.flowing_lava, 1))) + .build(); } }; @@ -160,8 +156,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { return (GregTech_API.getCoverBehaviorNew(aCoverID.toStack()) - .isSimpleCover()) - && (super.allowCoverOnSide(aSide, aCoverID)); + .isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID)); } @Override @@ -207,8 +202,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override public void setExtendedFacing(ExtendedFacing alignment) { getBaseMetaTileEntity().setFrontFacing( - (byte) alignment.getDirection() - .ordinal()); + (byte) alignment.getDirection() + .ordinal()); } @Override @@ -218,18 +213,18 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn private boolean checkMachine() { return STRUCTURE_DEFINITION.get(this.getClass()) - .check( - this, - "main", - getBaseMetaTileEntity().getWorld(), - getExtendedFacing(), - getBaseMetaTileEntity().getXCoord(), - getBaseMetaTileEntity().getYCoord(), - getBaseMetaTileEntity().getZCoord(), - 1, - 2, - 0, - !mMachine); + .check( + this, + "main", + getBaseMetaTileEntity().getWorld(), + getExtendedFacing(), + getBaseMetaTileEntity().getXCoord(), + getBaseMetaTileEntity().getYCoord(), + getBaseMetaTileEntity().getZCoord(), + 1, + 2, + 0, + !mMachine); } protected abstract Block getCasingBlock(); @@ -248,15 +243,13 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0D, 0.3D, 0D) - .setIdentifier(ParticleFX.LARGE_SMOKE) - .setPosition( - lavaX + XSTR_INSTANCE.nextFloat(), - aBaseMetaTileEntity.getOffsetY( - aBaseMetaTileEntity.getBackFacing(), - 1), - lavaZ + XSTR_INSTANCE.nextFloat()) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setIdentifier(ParticleFX.LARGE_SMOKE) + .setPosition( + lavaX + XSTR_INSTANCE.nextFloat(), + aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), + lavaZ + XSTR_INSTANCE.nextFloat()) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } if (aBaseMetaTileEntity.isServerSide()) { if (mUpdated) { @@ -275,9 +268,9 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn this.mProgresstime = 0; this.mMaxProgresstime = 0; GT_Mod.achievements.issueAchievement( - aBaseMetaTileEntity.getWorld() - .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), - "steel"); + aBaseMetaTileEntity.getWorld() + .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), + "steel"); } } else if (aBaseMetaTileEntity.isAllowedToWork()) { checkRecipe(); @@ -285,8 +278,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } if (this.mMaxProgresstime > 0 && (aTimer % 20L == 0L)) { GT_Pollution.addPollution( - this.getBaseMetaTileEntity(), - GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); + this.getBaseMetaTileEntity(), + GT_Mod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond); } aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); @@ -294,12 +287,12 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn if (aBaseMetaTileEntity.isActive()) { if (aBaseMetaTileEntity.getAir(lavaX, lavaY, lavaZ)) { aBaseMetaTileEntity.getWorld() - .setBlock(lavaX, lavaY, lavaZ, Blocks.lava, 1, 2); + .setBlock(lavaX, lavaY, lavaZ, Blocks.lava, 1, 2); this.mUpdate = 1; } if (aBaseMetaTileEntity.getAir(lavaX, lavaY + 1, lavaZ)) { aBaseMetaTileEntity.getWorld() - .setBlock(lavaX, lavaY + 1, lavaZ, Blocks.lava, 1, 2); + .setBlock(lavaX, lavaY + 1, lavaZ, Blocks.lava, 1, 2); this.mUpdate = 1; } } else { @@ -307,12 +300,12 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn Block upperLava = aBaseMetaTileEntity.getBlock(lavaX, lavaY + 1, lavaZ); if (lowerLava == Blocks.lava) { aBaseMetaTileEntity.getWorld() - .setBlock(lavaX, lavaY, lavaZ, Blocks.air, 0, 2); + .setBlock(lavaX, lavaY, lavaZ, Blocks.air, 0, 2); this.mUpdate = 1; } if (upperLava == Blocks.lava) { aBaseMetaTileEntity.getWorld() - .setBlock(lavaX, lavaY + 1, lavaZ, Blocks.air, 0, 2); + .setBlock(lavaX, lavaY + 1, lavaZ, Blocks.air, 0, 2); this.mUpdate = 1; } } @@ -364,13 +357,12 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(0D, 0D, 0D) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.SMOKE) - .run(); + .run(); particleEventBuilder.setIdentifier(ParticleFX.FLAME) - .run(); + .run(); } } @@ -394,8 +386,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn this.mInventory[absi] = GT_Utility.copyOrNull(this.mOutputItems[i]); } else if (GT_Utility.areStacksEqual(this.mInventory[absi], this.mOutputItems[i])) { this.mInventory[absi].stackSize = Math.min( - this.mInventory[absi].getMaxStackSize(), - this.mInventory[absi].stackSize + this.mOutputItems[i].stackSize); + this.mInventory[absi].getMaxStackSize(), + this.mInventory[absi].stackSize + this.mOutputItems[i].stackSize); } } } @@ -406,8 +398,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn return true; } return ((this.mInventory[absoluteSlot].stackSize + outputStack.stackSize - <= this.mInventory[absoluteSlot].getMaxStackSize()) - && (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack))); + <= this.mInventory[absoluteSlot].getMaxStackSize()) + && (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack))); } private boolean checkRecipe() { @@ -469,21 +461,21 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; return STRUCTURE_DEFINITION.get(getClass()) - .survivalBuild( - this, - stackSize, - "main", - getBaseMetaTileEntity().getWorld(), - getExtendedFacing(), - getBaseMetaTileEntity().getXCoord(), - getBaseMetaTileEntity().getYCoord(), - getBaseMetaTileEntity().getZCoord(), - 1, - 2, - 0, - elementBudget, - env, - false); + .survivalBuild( + this, + stackSize, + "main", + getBaseMetaTileEntity().getWorld(), + getExtendedFacing(), + getBaseMetaTileEntity().getXCoord(), + getBaseMetaTileEntity().getYCoord(), + getBaseMetaTileEntity().getZCoord(), + 1, + 2, + 0, + elementBudget, + env, + false); } @Override @@ -494,19 +486,19 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override public void construct(ItemStack stackSize, boolean hintsOnly) { STRUCTURE_DEFINITION.get(getClass()) - .buildOrHints( - this, - stackSize, - "main", - getBaseMetaTileEntity().getWorld(), - getExtendedFacing(), - getBaseMetaTileEntity().getXCoord(), - getBaseMetaTileEntity().getYCoord(), - getBaseMetaTileEntity().getZCoord(), - 1, - 2, - 0, - hintsOnly); + .buildOrHints( + this, + stackSize, + "main", + getBaseMetaTileEntity().getWorld(), + getExtendedFacing(), + getBaseMetaTileEntity().getXCoord(), + getBaseMetaTileEntity().getYCoord(), + getBaseMetaTileEntity().getZCoord(), + 1, + 2, + 0, + hintsOnly); } @Override @@ -516,54 +508,49 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( + builder + .widget( new SlotWidget(inventoryHandler, 0) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_INGOT_STEAM.get( - getSteamVariant())) - .setPos(33, 15)) - .widget( - new SlotWidget(inventoryHandler, 1) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get( - getSteamVariant())) - .setPos(33, 33)) - .widget( - new SlotWidget(inventoryHandler, 2) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM.get( - getSteamVariant())) - .setPos(33, 51)) - .widget( - new SlotWidget(inventoryHandler, 3).setAccess(true, false) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_INGOT_STEAM.get( - getSteamVariant())) - .setPos(85, 24)) - .widget( - new SlotWidget(inventoryHandler, 4).setAccess(true, false) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get( - getSteamVariant())) - .setPos(103, 24)) - .widget( - new SlotWidget(inventoryHandler, 5).setAccess(true, false) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get( - getSteamVariant())) - .setPos(121, 24)) - .widget( - new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ARROW_2_STEAM.get(getSteamVariant()), 20) - .setProgress(() -> (float) mProgresstime / mMaxProgresstime) - .setNEITransferRect(getRecipeMap().mNEIName) - .setPos(58, 24) - .setSize(20, 18)); + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_INGOT_STEAM.get(getSteamVariant())) + .setPos(33, 15)) + .widget( + new SlotWidget(inventoryHandler, 1) + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant())) + .setPos(33, 33)) + .widget( + new SlotWidget(inventoryHandler, 2) + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM.get(getSteamVariant())) + .setPos(33, 51)) + .widget( + new SlotWidget(inventoryHandler, 3).setAccess(true, false) + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_INGOT_STEAM.get(getSteamVariant())) + .setPos(85, 24)) + .widget( + new SlotWidget(inventoryHandler, 4).setAccess(true, false) + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant())) + .setPos(103, 24)) + .widget( + new SlotWidget(inventoryHandler, 5).setAccess(true, false) + .setBackground( + getGUITextureSet().getItemSlot(), + GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant())) + .setPos(121, 24)) + .widget( + new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ARROW_2_STEAM.get(getSteamVariant()), 20) + .setProgress(() -> (float) mProgresstime / mMaxProgresstime) + .setNEITransferRect(getRecipeMap().mNEIName) + .setPos(58, 24) + .setSize(20, 18)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index d50b7debfa..6e60396af4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -59,7 +59,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Item_Machines; public class GT_MetaTileEntity_ProcessingArray - extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ProcessingArray> { + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ProcessingArray> { private GT_Recipe_Map mLastRecipeMap; private GT_Recipe mLastRecipe; @@ -87,57 +87,55 @@ public class GT_MetaTileEntity_ProcessingArray protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Processing Array") - .addInfo("Runs supplied machines as if placed in the world") - .addInfo("Place up to 64 singleblock GT machines into the controller") - .addInfo("Note that you still need to supply power to them all") - .addInfo("Use a screwdriver to enable separate input busses") - .addInfo("Use a wire cutter to disable UEV+ downtiering") - .addInfo("Doesn't work on certain machines, deal with it") - .addInfo("Use it if you hate GT++, or want even more speed later on") - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfoRange("Robust Tungstensteel Machine Casing", 14, 24, false) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addInputBus("Any casing", 1) - .addInputHatch("Any casing", 1) - .addOutputBus("Any casing", 1) - .addOutputHatch("Any casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Runs supplied machines as if placed in the world") + .addInfo("Place up to 64 singleblock GT machines into the controller") + .addInfo("Note that you still need to supply power to them all") + .addInfo("Use a screwdriver to enable separate input busses") + .addInfo("Use a wire cutter to disable UEV+ downtiering") + .addInfo("Doesn't work on certain machines, deal with it") + .addInfo("Use it if you hate GT++, or want even more speed later on") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoRange("Robust Tungstensteel Machine Casing", 14, 24, false) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputBus("Any casing", 1) + .addOutputHatch("Any casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { return super.addToMachineList(aTileEntity, aBaseCasingIndex) - || addExoticEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + || addExoticEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.casingTexturePages[0][48], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.casingTexturePages[0][48], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_PROCESSING_ARRAY) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PROCESSING_ARRAY_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][48] }; } @@ -156,9 +154,9 @@ public class GT_MetaTileEntity_ProcessingArray public GT_Recipe_Map getRecipeMap() { if (isCorrectMachinePart(mInventory[1])) { int length = mInventory[1].getUnlocalizedName() - .length(); + .length(); String aMachineName = mInventory[1].getUnlocalizedName() - .substring(17, length - 8); + .substring(17, length - 8); return GT_ProcessingArray_Manager.giveRecipeMap(aMachineName); } return null; @@ -167,7 +165,7 @@ public class GT_MetaTileEntity_ProcessingArray @Override public boolean isCorrectMachinePart(ItemStack aStack) { return aStack != null && aStack.getUnlocalizedName() - .startsWith("gt.blockmachines."); + .startsWith("gt.blockmachines."); } @Override @@ -190,9 +188,9 @@ public class GT_MetaTileEntity_ProcessingArray boolean result = checkRecipe(mInventory[1]); if (result) { int length = mInventory[1].getUnlocalizedName() - .length(); + .length(); String aMachineName = mInventory[1].getUnlocalizedName() - .substring(17, length - 8); + .substring(17, length - 8); SoundResource sound = GT_ProcessingArray_Manager.getSoundResource(aMachineName); if (sound != null) { sendLoopStart((byte) sound.id); @@ -265,32 +263,31 @@ public class GT_MetaTileEntity_ProcessingArray int parallel = tSingleRecipeCheck.checkRecipeInputs(true, machines); return processRecipeOutputs( - tSingleRecipeCheck.getRecipe(), - tSingleRecipeCheck.getRecipeAmperage(), - parallel, - 1); + tSingleRecipeCheck.getRecipe(), + tSingleRecipeCheck.getRecipeAmperage(), + parallel, + 1); } public boolean processRecipe(ItemStack[] tInputs, FluidStack[] tFluids, GT_Recipe.GT_Recipe_Map map) { if (tInputs.length <= 0 && tFluids.length <= 0) return false; GT_Recipe tRecipe = map.findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluids, - tInputs); + getBaseMetaTileEntity(), + mLastRecipe, + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluids, + tInputs); if (tRecipe == null) return false; if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100 - && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) - return false; + && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return false; GT_Single_Recipe_Check_Processing_Array.Builder tSingleRecipeCheckBuilder = null; if (mLockedToSingleRecipe) { // We're locked to a single recipe, but haven't built the recipe checker yet. // Build the checker on next successful recipe. tSingleRecipeCheckBuilder = GT_Single_Recipe_Check_Processing_Array.processingArrayBuilder(this) - .setBefore(tInputs, tFluids); + .setBefore(tInputs, tFluids); } boolean recipeLocked = false; @@ -303,9 +300,9 @@ public class GT_MetaTileEntity_ProcessingArray } else if (mLockedToSingleRecipe && !recipeLocked) { // We want to lock to a single run of the recipe. mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter(tInputs, tFluids) - .setRecipe(tRecipe) - .setRecipeAmperage(map.mAmperage) - .build(); + .setRecipe(tRecipe) + .setRecipeAmperage(map.mAmperage) + .build(); recipeLocked = true; } } @@ -335,11 +332,11 @@ public class GT_MetaTileEntity_ProcessingArray this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; ProcessingArrayCalculateOverclock( - aRecipe.mEUt, - aRecipe.mDuration * multiplier, - aAmperage, - GT_Values.V[tTier], - false); + aRecipe.mEUt, + aRecipe.mDuration * multiplier, + aAmperage, + GT_Values.V[tTier], + false); // In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUPerTick == Long.MAX_VALUE - 1) return false; mEUPerTick = mEUPerTick * parallel; @@ -352,14 +349,14 @@ public class GT_MetaTileEntity_ProcessingArray for (int h = 0; h < aRecipe.mOutputs.length; h++) { if (aRecipe.getOutput(h) != null) { tOut[h] = aRecipe.getOutput(h) - .copy(); + .copy(); tOut[h].stackSize = 0; } } FluidStack[] tFOut = new FluidStack[aRecipe.mFluidOutputs.length]; for (int i = 0; i < aRecipe.mFluidOutputs.length; i++) if (aRecipe.getFluidOutput(i) != null) tFOut[i] = aRecipe.getFluidOutput(i) - .copy(); + .copy(); for (int f = 0; f < tOut.length; f++) { if (aRecipe.mOutputs[f] != null && tOut[f] != null) { for (int g = 0; g < parallel * multiplier; g++) { @@ -378,10 +375,10 @@ public class GT_MetaTileEntity_ProcessingArray } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = Arrays.stream(tOut) - .filter(Objects::nonNull) - .flatMap(GT_MetaTileEntity_ProcessingArray::splitOversizedStack) - .filter(is -> is.stackSize > 0) - .toArray(ItemStack[]::new); + .filter(Objects::nonNull) + .flatMap(GT_MetaTileEntity_ProcessingArray::splitOversizedStack) + .filter(is -> is.stackSize > 0) + .toArray(ItemStack[]::new); this.mOutputFluids = tFOut; updateSlots(); return true; @@ -463,14 +460,14 @@ public class GT_MetaTileEntity_ProcessingArray } else { inputSeparation = !inputSeparation; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + inputSeparation); } } @Override public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (aPlayer.isSneaking()) { batchMode = !batchMode; if (batchMode) { @@ -504,15 +501,8 @@ public class GT_MetaTileEntity_ProcessingArray @Override protected List<IHatchElement<? super GT_MetaTileEntity_CubicMultiBlockBase<?>>> getAllowedHatches() { - return ImmutableList.of( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Muffler, - Maintenance, - Energy, - ExoticEnergy); + return ImmutableList + .of(InputHatch, OutputHatch, InputBus, OutputBus, Muffler, Maintenance, Energy, ExoticEnergy); } @Override @@ -533,78 +523,77 @@ public class GT_MetaTileEntity_ProcessingArray for (GT_MetaTileEntity_Hatch tHatch : mExoticEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy += tHatch.getBaseMetaTileEntity() - .getStoredEU(); + .getStoredEU(); maxEnergy += tHatch.getBaseMetaTileEntity() - .getEUCapacity(); + .getEUCapacity(); } } return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) - + EnumChatFormatting.RESET - + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) - + EnumChatFormatting.RESET - + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) - + EnumChatFormatting.RESET - + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) - + EnumChatFormatting.RESET - + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " - + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-mEUPerTick) - + EnumChatFormatting.RESET - + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers( - GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) - + EnumChatFormatting.RESET - + " EU/t(*" - + GT_Utility.formatNumbers( - GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) - + "A) " - + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " - + EnumChatFormatting.YELLOW - + VN[GT_Utility.getTier( - GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti( - getExoticAndNormalEnergyHatchList()))] - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " - + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " - + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F - + EnumChatFormatting.RESET - + " %", - StatCollector.translateToLocal("GT5U.PA.machinetier") + ": " - + EnumChatFormatting.GREEN - + tTier - + EnumChatFormatting.RESET - + " " - + StatCollector.translateToLocal("GT5U.PA.discount") - + ": " - + EnumChatFormatting.GREEN - + 1 - + EnumChatFormatting.RESET - + " x", - StatCollector.translateToLocal("GT5U.PA.parallel") + ": " - + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers((mInventory[1] != null) ? (mInventory[1].stackSize << mMult) : 0) - + EnumChatFormatting.RESET }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-mEUPerTick) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers( + GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList())) + + EnumChatFormatting.RESET + + " EU/t(*" + + GT_Utility + .formatNumbers(GT_ExoticEnergyInputHelper.getMaxInputAmpsMulti(getExoticAndNormalEnergyHatchList())) + + "A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + VN[GT_Utility + .getTier(GT_ExoticEnergyInputHelper.getMaxInputVoltageMulti(getExoticAndNormalEnergyHatchList()))] + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.PA.machinetier") + ": " + + EnumChatFormatting.GREEN + + tTier + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.PA.discount") + + ": " + + EnumChatFormatting.GREEN + + 1 + + EnumChatFormatting.RESET + + " x", + StatCollector.translateToLocal("GT5U.PA.parallel") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers((mInventory[1] != null) ? (mInventory[1].stackSize << mMult) : 0) + + EnumChatFormatting.RESET }; } public List<GT_MetaTileEntity_Hatch> getExoticAndNormalEnergyHatchList() { @@ -627,7 +616,7 @@ public class GT_MetaTileEntity_ProcessingArray } protected void ProcessingArrayCalculateOverclock(long aEUt, int aDuration, int mAmperage, long maxInputVoltage, - boolean perfectOC) { + boolean perfectOC) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { // Long time calculation @@ -689,22 +678,22 @@ public class GT_MetaTileEntity_ProcessingArray super.addUIWidgets(builder, buildContext); builder.widget( - new ButtonWidget().setOnClick((clickData, widget) -> downtierUEV = !downtierUEV) - .setPlayClickSound(true) - .setBackground(() -> { - List<UITexture> ret = new ArrayList<>(); - ret.add(GT_UITextures.BUTTON_STANDARD); - if (downtierUEV) { - ret.add(GT_UITextures.OVERLAY_BUTTON_DOWN_TIERING_ON); - } else { - ret.add(GT_UITextures.OVERLAY_BUTTON_DOWN_TIERING_OFF); - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(80, 91) - .setSize(16, 16) - .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.down_tier")) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) - .widget(new FakeSyncWidget.BooleanSyncer(() -> downtierUEV, val -> downtierUEV = val)); + new ButtonWidget().setOnClick((clickData, widget) -> downtierUEV = !downtierUEV) + .setPlayClickSound(true) + .setBackground(() -> { + List<UITexture> ret = new ArrayList<>(); + ret.add(GT_UITextures.BUTTON_STANDARD); + if (downtierUEV) { + ret.add(GT_UITextures.OVERLAY_BUTTON_DOWN_TIERING_ON); + } else { + ret.add(GT_UITextures.OVERLAY_BUTTON_DOWN_TIERING_OFF); + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(80, 91) + .setSize(16, 16) + .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.down_tier")) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget(new FakeSyncWidget.BooleanSyncer(() -> downtierUEV, val -> downtierUEV = val)); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index b674560fa5..00b3a1ff10 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -38,8 +38,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Single_Recipe_Check; import gregtech.api.util.GT_Utility; -public class GT_MetaTileEntity_PyrolyseOven extends - GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_PyrolyseOven> implements ISurvivalConstructable { +public class GT_MetaTileEntity_PyrolyseOven + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_PyrolyseOven> implements ISurvivalConstructable { private HeatingCoilLevel coilHeat; // public static GT_CopiedBlockTexture mTextureULV = new @@ -50,53 +50,35 @@ public class GT_MetaTileEntity_PyrolyseOven extends private static IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> createStructureDefinition() { IStructureElement<GT_MetaTileEntity_PyrolyseOven> tCasingElement = NewHorizonsCoreMod.isModLoaded() - ? ofBlockUnlocalizedName(NewHorizonsCoreMod.ID, "gt.blockcasingsNH", 2) - : ofBlock(GregTech_API.sBlockCasings1, 0); + ? ofBlockUnlocalizedName(NewHorizonsCoreMod.ID, "gt.blockcasingsNH", 2) + : ofBlock(GregTech_API.sBlockCasings1, 0); return StructureDefinition.<GT_MetaTileEntity_PyrolyseOven>builder() - .addShape( - "main", - transpose( - new String[][] { { "ccccc", "ctttc", "ctttc", "ctttc", "ccccc" }, - { "ccccc", "c---c", "c---c", "c---c", "ccccc" }, - { "ccccc", "c---c", "c---c", "c---c", "ccccc" }, - { "bb~bb", "bCCCb", "bCCCb", "bCCCb", "bbbbb" }, })) - .addElement( - 'c', - onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)) - .addElement( - 'C', - ofCoil( - GT_MetaTileEntity_PyrolyseOven::setCoilLevel, - GT_MetaTileEntity_PyrolyseOven::getCoilLevel)) - .addElement( - 'b', - buildHatchAdder( - GT_MetaTileEntity_PyrolyseOven.class).atLeast( - OutputBus, - OutputHatch, - Energy, - Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_PyrolyseOven::onCasingAdded, - tCasingElement))) - .addElement( - 't', - buildHatchAdder( - GT_MetaTileEntity_PyrolyseOven.class).atLeast( - InputBus, - InputHatch, - Muffler) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain( - onElementPass( - GT_MetaTileEntity_PyrolyseOven::onCasingAdded, - tCasingElement))) - .build(); + .addShape( + "main", + transpose( + new String[][] { { "ccccc", "ctttc", "ctttc", "ctttc", "ccccc" }, + { "ccccc", "c---c", "c---c", "c---c", "ccccc" }, + { "ccccc", "c---c", "c---c", "c---c", "ccccc" }, + { "bb~bb", "bCCCb", "bCCCb", "bCCCb", "bbbbb" }, })) + .addElement('c', onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)) + .addElement( + 'C', + ofCoil(GT_MetaTileEntity_PyrolyseOven::setCoilLevel, GT_MetaTileEntity_PyrolyseOven::getCoilLevel)) + .addElement( + 'b', + buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class) + .atLeast(OutputBus, OutputHatch, Energy, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement))) + .addElement( + 't', + buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class).atLeast(InputBus, InputHatch, Muffler) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement))) + .build(); } private int mCasingAmount; @@ -113,52 +95,50 @@ public class GT_MetaTileEntity_PyrolyseOven extends protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Coke Oven") - .addInfo("Controller block for the Pyrolyse Oven") - .addInfo("Industrial Charcoal producer") - .addInfo("Processing speed scales linearly with Coil tier:") - .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, TPV: 200%, etc.") - .addInfo("EU/t is not affected by Coil tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(5, 4, 5, true) - .addController("Front center") - .addCasingInfoRange("Pyrolyse Oven Casing", 60, 80, false) - .addOtherStructurePart("Heating Coils", "Center 3x1x3 of the bottom layer") - .addEnergyHatch("Any bottom layer casing", 1) - .addMaintenanceHatch("Any bottom layer casing", 1) - .addMufflerHatch("Center 3x1x3 area in top layer", 2) - .addInputBus("Center 3x1x3 area in top layer", 2) - .addInputHatch("Center 3x1x3 area in top layer", 2) - .addOutputBus("Any bottom layer casing", 1) - .addOutputHatch("Any bottom layer casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller block for the Pyrolyse Oven") + .addInfo("Industrial Charcoal producer") + .addInfo("Processing speed scales linearly with Coil tier:") + .addInfo("CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, TPV: 200%, etc.") + .addInfo("EU/t is not affected by Coil tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(5, 4, 5, true) + .addController("Front center") + .addCasingInfoRange("Pyrolyse Oven Casing", 60, 80, false) + .addOtherStructurePart("Heating Coils", "Center 3x1x3 of the bottom layer") + .addEnergyHatch("Any bottom layer casing", 1) + .addMaintenanceHatch("Any bottom layer casing", 1) + .addMufflerHatch("Center 3x1x3 area in top layer", 2) + .addInputBus("Center 3x1x3 area in top layer", 2) + .addInputHatch("Center 3x1x3 area in top layer", 2) + .addOutputBus("Any bottom layer casing", 1) + .addOutputHatch("Any bottom layer casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { BlockIcons.casingTexturePages[8][66], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { BlockIcons.casingTexturePages[8][66], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_PYROLYSE_OVEN) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_PYROLYSE_OVEN_GLOW) + .extFacing() + .glow() + .build() }; } return new ITexture[] { Textures.BlockIcons.casingTexturePages[8][66] }; } @@ -196,22 +176,18 @@ public class GT_MetaTileEntity_PyrolyseOven extends // We're locked to a single recipe, but haven't built the recipe checker yet. // Build the checker on next successful recipe. tSingleRecipeCheckBuilder = GT_Single_Recipe_Check.builder(this) - .setBefore(); + .setBefore(); } - tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluids, - tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes + .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; if (mLockedToSingleRecipe) { mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter() - .setRecipe(tRecipe) - .build(); + .setRecipe(tRecipe) + .build(); } } @@ -252,8 +228,8 @@ public class GT_MetaTileEntity_PyrolyseOven extends mCasingAmount = 0; replaceDeprecatedCoils(aBaseMetaTileEntity); return checkPiece("main", 2, 3, 0) && mCasingAmount >= 60 - && mMaintenanceHatches.size() == 1 - && !mMufflerHatches.isEmpty(); + && mMaintenanceHatches.size() == 1 + && !mMufflerHatches.isEmpty(); } @Override @@ -295,9 +271,9 @@ public class GT_MetaTileEntity_PyrolyseOven extends for (int xPos = tX - 1; xPos <= tX + 1; xPos++) { for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) { if (aBaseMetaTileEntity.getBlock(xPos, tY, zPos) == GregTech_API.sBlockCasings1 - && aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) { + && aBaseMetaTileEntity.getMetaID(xPos, tY, zPos) == 13) { aBaseMetaTileEntity.getWorld() - .setBlock(xPos, tY, zPos, GregTech_API.sBlockCasings5, 1, 3); + .setBlock(xPos, tY, zPos, GregTech_API.sBlockCasings5, 1, 3); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_TranscendentPlasmaMixer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_TranscendentPlasmaMixer.java index e60e999e0c..b8d9b008e2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_TranscendentPlasmaMixer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_TranscendentPlasmaMixer.java @@ -32,47 +32,30 @@ import gregtech.api.util.GT_Recipe; import gregtech.common.items.GT_IntegratedCircuit_Item; public class GT_MetaTileEntity_TranscendentPlasmaMixer - extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_TranscendentPlasmaMixer> - implements IGlobalWirelessEnergy, ISurvivalConstructable { + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_TranscendentPlasmaMixer> + implements IGlobalWirelessEnergy, ISurvivalConstructable { private static final String[][] structure = new String[][] { - { " CAC ", " ABA ", " ABA ", " A~A ", " ABA ", " ABA ", " CAC " }, - { "CBBBC", "A A", "A A", "A A", "A A", "A A", "CBBBC" }, - { "ABBBA", "B B", "B B", "B B", "B B", "B B", "ABBBA" }, - { "CBBBC", "A A", "A A", "A A", "A A", "A A", "CBBBC" }, - { " CAC ", " ABA ", " ABA ", " ABA ", " ABA ", " ABA ", " CAC " } }; + { " CAC ", " ABA ", " ABA ", " A~A ", " ABA ", " ABA ", " CAC " }, + { "CBBBC", "A A", "A A", "A A", "A A", "A A", "CBBBC" }, + { "ABBBA", "B B", "B B", "B B", "B B", "B B", "ABBBA" }, + { "CBBBC", "A A", "A A", "A A", "A A", "A A", "CBBBC" }, + { " CAC ", " ABA ", " ABA ", " ABA ", " ABA ", " ABA ", " CAC " } }; private static final String STRUCTURE_PIECE_MAIN = "MAIN"; - private static final IStructureDefinition<GT_MetaTileEntity_TranscendentPlasmaMixer> STRUCTURE_DEFINITION = StructureDefinition.<GT_MetaTileEntity_TranscendentPlasmaMixer>builder() - .addShape( - STRUCTURE_PIECE_MAIN, - structure) - .addElement( - 'B', - buildHatchAdder( - GT_MetaTileEntity_TranscendentPlasmaMixer.class).atLeast( - InputHatch, - OutputHatch, - InputBus, - Maintenance) - .casingIndex( - DIM_INJECTION_CASING) - .dot( - 1) - .buildAndChain( - GregTech_API.sBlockCasings1, - DIM_INJECTION_CASING)) - .addElement( - 'A', - ofBlock( - GregTech_API.sBlockCasings1, - DIM_TRANS_CASING)) - .addElement( - 'C', - ofBlock( - GregTech_API.sBlockCasings1, - DIM_BRIDGE_CASING)) - .build(); + private static final IStructureDefinition<GT_MetaTileEntity_TranscendentPlasmaMixer> STRUCTURE_DEFINITION = StructureDefinition + .<GT_MetaTileEntity_TranscendentPlasmaMixer>builder() + .addShape(STRUCTURE_PIECE_MAIN, structure) + .addElement( + 'B', + buildHatchAdder(GT_MetaTileEntity_TranscendentPlasmaMixer.class) + .atLeast(InputHatch, OutputHatch, InputBus, Maintenance) + .casingIndex(DIM_INJECTION_CASING) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, DIM_INJECTION_CASING)) + .addElement('A', ofBlock(GregTech_API.sBlockCasings1, DIM_TRANS_CASING)) + .addElement('C', ofBlock(GregTech_API.sBlockCasings1, DIM_BRIDGE_CASING)) + .build(); private String ownerUUID; @@ -93,19 +76,19 @@ public class GT_MetaTileEntity_TranscendentPlasmaMixer protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Transcendent Mixer") - .addInfo("Assisting in all your DTPF needs.") - .addInfo("This multiblock will run in parallel according to the circuit provided to the") - .addInfo("controller slot. E.g. 3x Circuit #16 = 48x parallel. All inputs will scale,") - .addInfo("except time. All EU is deducted from wireless EU networks only.") - .addInfo(AuthorColen) - .addInfo("Controller slot and circuit slot are separate.") - .addSeparator() - .beginStructureBlock(5, 7, 5, false) - .addStructureInfo(GOLD + "1+ " + GRAY + "Input Hatch") - .addStructureInfo(GOLD + "1+ " + GRAY + "Output Hatch") - .addStructureInfo(GOLD + "1+ " + GRAY + "Input Bus") - .addStructureInfo(GOLD + "1 " + GRAY + "Maintenance Hatch") - .toolTipFinisher("Gregtech"); + .addInfo("Assisting in all your DTPF needs.") + .addInfo("This multiblock will run in parallel according to the circuit provided to the") + .addInfo("controller slot. E.g. 3x Circuit #16 = 48x parallel. All inputs will scale,") + .addInfo("except time. All EU is deducted from wireless EU networks only.") + .addInfo(AuthorColen) + .addInfo("Controller slot and circuit slot are separate.") + .addSeparator() + .beginStructureBlock(5, 7, 5, false) + .addStructureInfo(GOLD + "1+ " + GRAY + "Input Hatch") + .addStructureInfo(GOLD + "1+ " + GRAY + "Output Hatch") + .addStructureInfo(GOLD + "1+ " + GRAY + "Input Bus") + .addStructureInfo(GOLD + "1 " + GRAY + "Maintenance Hatch") + .toolTipFinisher("Gregtech"); return tt; } @@ -116,22 +99,21 @@ public class GT_MetaTileEntity_TranscendentPlasmaMixer @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) return new ITexture[] { casingTexturePages[0][DIM_TRANS_CASING], TextureFactory.builder() - .addIcon( - OVERLAY_DTPF_ON) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FUSION1_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_DTPF_ON) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FUSION1_GLOW) + .extFacing() + .glow() + .build() }; return new ITexture[] { casingTexturePages[0][DIM_TRANS_CASING], TextureFactory.builder() - .addIcon(OVERLAY_DTPF_OFF) - .extFacing() - .build() }; + .addIcon(OVERLAY_DTPF_OFF) + .extFacing() + .build() }; } return new ITexture[] { casingTexturePages[0][DIM_TRANS_CASING] }; @@ -156,12 +138,8 @@ public class GT_MetaTileEntity_TranscendentPlasmaMixer boolean processRecipe(ItemStack[] items, FluidStack[] fluids) { - GT_Recipe originalRecipe = GT_Recipe.GT_Recipe_Map.sTranscendentPlasmaMixerRecipes.findRecipe( - getBaseMetaTileEntity(), - false, - Long.MAX_VALUE, - fluids, - items); + GT_Recipe originalRecipe = GT_Recipe.GT_Recipe_Map.sTranscendentPlasmaMixerRecipes + .findRecipe(getBaseMetaTileEntity(), false, Long.MAX_VALUE, fluids, items); if (originalRecipe == null) { return false; @@ -217,15 +195,15 @@ public class GT_MetaTileEntity_TranscendentPlasmaMixer @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { return survivialBuildPiece( - STRUCTURE_PIECE_MAIN, - stackSize, - HORIZONTAL_OFFSET, - VERTICAL_OFFSET, - DEPTH_OFFSET, - elementBudget, - env, - false, - true); + STRUCTURE_PIECE_MAIN, + stackSize, + HORIZONTAL_OFFSET, + VERTICAL_OFFSET, + DEPTH_OFFSET, + elementBudget, + env, + false, + true); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java index eabdd8ee35..520fc01de0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java @@ -23,7 +23,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; public class GT_MetaTileEntity_VacuumFreezer - extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_VacuumFreezer> { + extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_VacuumFreezer> { public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -42,49 +42,47 @@ public class GT_MetaTileEntity_VacuumFreezer protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Vacuum Freezer") - .addInfo("Controller Block for the Vacuum Freezer") - .addInfo("Cools hot ingots and cells") - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfoRange("Frost Proof Machine Casing", 16, 24, false) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addInputHatch("Any casing", 1) - .addOutputHatch("Any casing", 1) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .toolTipFinisher("Gregtech"); + .addInfo("Controller Block for the Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfoRange("Frost Proof Machine Casing", 16, 24, false) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher("Gregtech"); return tt; } @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { rTexture = new ITexture[] { casingTexturePages[0][17], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() }; } else { rTexture = new ITexture[] { casingTexturePages[0][17], TextureFactory.builder() - .addIcon( - OVERLAY_FRONT_VACUUM_FREEZER) - .extFacing() - .build(), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) - .extFacing() - .glow() - .build() }; + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) + .extFacing() + .glow() + .build() }; } } else { rTexture = new ITexture[] { casingTexturePages[0][17] }; @@ -109,12 +107,8 @@ public class GT_MetaTileEntity_VacuumFreezer long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tFluidList, - tInputList); + GT_Recipe tRecipe = getRecipeMap() + .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidList, tInputList); if (tRecipe != null) { if (tRecipe.isRecipeInputEqual(true, tFluidList, tInputList)) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); diff --git a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_CokeOven.java b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_CokeOven.java index 4114ee5564..66e9333961 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_CokeOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_CokeOven.java @@ -34,7 +34,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.common.tileentities.machines.multiblock.logic.CokeOvenProcessingLogic; public class MultiBlock_CokeOven extends MultiBlockController<MultiBlock_CokeOven> - implements PollutionLogicHost, ProcessingLogicHost { + implements PollutionLogicHost, ProcessingLogicHost { private static IStructureDefinition<MultiBlock_CokeOven> STRUCTURE_DEFINITION = null; private static final Vec3Impl OFFSET = new Vec3Impl(1, 1, 0); @@ -79,11 +79,11 @@ public class MultiBlock_CokeOven extends MultiBlockController<MultiBlock_CokeOve protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Coke Oven") - .addInfo("Used for charcoal") - .beginStructureBlock(3, 3, 3, true) - .addCasingInfoExactly("Coke Oven Bricks", 25, false) - .addPollutionAmount(POLLUTION_LOGIC.getPollutionAmount()) - .toolTipFinisher(GT_Values.AuthorBlueWeabo); + .addInfo("Used for charcoal") + .beginStructureBlock(3, 3, 3, true) + .addCasingInfoExactly("Coke Oven Bricks", 25, false) + .addPollutionAmount(POLLUTION_LOGIC.getPollutionAmount()) + .toolTipFinisher(GT_Values.AuthorBlueWeabo); return tt; } @@ -96,18 +96,11 @@ public class MultiBlock_CokeOven extends MultiBlockController<MultiBlock_CokeOve public IStructureDefinition<MultiBlock_CokeOven> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<MultiBlock_CokeOven>builder() - .addShape( - MAIN, - new String[][] { { "AAA", "A~A", "AAA" }, - { "AAA", "A-A", "AAA" }, - { "AAA", "AAA", "AAA" } }) - .addElement( - 'A', - addMultiTileCasing( - "gt.multitileentity.casings", - getCasingMeta(), - ITEM_IN | ITEM_OUT)) - .build(); + .addShape( + MAIN, + new String[][] { { "AAA", "A~A", "AAA" }, { "AAA", "A-A", "AAA" }, { "AAA", "AAA", "AAA" } }) + .addElement('A', addMultiTileCasing("gt.multitileentity.casings", getCasingMeta(), ITEM_IN | ITEM_OUT)) + .build(); } return STRUCTURE_DEFINITION; } @@ -120,11 +113,11 @@ public class MultiBlock_CokeOven extends MultiBlockController<MultiBlock_CokeOve @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new SlotWidget(inputInventory, 0).setPos(18, 18) - .setSize(18, 18)); + new SlotWidget(inputInventory, 0).setPos(18, 18) + .setSize(18, 18)); builder.widget( - new SlotWidget(outputInventory, 0).setPos(36, 36) - .setSize(18, 18)); + new SlotWidget(outputInventory, 0).setPos(36, 36) + .setSize(18, 18)); builder.widget(createButtons()); } @@ -136,32 +129,31 @@ public class MultiBlock_CokeOven extends MultiBlockController<MultiBlock_CokeOve if (NetworkUtils.isClient()) { final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; // noinspection unchecked - final List<String> titleLines = fontRenderer.listFormattedStringToWidth( - title, - getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2); + final List<String> titleLines = fontRenderer + .listFormattedStringToWidth(title, getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2); titleWidth = titleLines.size() > 1 ? getGUIWidth() - (TAB_PADDING + TITLE_PADDING) * 2 - : fontRenderer.getStringWidth(title); + : fontRenderer.getStringWidth(title); // noinspection PointlessArithmeticExpression titleHeight = titleLines.size() * fontRenderer.FONT_HEIGHT + (titleLines.size() - 1); } final DrawableWidget tab = new DrawableWidget(); final TextWidget text = new TextWidget(title).setDefaultColor(getTitleColor()) - .setTextAlignment(Alignment.CenterLeft) - .setMaxWidth(titleWidth); + .setTextAlignment(Alignment.CenterLeft) + .setMaxWidth(titleWidth); if (GT_Mod.gregtechproxy.mTitleTabStyle == 1) { tab.setDrawable(getGUITextureSet().getTitleTabAngular()) - .setPos(0, -(titleHeight + TAB_PADDING) + 1) - .setSize(getGUIWidth(), titleHeight + TAB_PADDING * 2); + .setPos(0, -(titleHeight + TAB_PADDING) + 1) + .setSize(getGUIWidth(), titleHeight + TAB_PADDING * 2); text.setPos(TAB_PADDING + TITLE_PADDING, -titleHeight + TAB_PADDING); } else { tab.setDrawable(getGUITextureSet().getTitleTabDark()) - .setPos(0, -(titleHeight + TAB_PADDING * 2) + 1) - .setSize(titleWidth + (TAB_PADDING + TITLE_PADDING) * 2, titleHeight + TAB_PADDING * 2 - 1); + .setPos(0, -(titleHeight + TAB_PADDING * 2) + 1) + .setSize(titleWidth + (TAB_PADDING + TITLE_PADDING) * 2, titleHeight + TAB_PADDING * 2 - 1); text.setPos(TAB_PADDING + TITLE_PADDING, -titleHeight); } builder.widget(tab) - .widget(text); + .widget(text); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java index acd611ab12..c2bf782d40 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java +++ b/src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java @@ -50,67 +50,30 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera public IStructureDefinition<MultiBlock_Macerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<MultiBlock_Macerator>builder() - .addShape( - STACKABLE_TOP, - transpose( - new String[][] { { " CCC ", "CCCCC", "CCCCC", - "CCCCC", " CCC " }, })) - .addShape( - STACKABLE_MIDDLE, - transpose( - new String[][] { { " BBB ", " B---B ", - "DC---CD", " B---B ", " BBB " }, })) - .addShape( - STACKABLE_BOTTOM, - transpose( - new String[][] { { " G~F ", "AAAAA", "AAAAA", - "AAAAA", " AAA " }, })) - .addElement( - 'A', - ofChain( - addMultiTileCasing( - "gt.multitileentity.casings", - getCasingMeta(), - ENERGY_IN))) - .addElement( - 'B', - ofChain( - addMultiTileCasing( - "gt.multitileentity.casings", - getCasingMeta(), - FLUID_IN | ITEM_IN - | FLUID_OUT - | ITEM_OUT))) - .addElement( - 'C', - addMultiTileCasing( - "gt.multitileentity.casings", - getCasingMeta(), - NOTHING)) - .addElement( - 'D', - addMultiTileCasing( - "gt.multitileentity.casings", - getCasingMeta(), - NOTHING)) - .addElement( - 'F', - ofChain( - addMultiTileCasing( - "gt.multitileentity.casings", - 20001, - NOTHING), - addMultiTileCasing( - "gt.multitileentity.casings", - 20002, - NOTHING))) - .addElement( - 'G', - addMultiTileCasing( - "gt.multitileentity.casings", - 10000, - NOTHING)) - .build(); + .addShape(STACKABLE_TOP, transpose(new String[][] { { " CCC ", "CCCCC", "CCCCC", "CCCCC", " CCC " }, })) + .addShape( + STACKABLE_MIDDLE, + transpose(new String[][] { { " BBB ", " B---B ", "DC---CD", " B---B ", " BBB " }, })) + .addShape( + STACKABLE_BOTTOM, + transpose(new String[][] { { " G~F ", "AAAAA", "AAAAA", "AAAAA", " AAA " }, })) + .addElement('A', ofChain(addMultiTileCasing("gt.multitileentity.casings", getCasingMeta(), ENERGY_IN))) + .addElement( + 'B', + ofChain( + addMultiTileCasing( + "gt.multitileentity.casings", + getCasingMeta(), + FLUID_IN | ITEM_IN | FLUID_OUT | ITEM_OUT))) + .addElement('C', addMultiTileCasing("gt.multitileentity.casings", getCasingMeta(), NOTHING)) + .addElement('D', addMultiTileCasing("gt.multitileentity.casings", getCasingMeta(), NOTHING)) + .addElement( + 'F', + ofChain( + addMultiTileCasing("gt.multitileentity.casings", 20001, NOTHING), + addMultiTileCasing("gt.multitileentity.casings", 20002, NOTHING))) + .addElement('G', addMultiTileCasing("gt.multitileentity.casings", 10000, NOTHING)) + .build(); } return STRUCTURE_DEFINITION; } @@ -134,19 +97,19 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Macerator") - .addInfo("Controller for the Macerator") - .addSeparator() - .beginVariableStructureBlock(7, 9, 2 + getMinStacks(), 2 + getMaxStacks(), 7, 9, true) - .addController("Bottom Front Center") - .addCasingInfoExactly("Test Casing", 60, false) - .addEnergyHatch("Any bottom layer casing") - .addInputHatch("Any non-optional external facing casing on the stacks") - .addInputBus("Any non-optional external facing casing on the stacks") - .addOutputHatch("Any non-optional external facing casing on the stacks") - .addOutputBus("Any non-optional external facing casing on the stacks") - .addStructureInfo( - String.format("Stackable middle stacks between %d-%d time(s).", getMinStacks(), getMaxStacks())) - .toolTipFinisher("Wildcard"); + .addInfo("Controller for the Macerator") + .addSeparator() + .beginVariableStructureBlock(7, 9, 2 + getMinStacks(), 2 + getMaxStacks(), 7, 9, true) + .addController("Bottom Front Center") + .addCasingInfoExactly("Test Casing", 60, false) + .addEnergyHatch("Any bottom layer casing") + .addInputHatch("Any non-optional external facing casing on the stacks") + .addInputBus("Any non-optional external facing casing on the stacks") + .addOutputHatch("Any non-optional external facing casing on the stacks") + .addOutputBus("Any non-optional external facing casing on the stacks") + .addStructureInfo( + String.format("Stackable middle stacks between %d-%d time(s).", getMinStacks(), getMaxStacks())) + .toolTipFinisher("Wildcard"); return tt; } @@ -185,28 +148,28 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera // TODO: MTE(Texture) if (facing == aSide) { return new ITexture[] { - // Base Texture - MACHINE_CASINGS[1][0], - // Active - isActive() ? TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) - .extFacing() - .build() - : TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) - .extFacing() - .build(), - // Active Glow - isActive() ? TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) - .extFacing() - .glow() - .build() - : TextureFactory.builder() - .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) - .extFacing() - .glow() - .build() }; + // Base Texture + MACHINE_CASINGS[1][0], + // Active + isActive() ? TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build() + : TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + // Active Glow + isActive() ? TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + : TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() }; } // Base Texture return new ITexture[] { MACHINE_CASINGS[1][0] }; @@ -223,7 +186,7 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera return false; } else { ItemStack[] tItemInputs = getInventoriesForInput().getStacks() - .toArray(new ItemStack[0]); + .toArray(new ItemStack[0]); return processRecipe(tItemInputs, null); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java index bfbe56a665..8da0679a0c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java @@ -55,81 +55,73 @@ public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_Bas @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] { - super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java index c84e6a05d5..462d184c19 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java @@ -55,81 +55,73 @@ public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_Basi @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] { - super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_ALLOY_SMELTER_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java index 26a8e1056c..016e6ec2d4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java @@ -50,80 +50,73 @@ public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_Basic @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java index 060826b966..bf98ddb1ae 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java @@ -50,80 +50,73 @@ public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_COMPRESSOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_COMPRESSOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java index 1f03faca48..b1d1734d67 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java @@ -50,79 +50,73 @@ public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java index 83f2899259..96d4961364 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java @@ -50,79 +50,73 @@ public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMa @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_EXTRACTOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_EXTRACTOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_EXTRACTOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java index d648c6a41d..64ae331f99 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java @@ -58,77 +58,74 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { return new ITexture[] { super.getBottomFacingInactive(aColor)[0], - TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) + .glow() + .build() }; } /** @@ -146,7 +143,7 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi final byte mainFacing = (byte) this.mMainFacing; if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { final double oX = aBaseMetaTileEntity.getXCoord(); final double oY = aBaseMetaTileEntity.getYCoord(); @@ -182,11 +179,10 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.LAVA) - .run(); + .run(); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java index 22292c814b..75aaf48078 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java @@ -58,77 +58,74 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { return new ITexture[] { super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_HAMMER_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { return new ITexture[] { super.getBottomFacingInactive(aColor)[0], - TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) - .glow() - .build() }; + TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW) + .glow() + .build() }; } /** @@ -146,7 +143,7 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic final byte mainFacing = (byte) this.mMainFacing; if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { + && !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) { final double oX = aBaseMetaTileEntity.getXCoord(); final double oY = aBaseMetaTileEntity.getYCoord(); @@ -182,11 +179,10 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic } ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ) - .setPosition(x, y, z) - .setWorld( - getBaseMetaTileEntity().getWorld()); + .setPosition(x, y, z) + .setWorld(getBaseMetaTileEntity().getWorld()); particleEventBuilder.setIdentifier(ParticleFX.LAVA) - .run(); + .run(); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java index deb0d6c2d8..088292548a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java @@ -55,9 +55,9 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; + && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } @Override @@ -75,79 +75,75 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { return new ITexture[] { super.getBottomFacingInactive(aColor)[0], - TextureFactory.of( - TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) - .glow() - .build()) }; + TextureFactory.of( + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), + TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) + .glow() + .build()) }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java index 285e85943f..49663fd852 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java @@ -55,9 +55,9 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; + && GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null; } @Override @@ -75,78 +75,73 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_FURNACE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_FURNACE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_FURNACE_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java index 936b75bc8c..7481b8716a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java @@ -47,20 +47,17 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getFrontFacing() != topFacing - && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { new ParticleEventBuilder().setMotion(0.0D, 0.0D, 0.0D) - .setIdentifier(ParticleFX.SMOKE) - .setPosition( - aBaseMetaTileEntity.getXCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F, - aBaseMetaTileEntity.getYCoord() + 0.9F - + XSTR_INSTANCE.nextFloat() * 0.2F, - aBaseMetaTileEntity.getZCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setIdentifier(ParticleFX.SMOKE) + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } } @@ -72,14 +69,8 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeList().findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - V[mTier], - null, - null, - getAllInputs()); + GT_Recipe tRecipe = getRecipeList() + .findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { @@ -96,9 +87,9 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); + && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } @Override @@ -116,79 +107,73 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java index 64b44a5510..fb270fc95f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java +++ b/src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java @@ -47,20 +47,17 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa final byte topFacing = (byte) ForgeDirection.UP.ordinal(); if (aBaseMetaTileEntity.getFrontFacing() != topFacing - && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 - && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { + && aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0 + && !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) { new WorldSpawnedEventBuilder.ParticleEventBuilder().setMotion(0.0D, 0.0D, 0.0D) - .setIdentifier(ParticleFX.SMOKE) - .setPosition( - aBaseMetaTileEntity.getXCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F, - aBaseMetaTileEntity.getYCoord() + 0.9F - + XSTR_INSTANCE.nextFloat() * 0.2F, - aBaseMetaTileEntity.getZCoord() + 0.8F - - XSTR_INSTANCE.nextFloat() * 0.6F) - .setWorld(getBaseMetaTileEntity().getWorld()) - .run(); + .setIdentifier(ParticleFX.SMOKE) + .setPosition( + aBaseMetaTileEntity.getXCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F, + aBaseMetaTileEntity.getYCoord() + 0.9F + XSTR_INSTANCE.nextFloat() * 0.2F, + aBaseMetaTileEntity.getZCoord() + 0.8F - XSTR_INSTANCE.nextFloat() * 0.6F) + .setWorld(getBaseMetaTileEntity().getWorld()) + .run(); } } } @@ -72,14 +69,8 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public int checkRecipe() { - GT_Recipe tRecipe = getRecipeList().findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - V[mTier], - null, - null, - getAllInputs()); + GT_Recipe tRecipe = getRecipeList() + .findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], null, null, getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; if (!canOutput(tRecipe)) { @@ -96,9 +87,9 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, - ItemStack aStack) { + ItemStack aStack) { return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) - && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); + && GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack)); } @Override @@ -116,79 +107,73 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa @Override public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - super.getSideFacingActive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getSideFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getSideFacingInactive(byte aColor) { return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SIDE_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - super.getFrontFacingActive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getFrontFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_FRONT_STEAM_MACERATOR), TextureFactory.builder() + .addIcon(OVERLAY_FRONT_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - super.getTopFacingActive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getTopFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getTopFacingInactive(byte aColor) { return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_TOP_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - super.getBottomFacingActive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingActive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_ACTIVE_GLOW) + .glow() + .build() }; } @Override public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - super.getBottomFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), - TextureFactory.builder() - .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) - .glow() - .build() }; + return new ITexture[] { super.getBottomFacingInactive(aColor)[0], + TextureFactory.of(OVERLAY_BOTTOM_STEAM_MACERATOR), TextureFactory.builder() + .addIcon(OVERLAY_BOTTOM_STEAM_MACERATOR_GLOW) + .glow() + .build() }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 23bf3d7c46..c9a3ad7650 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -41,7 +41,7 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock - implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack>, IAddUIWidgets { + implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack>, IAddUIWidgets { protected boolean mVoidOverflow = false; protected boolean mDisableFilter; @@ -49,14 +49,13 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti public GT_MetaTileEntity_DigitalChestBase(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - new String[] { "This Chest stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + " Blocks", - "Use a screwdriver to enable", "voiding items on overflow", - "Will keep its contents when harvested", }); + aID, + aName, + aNameRegional, + aTier, + 3, + new String[] { "This Chest stores " + GT_Utility.formatNumbers(commonSizeCompute(aTier)) + " Blocks", + "Use a screwdriver to enable", "voiding items on overflow", "Will keep its contents when harvested", }); } protected static int commonSizeCompute(int tier) { @@ -80,53 +79,53 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti } public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures) { + ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Override public void addAdditionalTooltipInformation(ItemStack stack, List<String> tooltip) { if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("mItemStack")) { - final ItemStack tContents = ItemStack.loadItemStackFromNBT( - stack.stackTagCompound.getCompoundTag("mItemStack")); + final ItemStack tContents = ItemStack + .loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("mItemStack")); final int tSize = stack.stackTagCompound.getInteger("mItemCount"); if (tContents != null && tSize > 0) { tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_CHEST_INFO", - "Contains Item: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW - + tContents.getDisplayName() - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_INFO", + "Contains Item: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + tContents.getDisplayName() + + EnumChatFormatting.GRAY); tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_CHEST_AMOUNT", - "Item Amount: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(tSize) - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_CHEST_AMOUNT", + "Item Amount: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tSize) + + EnumChatFormatting.GRAY); } } } public static void registerAEIntegration() { appeng.api.AEApi.instance() - .registries() - .externalStorage() - .addExternalStorageInterface(new AE2DigitalChestHandler()); + .registries() + .externalStorage() + .addExternalStorageInterface(new AE2DigitalChestHandler()); } @Override public void addListener( - appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, - Object o) { + appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver, + Object o) { if (listeners == null) listeners = new HashMap<>(); listeners.put(imeMonitorHandlerReceiver, o); } @Override public void removeListener( - appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) { + appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver) { if (listeners == null) listeners = new HashMap<>(); listeners.remove(imeMonitorHandlerReceiver); } @@ -171,7 +170,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public appeng.api.storage.data.IItemList<appeng.api.storage.data.IAEItemStack> getAvailableItems( - final appeng.api.storage.data.IItemList out) { + final appeng.api.storage.data.IItemList out) { ItemStack storedStack = getItemStack(); if (storedStack != null) { appeng.util.item.AEItemStack s = appeng.util.item.AEItemStack.create(storedStack); @@ -210,7 +209,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public appeng.api.storage.data.IAEItemStack injectItems(final appeng.api.storage.data.IAEItemStack input, - final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { final ItemStack inputStack = input.getItemStack(); if (inputStack == null) return null; if (getBaseMetaTileEntity() == null) return input; @@ -246,7 +245,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public appeng.api.storage.data.IAEItemStack extractItems(final appeng.api.storage.data.IAEItemStack request, - final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { + final appeng.api.config.Actionable mode, final appeng.api.networking.security.BaseActionSource src) { if (request.isSameType(getItemStack())) { if (getBaseMetaTileEntity() == null) return null; if (mode != appeng.api.config.Actionable.SIMULATE) getBaseMetaTileEntity().markDirty(); @@ -273,22 +272,22 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mVoidOverflow = !mVoidOverflow; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal( - mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" - : "GT5U.machines.digitalchest.voidoverflow.disabled")); + aPlayer, + StatCollector.translateToLocal( + mVoidOverflow ? "GT5U.machines.digitalchest.voidoverflow.enabled" + : "GT5U.machines.digitalchest.voidoverflow.disabled")); } @Override public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { + float aZ) { if (super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ)) return true; mDisableFilter = !mDisableFilter; GT_Utility.sendChatToPlayer( - aPlayer, - StatCollector.translateToLocal( - mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" - : "GT5U.machines.digitalchest.inputfilter.enabled")); + aPlayer, + StatCollector.translateToLocal( + mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled" + : "GT5U.machines.digitalchest.inputfilter.enabled")); return true; } @@ -308,7 +307,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti int savedCount = count; if ((mInventory[0] != null) && ((count < getMaxItemCount()) || mVoidOverflow) - && GT_Utility.areStacksEqual(mInventory[0], stack)) { + && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; if (count <= getMaxItemCount()) { mInventory[0] = null; @@ -326,11 +325,11 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti mInventory[1].stackSize = Math.min(stack.getMaxStackSize(), count); count -= mInventory[1].stackSize; } else if ((count > 0) && GT_Utility.areStacksEqual(mInventory[1], stack) - && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) { - int tmp = Math.min(count, mInventory[1].getMaxStackSize() - mInventory[1].stackSize); - mInventory[1].stackSize += tmp; - count -= tmp; - } + && mInventory[1].getMaxStackSize() > mInventory[1].stackSize) { + int tmp = Math.min(count, mInventory[1].getMaxStackSize() - mInventory[1].stackSize); + mInventory[1].stackSize += tmp; + count -= tmp; + } setItemCount(count); if (stack != null) { mInventory[2] = stack.copy(); @@ -373,7 +372,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public int getProgresstime() { return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize) - + (mInventory[1] == null ? 0 : mInventory[1].stackSize); + + (mInventory[1] == null ? 0 : mInventory[1].stackSize); } @Override @@ -391,22 +390,22 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti if (getItemStack() == null) { return new String[] { EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET, "Stored Items:", - EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + "0" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxItemCount()) - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + "No Items" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxItemCount()) + + EnumChatFormatting.RESET }; } return new String[] { EnumChatFormatting.BLUE + chestName() + EnumChatFormatting.RESET, "Stored Items:", - EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getItemCount()) - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxItemCount()) - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + getItemStack().getDisplayName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(getItemCount()) + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxItemCount()) + + EnumChatFormatting.RESET }; } @Override @@ -434,7 +433,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti private boolean hasActiveMEConnection() { if (listeners == null || listeners.isEmpty()) return false; - for (Map.Entry<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> e : listeners.entrySet()) { + for (Map.Entry<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> e : listeners + .entrySet()) { if ((e.getKey() instanceof appeng.api.parts.IPart)) { appeng.api.networking.IGridNode n = ((appeng.api.parts.IPart) e.getKey()).getGridNode(); if (n != null && n.isActive()) return true; @@ -480,25 +480,25 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != aFacing) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1] }; return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_SCHEST), - TextureFactory.builder() - .addIcon(OVERLAY_SCHEST_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_SCHEST_GLOW) + .glow() + .build() }; } @Override public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); NBTTagCompound tag = accessor.getNBTData(); if (tag.hasKey("itemType", Constants.NBT.TAG_COMPOUND)) { currenttip.add("Item Count: " + GT_Utility.parseNumberToString(tag.getInteger("itemCount"))); currenttip.add( - "Item Type: " + ItemStack.loadItemStackFromNBT(tag.getCompoundTag("itemType")) - .getDisplayName()); + "Item Type: " + ItemStack.loadItemStackFromNBT(tag.getCompoundTag("itemType")) + .getDisplayName()); } else { currenttip.add("Chest Empty"); } @@ -506,7 +506,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); ItemStack is = getItemStack(); if (GT_Utility.isStackInvalid(is)) return; @@ -525,36 +525,33 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget( - new SlotWidget(inventoryHandler, 0) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget( - new SlotWidget(inventoryHandler, 1).setAccess(true, false) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget( - SlotWidget.phantom(inventoryHandler, 2) - .disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(59, 42)) - .widget( - new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget( - TextWidget.dynamicString( - () -> GT_Utility.parseNumberToString( - this instanceof GT_MetaTileEntity_QuantumChest - ? ((GT_MetaTileEntity_QuantumChest) this).mItemCount - : 0)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 16) + .setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, 0) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 52)) + .widget( + SlotWidget.phantom(inventoryHandler, 2) + .disableInteraction() + .setBackground(GT_UITextures.TRANSPARENT) + .setPos(59, 42)) + .widget( + new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 20)) + .widget( + TextWidget + .dynamicString( + () -> GT_Utility.parseNumberToString( + this instanceof GT_MetaTileEntity_QuantumChest + ? ((GT_MetaTileEntity_QuantumChest) this).mItemCount + : 0)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 30)); } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java index 1bf8705279..14f1501527 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java @@ -46,7 +46,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntity_BasicTank - implements IFluidLockable, IAddUIWidgets { + implements IFluidLockable, IAddUIWidgets { public boolean mOutputFluid = false, mVoidFluidPart = false, mVoidFluidFull = false, mLockFluid = false; protected String lockedFluidName = null; @@ -54,16 +54,16 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit public GT_MetaTileEntity_DigitalTankBase(int aID, String aName, String aNameRegional, int aTier) { super( - aID, - aName, - aNameRegional, - aTier, - 3, - new String[] { - StatCollector.translateToLocalFormatted( - "GT5U.machines.digitaltank.tooltip", - GT_Utility.formatNumbers(commonSizeCompute(aTier))), - StatCollector.translateToLocal("GT5U.machines.digitaltank.tooltip1"), }); + aID, + aName, + aNameRegional, + aTier, + 3, + new String[] { + StatCollector.translateToLocalFormatted( + "GT5U.machines.digitaltank.tooltip", + GT_Utility.formatNumbers(commonSizeCompute(aTier))), + StatCollector.translateToLocal("GT5U.machines.digitaltank.tooltip1"), }); } protected static int commonSizeCompute(int tier) { @@ -114,24 +114,24 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public void addAdditionalTooltipInformation(ItemStack stack, List<String> tooltip) { if (stack.hasTagCompound() && stack.stackTagCompound.hasKey("mFluid")) { - final FluidStack tContents = FluidStack.loadFluidStackFromNBT( - stack.stackTagCompound.getCompoundTag("mFluid")); + final FluidStack tContents = FluidStack + .loadFluidStackFromNBT(stack.stackTagCompound.getCompoundTag("mFluid")); if (tContents != null && tContents.amount > 0) { tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_INFO", - "Contains Fluid: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW - + tContents.getLocalizedName() - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_INFO", + "Contains Fluid: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.YELLOW + + tContents.getLocalizedName() + + EnumChatFormatting.GRAY); tooltip.add( - GT_LanguageManager.addStringLocalization( - "TileEntity_TANK_AMOUNT", - "Fluid Amount: ", - !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(tContents.amount) - + " L" - + EnumChatFormatting.GRAY); + GT_LanguageManager.addStringLocalization( + "TileEntity_TANK_AMOUNT", + "Fluid Amount: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(tContents.amount) + + " L" + + EnumChatFormatting.GRAY); } } } @@ -178,9 +178,9 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public boolean isFluidInputAllowed(FluidStack aFluid) { return !mLockFluid || lockedFluidName == null - || lockedFluidName.equals( - aFluid.getFluid() - .getName()); + || lockedFluidName.equals( + aFluid.getFluid() + .getName()); } @Override @@ -192,7 +192,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit public void onEmptyingContainerWhenEmpty() { if (this.lockedFluidName == null && this.mFluid != null) { this.lockedFluidName = this.mFluid.getFluid() - .getName(); + .getName(); } } @@ -269,17 +269,17 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide != ForgeDirection.UP.ordinal()) { if (aSide == aBaseMetaTileEntity.getFrontFacing()) { return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_PIPE) }; } else return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1] }; } return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_QTANK), - TextureFactory.builder() - .addIcon(OVERLAY_QTANK_GLOW) - .glow() - .build() }; + TextureFactory.builder() + .addIcon(OVERLAY_QTANK_GLOW) + .glow() + .build() }; } @Override @@ -293,8 +293,8 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit if (aSide == getBaseMetaTileEntity().getFrontFacing()) { mAllowInputFromOutputSide = !mAllowInputFromOutputSide; GT_Utility.sendChatToPlayer( - aPlayer, - mAllowInputFromOutputSide ? GT_Utility.getTrans("095") : GT_Utility.getTrans("096")); + aPlayer, + mAllowInputFromOutputSide ? GT_Utility.getTrans("095") : GT_Utility.getTrans("096")); } } @@ -338,9 +338,9 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit if ((tFluid.amount <= getRealCapacity()) || mVoidFluidPart) { tFluid = tFluid.copy(); if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), - 1)) { + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { setFillableStack(tFluid); this.onEmptyingContainerWhenEmpty(); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -350,15 +350,14 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } else { if (tFluid.isFluidEqual(getFillableStack())) { if ((((long) tFluid.amount + getFillableStack().amount) <= (long) getRealCapacity()) - || mVoidFluidPart - || mVoidFluidFull) { + || mVoidFluidPart + || mVoidFluidFull) { if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot(), - GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), - 1)) { - getFillableStack().amount += Math.min( - tFluid.amount, - getRealCapacity() - getFillableStack().amount); + getOutputSlot(), + GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true), + 1)) { + getFillableStack().amount += Math + .min(tFluid.amount, getRealCapacity() - getFillableStack().amount); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); } } @@ -368,11 +367,8 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit } if (doesFillContainers()) { - ItemStack tOutput = GT_Utility.fillFluidContainer( - getDrainableStack(), - mInventory[getInputSlot()], - false, - true); + ItemStack tOutput = GT_Utility + .fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -386,9 +382,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public int fill(FluidStack aFluid, boolean doFill) { if (aFluid == null || aFluid.getFluid() - .getID() - <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) - return 0; + .getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid)) return 0; if (getFillableStack() != null && !getFillableStack().isFluidEqual(aFluid)) { return 0; } @@ -417,14 +411,12 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit if (tTank != null) { FluidStack tDrained = drain(20 * (1 << (3 + 2 * tierPump(mTier))), false); if (tDrained != null) { - int tFilledAmount = tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - tDrained, - false); + int tFilledAmount = tTank + .fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); if (tFilledAmount > 0) tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - drain(tFilledAmount, true), - true); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + drain(tFilledAmount, true), + true); } } } @@ -492,16 +484,15 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, - IWailaConfigHandler config) { + IWailaConfigHandler config) { super.getWailaBody(itemStack, currenttip, accessor, config); NBTTagCompound tag = accessor.getNBTData(); FluidStack fluid = tag.hasKey("mFluid") ? FluidStack.loadFluidStackFromNBT(tag.getCompoundTag("mFluid")) : null; if (fluid != null && fluid.amount > 0) { currenttip.remove(0); - currenttip.add( - 0, - String.format("%d / %d mB %s", fluid.amount, getRealCapacity(), fluid.getLocalizedName())); + currenttip + .add(0, String.format("%d / %d mB %s", fluid.amount, getRealCapacity(), fluid.getLocalizedName())); } else { currenttip.add(0, "Tank Empty"); } @@ -509,7 +500,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, - int z) { + int z) { super.getWailaNBTData(player, tile, tag, world, x, y, z); FluidStack fluid = getFluid(); if (fluid != null) tag.setTag("mFluid", fluid.writeToNBT(new NBTTagCompound())); @@ -524,161 +515,142 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget( - new SlotWidget(inventoryHandler, getInputSlot()) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget( - new SlotWidget(inventoryHandler, getOutputSlot()).setAccess(true, false) - .setBackground( - getGUITextureSet().getItemSlot(), - GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 43)) - .widget( - new FluidDisplaySlotWidget( - inventoryHandler, - getStackDisplaySlot()).setFluidAccessConstructor(() -> constructFluidAccess(false)) - .setIHasFluidDisplay(this) - .setCanDrain(true) - .setCanFill(!isDrainableStackSeparate()) - .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) - .setActionDragAndDrop(FluidDisplaySlotWidget.Action.LOCK) - .setBeforeRealClick((clickData, widget) -> { - if (NetworkUtils.isClient()) { - // propagate display item content to actual fluid stored in - // this tank - setDrainableStack( - GT_Utility.getFluidFromDisplayStack( - widget.getMcSlot() - .getStack())); - } - return true; - }) - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(58, 41)) - .widget( - new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget( - TextWidget.dynamicString( - () -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)) - .widget(new CycleButtonWidget().setToggle(() -> mOutputFluid, val -> { - mOutputFluid = val; - if (!mOutputFluid) { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("262", "Fluid Auto Output Disabled")); - } else { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("263", "Fluid Auto Output Enabled")); - } - }) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) - .setGTTooltip( - () -> mTooltipCache.getData( - "GT5U.machines.digitaltank.autooutput.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(7, 63) - .setSize(18, 18)) - .widget(new CycleButtonWidget().setToggle(() -> mLockFluid, val -> { - mLockFluid = val; - - String inBrackets; - if (mLockFluid) { - if (mFluid == null) { - setLockedFluidName(null); - inBrackets = GT_Utility.trans( - "264", - "currently none, will be locked to the next that is put in"); - } else { - setLockedFluidName( - getDrainableStack().getFluid() - .getName()); - inBrackets = getDrainableStack().getLocalizedName(); - } - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - String.format("%s (%s)", GT_Utility.trans("265", "1 specific Fluid"), inBrackets)); - } else { - setLockedFluidName(null); - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("266", "Lock Fluid Mode Disabled")); - } - }) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_LOCK) - .setGTTooltip( - () -> mTooltipCache.getData( - "GT5U.machines.digitaltank.lockfluid.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(25, 63) - .setSize(18, 18)) - .widget(new CycleButtonWidget().setToggle(() -> mAllowInputFromOutputSide, val -> { - mAllowInputFromOutputSide = val; - if (!mAllowInputFromOutputSide) { - GT_Utility.sendChatToPlayer(buildContext.getPlayer(), GT_Utility.getTrans("096")); - } else { - GT_Utility.sendChatToPlayer(buildContext.getPlayer(), GT_Utility.getTrans("095")); - } - }) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_INPUT_FROM_OUTPUT_SIDE) - .setGTTooltip( - () -> mTooltipCache.getData( - "GT5U.machines.digitaltank.inputfromoutput.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(43, 63) - .setSize(18, 18)) - .widget(new CycleButtonWidget().setToggle(() -> mVoidFluidPart, val -> { - mVoidFluidPart = val; - if (!mVoidFluidPart) { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("267", "Overflow Voiding Mode Disabled")); - } else { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("268", "Overflow Voiding Mode Enabled")); - } - }) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS) - .setGTTooltip( - () -> mTooltipCache.getData( - "GT5U.machines.digitaltank.voidoverflow.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(151, 7) - .setSize(18, 18)) - .widget(new CycleButtonWidget().setToggle(() -> mVoidFluidFull, val -> { - mVoidFluidFull = val; - if (!mVoidFluidFull) { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("269", "Void Full Mode Disabled")); - } else { - GT_Utility.sendChatToPlayer( - buildContext.getPlayer(), - GT_Utility.trans("270", "Void Full Mode Enabled")); - } - }) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_VOID_ALL) - .setGTTooltip( - () -> mTooltipCache.getData( - "GT5U.machines.digitaltank.voidfull.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(151, 25) - .setSize(18, 18)); + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) + .setPos(7, 16) + .setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, getInputSlot()) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, getOutputSlot()).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 43)) + .widget( + new FluidDisplaySlotWidget(inventoryHandler, getStackDisplaySlot()) + .setFluidAccessConstructor(() -> constructFluidAccess(false)) + .setIHasFluidDisplay(this) + .setCanDrain(true) + .setCanFill(!isDrainableStackSeparate()) + .setActionRealClick(FluidDisplaySlotWidget.Action.TRANSFER) + .setActionDragAndDrop(FluidDisplaySlotWidget.Action.LOCK) + .setBeforeRealClick((clickData, widget) -> { + if (NetworkUtils.isClient()) { + // propagate display item content to actual fluid stored in + // this tank + setDrainableStack( + GT_Utility.getFluidFromDisplayStack( + widget.getMcSlot() + .getStack())); + } + return true; + }) + .setBackground(GT_UITextures.TRANSPARENT) + .setPos(58, 41)) + .widget( + new TextWidget("Liquid Amount").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 20)) + .widget( + TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mFluid != null ? mFluid.amount : 0)) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setPos(10, 30)) + .widget(new CycleButtonWidget().setToggle(() -> mOutputFluid, val -> { + mOutputFluid = val; + if (!mOutputFluid) { + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + GT_Utility.trans("262", "Fluid Auto Output Disabled")); + } else { + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + GT_Utility.trans("263", "Fluid Auto Output Enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_AUTOOUTPUT_FLUID) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.digitaltank.autooutput.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(7, 63) + .setSize(18, 18)) + .widget(new CycleButtonWidget().setToggle(() -> mLockFluid, val -> { + mLockFluid = val; + + String inBrackets; + if (mLockFluid) { + if (mFluid == null) { + setLockedFluidName(null); + inBrackets = GT_Utility + .trans("264", "currently none, will be locked to the next that is put in"); + } else { + setLockedFluidName( + getDrainableStack().getFluid() + .getName()); + inBrackets = getDrainableStack().getLocalizedName(); + } + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + String.format("%s (%s)", GT_Utility.trans("265", "1 specific Fluid"), inBrackets)); + } else { + setLockedFluidName(null); + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + GT_Utility.trans("266", "Lock Fluid Mode Disabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_LOCK) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.digitaltank.lockfluid.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(25, 63) + .setSize(18, 18)) + .widget(new CycleButtonWidget().setToggle(() -> mAllowInputFromOutputSide, val -> { + mAllowInputFromOutputSide = val; + if (!mAllowInputFromOutputSide) { + GT_Utility.sendChatToPlayer(buildContext.getPlayer(), GT_Utility.getTrans("096")); + } else { + GT_Utility.sendChatToPlayer(buildContext.getPlayer(), GT_Utility.getTrans("095")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_INPUT_FROM_OUTPUT_SIDE) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.digitaltank.inputfromoutput.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(43, 63) + .setSize(18, 18)) + .widget(new CycleButtonWidget().setToggle(() -> mVoidFluidPart, val -> { + mVoidFluidPart = val; + if (!mVoidFluidPart) { + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + GT_Utility.trans("267", "Overflow Voiding Mode Disabled")); + } else { + GT_Utility.sendChatToPlayer( + buildContext.getPlayer(), + GT_Utility.trans("268", "Overflow Voiding Mode Enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_VOID_EXCESS) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.digitaltank.voidoverflow.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(151, 7) + .setSize(18, 18)) + .widget(new CycleButtonWidget().setToggle(() -> mVoidFluidFull, val -> { + mVoidFluidFull = val; + if (!mVoidFluidFull) { + GT_Utility + .sendChatToPlayer(buildContext.getPlayer(), GT_Utility.trans("269", "Void Full Mode Disabled")); + } else { + GT_Utility + .sendChatToPlayer(buildContext.getPlayer(), GT_Utility.trans("270", "Void Full Mode Enabled")); + } + }) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_VOID_ALL) + .setGTTooltip(() -> mTooltipCache.getData("GT5U.machines.digitaltank.voidfull.tooltip")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(151, 25) + .setSize(18, 18)); } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java index 3d81076bc9..32d1694cc8 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java @@ -58,10 +58,10 @@ public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlo @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { return new ITexture[] { this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1], - LOCKERS[Math.abs(this.mType % LOCKERS.length)] }; + LOCKERS[Math.abs(this.mType % LOCKERS.length)] }; } return this.mTextures[0][(aColorIndex + 1)]; } @@ -177,7 +177,7 @@ public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlo @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { + float aY, float aZ) { if ((aBaseMetaTileEntity.isServerSide()) && (aSide == aBaseMetaTileEntity.getFrontFacing())) { for (int i = 0; i < 4; i++) { ItemStack tSwapStack = this.mInventory[i]; diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java index d6a936c745..4d51d0b634 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java @@ -31,25 +31,25 @@ public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_DigitalTank if (mFluid == null) { return new String[] { EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + Integer.toString(0) - + " L" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) - + " L" - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + Integer.toString(0) + + " L" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + + " L" + + EnumChatFormatting.RESET }; } return new String[] { EnumChatFormatting.BLUE + "Quantum Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) - + " L" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) - + " L" - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + + " L" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + + " L" + + EnumChatFormatting.RESET }; } } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java index 5dac66e49a..4493d57bd3 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java @@ -31,24 +31,24 @@ public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_DigitalTankBa if (mFluid == null) { return new String[] { EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + "0 L" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) - + " L" - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + "No Fluid" + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + "0 L" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + + " L" + + EnumChatFormatting.RESET }; } return new String[] { EnumChatFormatting.BLUE + "Super Tank" + EnumChatFormatting.RESET, "Stored Fluid:", - EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) - + " L" - + EnumChatFormatting.RESET - + " " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getCapacity()) - + " L" - + EnumChatFormatting.RESET }; + EnumChatFormatting.GOLD + mFluid.getLocalizedName() + EnumChatFormatting.RESET, + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(mFluid.amount) + + " L" + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getCapacity()) + + " L" + + EnumChatFormatting.RESET }; } } |