aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
commit0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a (patch)
tree1e2c649f3a6ce3f6b2babd0098a5f4819e9cd0b6 /src/main/java/gregtech/common/tileentities
parentf8cc82edeb9810c45cba762d733a2c909a302faa (diff)
downloadGT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.gz
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.bz2
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.zip
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gregtech/common/tileentities')
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ChestBuffer.java53
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Filter.java132
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_ItemDistributor.java73
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_RecipeFilter.java43
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_Regulator.java143
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_SuperBuffer.java53
-rw-r--r--src/main/java/gregtech/common/tileentities/automation/GT_MetaTileEntity_TypeFilter.java51
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java148
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Bronze.java225
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Lava.java61
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java163
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java38
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Steel.java41
-rw-r--r--src/main/java/gregtech/common/tileentities/debug/GT_MetaTileEntity_AdvDebugStructureWriter.java201
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_DieselGenerator.java185
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java182
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_LightningRod.java69
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicEnergyConverter.java106
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_MagicalEnergyAbsorber.java221
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_NaquadahReactor.java127
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_PlasmaGenerator.java65
-rw-r--r--src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_SteamTurbine.java149
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Bronze.java24
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_BronzeBricks.java35
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_Steel.java18
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_BasicHull_SteelBricks.java34
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java115
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java75
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java78
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java174
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java115
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Charger.java29
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CuringOven.java94
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java197
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_IndustrialApiary.java474
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java88
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MicrowaveEnergyTransmitter.java235
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java178
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java85
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java83
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Printer.java46
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java293
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Replicator.java82
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_RockBreaker.java77
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java166
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_SeismicProspector.java213
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java387
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineBase.java113
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineFluid.java67
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/long_distance/GT_MetaTileEntity_LongDistancePipelineItem.java65
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AbstractMultiFurnace.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java209
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java44
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java30
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit.java115
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java163
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfillerBase.java35
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java218
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java149
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase.java183
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java247
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ExtremeDieselEngine.java143
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java389
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer1.java27
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer2.java27
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer3.java27
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java210
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java76
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_IntegratedOreFactory.java235
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java181
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java4
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeChemicalReactor.java198
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine.java242
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java79
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_GasAdvanced.java77
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java95
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java218
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java92
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_MultiFurnace.java249
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_NanoForge.java192
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java177
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java157
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillInfinite.java19
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java1
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java128
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java946
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PlasmaForge.java1554
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java237
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java269
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java124
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_VacuumFreezer.java81
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multiblock/MultiBlock_Macerator.java63
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Bronze.java89
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_AlloySmelter_Steel.java89
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Bronze.java88
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Compressor_Steel.java88
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Bronze.java87
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Extractor_Steel.java87
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Bronze.java102
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_ForgeHammer_Steel.java102
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Bronze.java95
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Furnace_Steel.java93
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Bronze.java107
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/steam/GT_MetaTileEntity_Macerator_Steel.java106
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java221
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java347
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_Locker.java34
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java8
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumTank.java40
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_SuperTank.java38
121 files changed, 6804 insertions, 9118 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 7bcbe33b86..52cc1b1b96 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
@@ -6,6 +6,7 @@ import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_CHESTBUFFER_GLOW
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -16,52 +17,55 @@ import gregtech.api.render.TextureFactory;
public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer implements IAddUIWidgets {
- private static final int[] tickRate = {400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1};
- private static final int[] maxStacks = {1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128};
+ private static final int[] tickRate = { 400, 200, 100, 20, 4, 1, 1, 1, 1, 1, 1, 1, 1 };
+ private static final int[] maxStacks = { 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128 };
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)
- });
+ 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) });
}
- public GT_MetaTileEntity_ChestBuffer(
- int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ 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) {
+ public GT_MetaTileEntity_ChestBuffer(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ String[] aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
- public GT_MetaTileEntity_ChestBuffer(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_ChestBuffer(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_ChestBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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.builder().addIcon(AUTOMATION_CHESTBUFFER_GLOW).glow().build());
}
@Override
@@ -117,10 +121,9 @@ public class GT_MetaTileEntity_ChestBuffer extends GT_MetaTileEntity_Buffer impl
addEmitRedstoneButton(builder);
addInvertRedstoneButton(builder);
addStockingModeButton(builder);
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(69, true))
- .setPos(80, 60)
- .setSize(69, 22));
+ builder.widget(
+ 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 c1be592cf4..70e2673421 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
@@ -3,11 +3,15 @@ package gregtech.common.tileentities.automation;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_FILTER_GLOW;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
+
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -16,35 +20,41 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer implements IAddUIWidgets {
+
public boolean bIgnoreNBT = false;
public boolean bInvertFilter = false;
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"
- });
+ 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" });
}
- public GT_MetaTileEntity_Filter(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_Filter(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Filter(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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
@@ -106,62 +116,48 @@ public class GT_MetaTileEntity_Filter extends GT_MetaTileEntity_Buffer implement
addEmitEnergyButton(builder);
addEmitRedstoneButton(builder);
addInvertRedstoneButton(builder);
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- bInvertFilter = !bInvertFilter;
- if (bInvertFilter) {
- GT_Utility.sendChatToPlayer(
- widget.getContext().getPlayer(), GT_Utility.trans("124", "Invert Filter"));
- } else {
- GT_Utility.sendChatToPlayer(
- 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)
+ builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> {
+ bInvertFilter = !bInvertFilter;
+ if (bInvertFilter) {
+ GT_Utility.sendChatToPlayer(widget.getContext().getPlayer(), GT_Utility.trans("124", "Invert Filter"));
+ } else {
+ GT_Utility.sendChatToPlayer(
+ 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));
+ .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 bf2fa41b0d..e601847a72 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
@@ -3,9 +3,15 @@ package gregtech.common.tileentities.automation;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_ITEMDISTRIBUTOR_GLOW;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+
import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
@@ -15,53 +21,54 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer implements IAddUIWidgets {
+
private byte[] itemsPerSide = new byte[6];
private byte currentSide = 0, currentSideItemCount = 0;
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"
- });
- }
-
- public GT_MetaTileEntity_ItemDistributor(
- int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ 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" });
+ }
+
+ public GT_MetaTileEntity_ItemDistributor(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
}
- public GT_MetaTileEntity_ItemDistributor(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_ItemDistributor(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_ItemDistributor(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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.builder().addIcon(AUTOMATION_ITEMDISTRIBUTOR_GLOW).glow().build());
}
@Override
@@ -70,13 +77,8 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
return mTextures[0][aColorIndex + 1];
} else {
@@ -89,8 +91,8 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer
ITexture[][][] returnTextures = new ITexture[2][17][];
ITexture baseIcon = getOverlayIcon(), pipeIcon = TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_OUT);
for (int i = 0; i < 17; i++) {
- returnTextures[0][i] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i], baseIcon};
- returnTextures[1][i] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i], pipeIcon, baseIcon};
+ returnTextures[0][i] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i], baseIcon };
+ returnTextures[1][i] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i], pipeIcon, baseIcon };
}
return returnTextures;
}
@@ -185,10 +187,9 @@ public class GT_MetaTileEntity_ItemDistributor extends GT_MetaTileEntity_Buffer
addEmitEnergyButton(builder);
addEmitRedstoneButton(builder);
addInvertRedstoneButton(builder);
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(87, true))
- .setPos(62, 60)
- .setSize(87, 22));
+ builder.widget(
+ 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 14a6af709a..7502ae73de 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
@@ -3,7 +3,14 @@ package gregtech.common.tileentities.automation;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_RECIPEFILTER_GLOW;
+import java.util.Collections;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import com.gtnewhorizons.modularui.api.drawable.Text;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -12,29 +19,28 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SpecialFilt
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gregtech.common.blocks.GT_Item_Machines;
-import java.util.Collections;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_RecipeFilter extends GT_MetaTileEntity_SpecialFilter {
+
public GT_Recipe.GT_Recipe_Map mRecipeMap;
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"
- });
+ 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" });
}
- public GT_MetaTileEntity_RecipeFilter(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_RecipeFilter(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_RecipeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -59,17 +65,18 @@ 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.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 5abb6d804b..af4426932a 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
@@ -3,6 +3,12 @@ package gregtech.common.tileentities.automation;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_REGULATOR_GLOW;
+import java.util.Collections;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
@@ -10,6 +16,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -18,48 +25,48 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Buffer;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.Collections;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implements IAddUIWidgets {
- public int[] mTargetSlots = {0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ public int[] mTargetSlots = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
private boolean charge = false, decharge = false;
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"
- });
- }
-
- public GT_MetaTileEntity_Regulator(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ 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" });
+ }
+
+ public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_Regulator(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Regulator(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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.builder().addIcon(AUTOMATION_REGULATOR_GLOW).glow().build());
}
@Override
@@ -105,19 +112,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;
@@ -128,8 +132,7 @@ 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
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && aIndex >= 0
&& aIndex <= 8
&& GT_Utility.areStacksEqual(aStack, this.mInventory[(aIndex + 9)]);
}
@@ -167,50 +170,40 @@ public class GT_MetaTileEntity_Regulator extends GT_MetaTileEntity_Buffer implem
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
addEmitEnergyButton(builder);
builder.widget(createChargerSlot(43, 62));
- builder.widget(new DrawableWidget()
- .setDrawable(GT_UITextures.PICTURE_ARROW_22_RED.apply(84, true))
- .setPos(65, 60)
+ 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));
+ .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++) {
final int index = i;
int xPos = xBase + (i % 3) * 18, yPos = yBase + (i / 3) * 18;
- builder.widget(
- new SlotWidget(BaseSlot.empty()) {
- @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)));
- }
- }.setBackground(GT_UITextures.TRANSPARENT).setPos(xPos, yPos))
- .widget(TextWidget.dynamicString(() -> String.valueOf(mTargetSlots[index]))
+ builder.widget(new SlotWidget(BaseSlot.empty()) {
+
+ @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)));
+ }
+ }.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)));
}
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 a91a082c4e..cefd3152c1 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
@@ -3,54 +3,61 @@ package gregtech.common.tileentities.automation;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_SUPERBUFFER_GLOW;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.minecraft.item.ItemStack;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import net.minecraft.item.ItemStack;
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)
- });
+ 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) });
}
- public GT_MetaTileEntity_SuperBuffer(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_SuperBuffer(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_SuperBuffer(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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.builder().addIcon(AUTOMATION_SUPERBUFFER_GLOW).glow().build());
}
@Override
@@ -86,9 +93,7 @@ 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));
+ builder.widget(
+ 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 49cdc6617c..64b5a43ad8 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
@@ -4,7 +4,16 @@ import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER;
import static gregtech.api.enums.Textures.BlockIcons.AUTOMATION_TYPEFILTER_GLOW;
+import java.util.Arrays;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
import com.google.common.collect.ImmutableList;
+
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -14,14 +23,9 @@ import gregtech.api.objects.ItemData;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
-import java.util.Arrays;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilter {
+
public int mRotationIndex = 0;
public OrePrefixes mPrefix = OrePrefixes.ore;
@@ -41,37 +45,40 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte
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"
- });
+ 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" });
}
- public GT_MetaTileEntity_TypeFilter(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_TypeFilter(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TypeFilter(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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.builder().addIcon(AUTOMATION_TYPEFILTER_GLOW).glow().build());
}
@Override
@@ -121,8 +128,8 @@ public class GT_MetaTileEntity_TypeFilter extends GT_MetaTileEntity_SpecialFilte
}
this.mInventory[SPECIAL_SLOT_INDEX] = GT_Utility.copyAmount(
1L,
- this.mPrefix.mPrefixedItems.get(
- this.mRotationIndex = (this.mRotationIndex + 1) % this.mPrefix.mPrefixedItems.size()));
+ 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());
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 9eb861ad06..3d2f69c26d 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
@@ -2,6 +2,14 @@ package gregtech.common.tileentities.boilers;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
@@ -9,6 +17,7 @@ import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -30,16 +39,10 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.GT_Pollution;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTank
implements IGetTitleColor, IAddUIWidgets {
+
public static final byte SOUND_EVENT_LET_OFF_EXCESS_STEAM = 1;
public int mTemperature = 20;
public int mProcessingEnergy = 0;
@@ -48,13 +51,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa
public boolean mHadNoWater = false;
private int mExcessWater = 0;
- public GT_MetaTileEntity_Boiler(
- int aID, String aName, String aNameRegional, String aDescription, ITexture... aTextures) {
+ public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
}
- public GT_MetaTileEntity_Boiler(
- int aID, String aName, String aNameRegional, String[] aDescription, ITexture... aTextures) {
+ public GT_MetaTileEntity_Boiler(int aID, String aName, String aNameRegional, String[] aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures);
}
@@ -67,17 +70,12 @@ 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) {
- ITexture[] tmp =
- mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ ITexture[] tmp = mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex
+ + 1];
if (aSide != aFacing && tmp.length == 2) {
- tmp = new ITexture[] {tmp[0]};
+ tmp = new ITexture[] { tmp[0] };
}
return tmp;
}
@@ -214,8 +212,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa
}
try {
aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound()));
- } catch (Throwable ignored) {
- }
+ } catch (Throwable ignored) {}
}
@Override
@@ -275,8 +272,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)
+ if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0)
&& (aTick % getHeatUpRate() == 0L)) {
this.mProcessingEnergy -= getEnergyConsumption();
this.mTemperature += getHeatUpAmount();
@@ -325,11 +321,10 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa
protected final void pushSteamToSide(IGregTechTileEntity aBaseMetaTileEntity, int aSide) {
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);
+ int tFilledAmount = tTileEntity.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tDrained, false);
if (tFilledAmount <= 0) return;
tTileEntity.fill(
ForgeDirection.getOrientation(aSide).getOpposite(),
@@ -370,13 +365,13 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa
if (aIndex == GT_MetaTileEntity_Boiler.SOUND_EVENT_LET_OFF_EXCESS_STEAM) {
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());
+ 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());
}
}
@@ -420,15 +415,13 @@ 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())
- };
+ return new IDrawable[] { getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_COAL_STEAM.get(getSteamVariant()) };
}
protected IDrawable[] getAshSlotBackground() {
- return new IDrawable[] {
- getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant())
- };
+ return new IDrawable[] { getGUITextureSet().getItemSlot(),
+ GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant()) };
}
@Override
@@ -438,44 +431,41 @@ 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)
+ 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));
+ .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() {
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 ef343d24f2..e88a35c617 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
@@ -10,6 +10,10 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.block.Block;
+import net.minecraft.tileentity.TileEntityFurnace;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
@@ -26,17 +30,17 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.GT_Pollution;
-import net.minecraft.block.Block;
-import net.minecraft.tileentity.TileEntityFurnace;
-import net.minecraftforge.common.util.ForgeDirection;
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"
- });
+ 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" });
}
public GT_MetaTileEntity_Boiler_Bronze(int aID, String aName, String aNameRegional, String[] aDescription) {
@@ -54,27 +58,13 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
@Override
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()
- };
+ 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() };
for (int i = 0; i < 17; i++) {
rTextures[0][i] = texBottom;
rTextures[1][i] = texTop;
@@ -107,8 +97,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
final byte frontFacing = aBaseMetaTileEntity.getFrontFacing();
- if (frontFacing > 1
- && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0
+ if (frontFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(frontFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(frontFacing)) {
final double oX = aBaseMetaTileEntity.getOffsetX(frontFacing, 1) + 8D / 16D;
@@ -136,10 +125,8 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
z = oZ + offset;
}
- ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
- .setMotion(0D, 0D, 0D)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld());
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(0D, 0D, 0D)
+ .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.SMOKE).run();
particleEventBuilder.setIdentifier(ParticleFX.FLAME).run();
}
@@ -149,8 +136,7 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if ((aBaseMetaTileEntity.isServerSide())
- && (aTick > 20L)
+ if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)
&& this.mProcessingEnergy > 0
&& (aTick % 20L == 0L)) {
GT_Pollution.addPollution(getBaseMetaTileEntity(), getPollution());
@@ -186,7 +172,7 @@ 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.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)
@@ -202,9 +188,8 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
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.Coal)
+ || GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Charcoal) ? 3
: GT_Utility.isPartOfMaterials(this.mInventory[2], Materials.Lignite) ? 8 : 2)
== 0) {
aBaseMetaTileEntity.addStackToSlot(
@@ -212,99 +197,93 @@ public class GT_MetaTileEntity_Boiler_Bronze extends GT_MetaTileEntity_Boiler {
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,
+ || 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
+ (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));
- }
+ 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));
+ }
}
@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 14a2833549..6a1ad39195 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
@@ -9,6 +9,8 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_STEELBRICKS_TOP;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -19,7 +21,6 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
@@ -29,14 +30,18 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
public static final int PRODUCTION_PER_SECOND = 600;
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 " + Integer.toString(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"
- });
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ new String[] { "A Boiler running off Lava",
+ "Produces " + PRODUCTION_PER_SECOND + "L of Steam per second",
+ "Causes " + Integer.toString(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) {
@@ -50,24 +55,14 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
@Override
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_LAVA_FRONT),
- TextureFactory.of(BOILER_LAVA_FRONT_GLOW)
- },
- texFrontActive =
- {
- TextureFactory.of(MACHINE_STEELBRICKS_SIDE),
- TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE),
- TextureFactory.builder()
- .addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW)
- .glow()
- .build()
- };
+ 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_LAVA_FRONT),
+ TextureFactory.of(BOILER_LAVA_FRONT_GLOW) },
+ texFrontActive = { TextureFactory.of(MACHINE_STEELBRICKS_SIDE),
+ TextureFactory.of(BOILER_LAVA_FRONT_ACTIVE),
+ TextureFactory.builder().addIcon(BOILER_LAVA_FRONT_ACTIVE_GLOW).glow().build() };
for (byte i = 0; i < 17; i++) {
rTextures[0][i] = texBottom;
rTextures[1][i] = texTop;
@@ -124,12 +119,12 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA;
aBaseMetaTileEntity.decrStackSize(2, 1);
aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L));
- } else if (GT_OreDictUnificator.isItemStackInstanceOf(
- this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) {
- this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA;
- aBaseMetaTileEntity.decrStackSize(2, 1);
- // Clay lava buckets break, so you don't get it back.
- }
+ } else if (GT_OreDictUnificator
+ .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucketClay.get(Materials.Lava))) {
+ this.mProcessingEnergy += 1000 * ENERGY_PER_LAVA;
+ aBaseMetaTileEntity.decrStackSize(2, 1);
+ // Clay lava buckets break, so you don't get it back.
+ }
}
@Override
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 978e70e5ab..746f0602d6 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
@@ -5,8 +5,22 @@ import static gregtech.api.enums.ConfigCategories.machineconfig;
import static mcp.mobius.waila.api.SpecialChars.GOLD;
import static mcp.mobius.waila.api.SpecialChars.RESET;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import gregtech.api.enums.Dyes;
import gregtech.api.enums.SteamVariant;
import gregtech.api.enums.Textures.BlockIcons;
@@ -18,18 +32,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
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",
@@ -55,8 +60,8 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
mConfig = createConfig();
}
- protected GT_MetaTileEntity_Boiler_Solar(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) {
+ protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ Config aConfig) {
super(aName, aTier, aDescription, aTextures);
mConfig = aConfig;
}
@@ -93,10 +98,9 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
@Override
public String[] getDescription() {
return String.format(
- localizedDescFormat,
- GT_Utility.formatNumbers(getMaxOutputPerSecond()),
- GT_Utility.formatNumbers(getMinOutputPerSecond()))
- .split("\\R");
+ localizedDescFormat,
+ GT_Utility.formatNumbers(getMaxOutputPerSecond()),
+ GT_Utility.formatNumbers(getMinOutputPerSecond())).split("\\R");
}
public int getMinOutputPerSecond() {
@@ -109,29 +113,21 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
for (int color = -1; color < 16; color++) {
int i = color + 1;
short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa);
- rTextures[0][i] =
- new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)};
- rTextures[1][i] = new ITexture[] {
- TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation),
- TextureFactory.of(BlockIcons.BOILER_SOLAR)
- };
- rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)};
- rTextures[3][i] = new ITexture[] {
- TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation),
- TextureFactory.of(BlockIcons.OVERLAY_PIPE)
- };
+ rTextures[0][i] = new ITexture[] {
+ TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation) };
+ rTextures[1][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation),
+ TextureFactory.of(BlockIcons.BOILER_SOLAR) };
+ rTextures[2][i] = new ITexture[] {
+ TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation) };
+ rTextures[3][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation),
+ TextureFactory.of(BlockIcons.OVERLAY_PIPE) };
}
return rTextures;
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
int i = aColorIndex + 1;
if (aSide >= 2) {
if (aSide != aFacing) return mTextures[2][i];
@@ -187,12 +183,12 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
if (mRunTimeTicks > mConfig.getMaxRuntimeTicks()) {
return mConfig.getMinOutputPerSecond();
} else if (mRunTimeTicks > mConfig.getCalcificationTicks()) {
- /* When reaching calcification ticks; discount the proportion of run-time spent on calcification
- * from the maximum output per second, and return this or the minimum output per second
+ /*
+ * When reaching calcification ticks; discount the proportion of run-time spent on calcification from the
+ * maximum output per second, and return this or the minimum output per second
*/
return mConfig.getMaxOutputPerSecond()
- - mConfig.getMaxOutputPerSecond()
- * (mRunTimeTicks - mConfig.getCalcificationTicks())
+ - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks())
/ mConfig.getCalcificationTicks();
} else {
return mConfig.getMaxOutputPerSecond();
@@ -257,19 +253,32 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
@Override
public String[] getInfoData() {
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,
- GT_Utility.formatNumbers(getHeatCapacityPercent()),
- GT_Utility.formatNumbers(getHotTimeSeconds()),
- GT_Utility.formatNumbers(getMinOutputPerSecond()),
- GT_Utility.formatNumbers(getMaxOutputPerSecond()),
- GT_Utility.formatNumbers(getProductionPerSecond()))
- .split("\\R");
+ "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,
+ GT_Utility.formatNumbers(getHeatCapacityPercent()),
+ GT_Utility.formatNumbers(getHotTimeSeconds()),
+ GT_Utility.formatNumbers(getMinOutputPerSecond()),
+ GT_Utility.formatNumbers(getMaxOutputPerSecond()),
+ GT_Utility.formatNumbers(getProductionPerSecond())).split("\\R");
}
public int getHeatCapacityPercent() {
@@ -287,12 +296,12 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
@Override
protected IDrawable[] getFuelSlotBackground() {
- return new IDrawable[] {GT_UITextures.TRANSPARENT};
+ return new IDrawable[] { GT_UITextures.TRANSPARENT };
}
@Override
protected IDrawable[] getAshSlotBackground() {
- return new IDrawable[] {GT_UITextures.TRANSPARENT};
+ return new IDrawable[] { GT_UITextures.TRANSPARENT };
}
@Override
@@ -308,38 +317,36 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor,
+ 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")));
+ currentTip.add(
+ 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) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
tag.setInteger("calcificationOutput", (getProductionPerSecond()));
tag.setInteger("maxCalcificationOutput", (getMaxOutputPerSecond()));
}
protected static class Config {
+
private final int calcificationTicks;
private final int minOutputPerSecond;
private final int maxOutputPerSecond;
private final int coolDownTicks;
private final int maxRuntimeTicks;
- public Config(
- String aCategory,
- int aDefaultCalcificationTicks,
- int aDefaultMinOutputPerSecond,
- int aDefaultMaxOutputPerSecond,
- int aDefaultCoolDownTicks) {
+ public Config(String aCategory, int aDefaultCalcificationTicks, int aDefaultMinOutputPerSecond,
+ int aDefaultMaxOutputPerSecond, int aDefaultCoolDownTicks) {
calcificationTicks = get(
aCategory,
"CalcificationTicks",
@@ -348,24 +355,22 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
"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.");
+ coolDownTicks = get(
+ aCategory,
+ "CoolDownTicks",
+ aDefaultCoolDownTicks,
+ "Number of ticks it takes to lose 1°C.");
// After which min output is reached.
- maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond())
- * getCalcificationTicks()
- / getMaxOutputPerSecond()
- + getCalcificationTicks();
+ maxRuntimeTicks = (getMaxOutputPerSecond() - getMinOutputPerSecond()) * getCalcificationTicks()
+ / getMaxOutputPerSecond() + getCalcificationTicks();
}
- protected int get(
- final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) {
+ protected int get(final String aCategory, final String aKey, final int aDefaultValue,
+ final String... aComments) {
final StringBuilder tCommentBuilder = new StringBuilder();
for (String tComment : aComments) tCommentBuilder.append(tComment).append('\n');
tCommentBuilder.append("Default: ").append(aDefaultValue);
- return sMachineFile
- .mConfig
- .get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString())
- .getInt();
+ return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()).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 997ca33df5..45e22c29fb 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
@@ -11,22 +11,23 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar {
+
public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GT_MetaTileEntity_Boiler_Solar_Steel(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
- public GT_MetaTileEntity_Boiler_Solar_Steel(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
- public GT_MetaTileEntity_Boiler_Solar_Steel(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) {
+ public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures, Config aConfig) {
super(aName, aTier, aDescription, aTextures, aConfig);
}
@@ -42,17 +43,14 @@ public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boil
for (int color = -1; color < 16; color++) {
int i = color + 1;
short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa);
- rTextures[0][i] =
- new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)};
- rTextures[1][i] = new ITexture[] {
- TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation),
- TextureFactory.of(BlockIcons.BOILER_SOLAR)
- };
- rTextures[2][i] = new ITexture[] {TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)};
- rTextures[3][i] = new ITexture[] {
- TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation),
- TextureFactory.of(BlockIcons.OVERLAY_PIPE)
- };
+ rTextures[0][i] = new ITexture[] {
+ TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation) };
+ rTextures[1][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation),
+ TextureFactory.of(BlockIcons.BOILER_SOLAR) };
+ rTextures[2][i] = new ITexture[] {
+ TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation) };
+ rTextures[3][i] = new ITexture[] { TextureFactory.of(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation),
+ TextureFactory.of(BlockIcons.OVERLAY_PIPE) };
}
return rTextures;
}
@@ -70,6 +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 0ae425f792..719fd13317 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
@@ -19,12 +19,13 @@ import gregtech.api.render.TextureFactory;
public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bronze {
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 " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond)
- + " Pollution per second"
- });
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ new String[] { "Faster than the Bronze Boiler", "Produces 300L of Steam per second",
+ "Causes " + Integer.toString(GT_Mod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond)
+ + " Pollution per second" });
}
public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -38,27 +39,13 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler_Bro
@Override
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()
- };
+ 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() };
for (int i = 0; i < 17; i++) {
rTextures[0][i] = texBottom;
rTextures[1][i] = texTop;
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 663b7ed326..fbc2e4af14 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
@@ -3,6 +3,20 @@ package gregtech.common.tileentities.debug;
import static gregtech.GT_Mod.GT_FML_LOGGER;
import static net.minecraft.util.StatCollector.translateToLocal;
+import java.util.HashMap;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.entity.EntityPlayerSP;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ChatComponentTranslation;
+import net.minecraftforge.client.event.RenderWorldLastEvent;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import org.lwjgl.opengl.GL11;
+
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import com.gtnewhorizon.structurelib.util.Vec3Impl;
@@ -14,6 +28,7 @@ import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.MultiChildWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -28,34 +43,24 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.render.TextureFactory;
-import java.util.HashMap;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.entity.EntityPlayerSP;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ChatComponentTranslation;
-import net.minecraftforge.client.event.RenderWorldLastEvent;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.common.util.ForgeDirection;
-import org.lwjgl.opengl.GL11;
public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity_TieredMachineBlock
implements IAddGregtechLogo, IAddUIWidgets {
- private static final HashMap<GT_MetaTileEntity_AdvDebugStructureWriter, BoundHighlighter> bondingBoxes =
- new HashMap<>(1);
+
+ private static final HashMap<GT_MetaTileEntity_AdvDebugStructureWriter, BoundHighlighter> bondingBoxes = new HashMap<>(
+ 1);
private final BoundHighlighter boundingBox = new BoundHighlighter();
private final short[] numbers = new short[6];
private boolean transpose = false;
private boolean showHighlightBox = true;
- private String[] result = new String[] {"Undefined"};
+ private String[] result = new String[] { "Undefined" };
public GT_MetaTileEntity_AdvDebugStructureWriter(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 0, "");
}
- public GT_MetaTileEntity_AdvDebugStructureWriter(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_AdvDebugStructureWriter(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
}
@@ -65,25 +70,13 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- 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())
- };
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()) };
}
@Override
@@ -133,8 +126,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;
@@ -215,11 +208,10 @@ 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
+ 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
};
}
@@ -240,76 +232,73 @@ 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)
+ 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));
+ .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);
addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_PLUS_LARGE, 512, 64, 151);
}
- private void addChangeNumberButtons(
- ModularWindow.Builder builder, IDrawable overlay, int addNumberShift, int addNumber, int xPos) {
- int[] yPos = new int[] {4, 22, 40, 62, 80, 98};
+ private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift,
+ 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]));
+ 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]));
}
}
@@ -320,10 +309,8 @@ 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));
+ builder.widget(
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(113, 96));
}
@Override
@@ -332,6 +319,7 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity
}
public static class ForgeEventHandler {
+
public ForgeEventHandler() {
MinecraftForge.EVENT_BUS.register(this);
}
@@ -347,6 +335,7 @@ public class GT_MetaTileEntity_AdvDebugStructureWriter extends GT_MetaTileEntity
}
private static class BoundHighlighter {
+
public Vec3Impl pos1;
public Vec3Impl pos2;
public boolean showHighlightBox;
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 1b53de5b42..d2304cc948 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
@@ -3,6 +3,10 @@ package gregtech.common.tileentities.generators;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -20,22 +24,22 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGenerator {
public int mEfficiency;
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"
- });
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ new String[] { "Requires liquid Fuel",
+ "Causes "
+ + (int) (GT_Mod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond
+ * GT_Mod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier[aTier])
+ + " Pollution per second" });
onConfigLoad();
}
@@ -98,8 +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);
@@ -120,152 +129,98 @@ public class GT_MetaTileEntity_DieselGenerator extends GT_MetaTileEntity_BasicGe
if (aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
- final double x =
- aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 16D + XSTR_INSTANCE.nextFloat() * 14D / 16D;
+ final double x = aBaseMetaTileEntity.getOffsetX(topFacing, 1) + 2D / 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;
-
- new ParticleEventBuilder()
- .setMotion(0D, 0D, 0D)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld())
- .setIdentifier(ParticleFX.SMOKE)
- .run();
+ final double z = aBaseMetaTileEntity.getOffsetZ(topFacing, 1) + 2D / 16D
+ + XSTR_INSTANCE.nextFloat() * 14D / 16D;
+
+ new ParticleEventBuilder().setMotion(0D, 0D, 0D).setPosition(x, y, z)
+ .setWorld(getBaseMetaTileEntity().getWorld()).setIdentifier(ParticleFX.SMOKE).run();
}
}
}
@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]
- };
+ 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] };
}
@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())
- };
+ return new ITexture[] { super.getBack(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getBottom(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getTop(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getSides(aColor)[0],
+ 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]
- };
+ 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] };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@Override
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 b085d82bab..90b076abaa 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
@@ -18,25 +18,31 @@ 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"
- });
+ super(
+ 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"
- });
+ super(
+ 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();
}
@@ -55,8 +61,8 @@ public class GT_MetaTileEntity_GasTurbine extends GT_MetaTileEntity_BasicGenerat
onConfigLoad();
}
- public GT_MetaTileEntity_GasTurbine(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int mEfficiency) {
+ public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ int mEfficiency) {
super(aName, aTier, aDescription, aTextures);
this.mEfficiency = mEfficiency;
onConfigLoad();
@@ -70,7 +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
@@ -84,8 +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
@@ -95,134 +105,84 @@ 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]
- };
+ 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] };
}
@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())
- };
+ return new ITexture[] { super.getBack(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getBottom(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getTop(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getSides(aColor)[0],
+ 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]
- };
+ 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] };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@Override
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 dbb8931848..2436beba77 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
@@ -2,6 +2,13 @@ package gregtech.common.tileentities.generators;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.entity.effect.EntityLightningBolt;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
@@ -9,54 +16,35 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.render.TextureFactory;
-import net.minecraft.entity.effect.EntityLightningBolt;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_LightningRod extends GT_MetaTileEntity_TieredMachineBlock {
+
public GT_MetaTileEntity_LightningRod(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 0, "Generates EU From Lightning Bolts");
}
- public GT_MetaTileEntity_LightningRod(
- String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_LightningRod(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_LightningRod(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide != ForgeDirection.UP.ordinal()) {
- return new ITexture[] {
- BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], BlockIcons.OVERLAYS_ENERGY_OUT_POWER[mTier]
- };
+ return new ITexture[] { BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1],
+ 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()
- };
+ 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() };
}
@Override
@@ -67,7 +55,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
@@ -90,10 +82,7 @@ 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")) {
+ && aBaseMetaTileEntity.getBlock(aX, i, aZ).getUnlocalizedName().equals("blockFenceIron")) {
aRodValue++;
} else {
isRodValid = false;
@@ -105,8 +94,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 2e1bfd655f..6bc904d384 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
@@ -20,6 +20,7 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_BasicGenerator {
+
public int mEfficiency;
public GT_MetaTileEntity_MagicEnergyConverter(int aID, String aName, String aNameRegional, int aTier) {
@@ -27,14 +28,14 @@ public class GT_MetaTileEntity_MagicEnergyConverter extends GT_MetaTileEntity_Ba
onConfigLoad();
}
- public GT_MetaTileEntity_MagicEnergyConverter(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad();
}
- public GT_MetaTileEntity_MagicEnergyConverter(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_MagicEnergyConverter(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad();
}
@@ -47,7 +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
@@ -74,112 +78,64 @@ 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]
- };
+ 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] };
}
@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()
- };
+ return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT),
+ 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()
- };
+ return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC),
+ 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()
- };
+ return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC),
+ 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()
- };
+ return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC),
+ 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]
- };
+ 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] };
}
@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()
- };
+ 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() };
}
@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()
- };
+ return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ 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()
- };
+ return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ 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()
- };
+ return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ 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 210483cbe8..c92cf8b699 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
@@ -12,24 +12,6 @@ import static net.minecraft.util.EnumChatFormatting.RESET;
import static net.minecraft.util.EnumChatFormatting.UNDERLINE;
import static net.minecraft.util.EnumChatFormatting.YELLOW;
-import com.google.common.base.Enums;
-import cpw.mods.fml.common.Loader;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ParticleFX;
-import gregtech.api.enums.TC_Aspects;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -38,6 +20,7 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockDragonEgg;
import net.minecraft.enchantment.Enchantment;
@@ -54,13 +37,35 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.util.ForgeDirection;
+
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.AspectSourceHelper;
import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.visnet.VisNetHandler;
+import com.google.common.base.Enums;
+
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ParticleFX;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenerator;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
+
interface MagicalEnergyBBListener {
+
void onMagicalEnergyBBUpdate();
}
@@ -68,10 +73,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
implements MagicalEnergyBBListener {
private static final boolean THAUMCRAFT_LOADED = Loader.isModLoaded(MOD_ID_TC);
- private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals =
- new ConcurrentHashMap<>(4);
- private static final List<Aspect> sPrimalAspects =
- (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects() : new ArrayList<>();
+ private static final ConcurrentHashMap<UUID, GT_MetaTileEntity_MagicalEnergyAbsorber> sSubscribedCrystals = new ConcurrentHashMap<>(
+ 4);
+ private static final List<Aspect> sPrimalAspects = (THAUMCRAFT_LOADED) ? Aspect.getPrimalAspects()
+ : new ArrayList<>();
private static final Map<Aspect, Integer> sAspectsEnergy = new HashMap<>();
private static boolean sAllowMultipleEggs = false;
private static GT_MetaTileEntity_MagicalEnergyAbsorber sActiveSiphon = null;
@@ -92,8 +97,8 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
onConfigLoad(GregTech_API.sMachineFile);
}
- private GT_MetaTileEntity_MagicalEnergyAbsorber(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ private GT_MetaTileEntity_MagicalEnergyAbsorber(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad(GregTech_API.sMachineFile);
}
@@ -112,13 +117,11 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
sEnergyFromVis = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerVis", 20);
sEnergyPerEssentia = aConfig.get(machineconfig, "MagicEnergyAbsorber.EnergyPerEssentia", 320);
for (Aspect tAspect : Aspect.aspects.values()) {
- //noinspection UnstableApiUsage
+ // noinspection UnstableApiUsage
sAspectsEnergy.put(
tAspect,
Enums.getIfPresent(TC_Aspects.class, tAspect.getTag().toUpperCase(Locale.ENGLISH))
- .or(TC_Aspects.AER)
- .mValue
- * sEnergyPerEssentia);
+ .or(TC_Aspects.AER).mValue * sEnergyPerEssentia);
}
}
}
@@ -131,8 +134,10 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
public void onConfigLoad(GT_Config aConfig) {
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))));
+ mMaxVisPerDrain = (int) Math.round(
+ 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;
}
@@ -203,15 +208,26 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
List<String> description = new ArrayList<>();
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");
+ description.add(
+ 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");
+ description.add(
+ 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):");
@@ -220,8 +236,13 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
description.add(" ");
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");
+ description.add(
+ "- 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() + "%");
@@ -230,108 +251,63 @@ 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]
- };
+ 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] };
}
@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()
- };
+ return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_FRONT),
+ 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()
- };
+ return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC),
+ 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_DRAGONEGG)};
+ return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG) };
}
@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()
- };
+ return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC),
+ 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]
- };
+ 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] };
}
@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()
- };
+ 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() };
}
@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()
- };
+ return new ITexture[] { super.getBottomActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ 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()
- };
+ return new ITexture[] { super.getTopActive(aColor)[0], TextureFactory.of(MACHINE_CASING_DRAGONEGG),
+ 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()
- };
+ return new ITexture[] { super.getSidesActive(aColor)[0], TextureFactory.of(MACHINE_CASING_MAGIC_ACTIVE),
+ TextureFactory.builder().addIcon(MACHINE_CASING_MAGIC_ACTIVE_GLOW).glow().build() };
}
@Override
@@ -373,8 +349,9 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
mNextGenerateTickRate = 20;
}
aBaseMetaTileEntity.increaseStoredEnergyUnits(tGeneratedEU, true);
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
- && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
+ aBaseMetaTileEntity.setActive(
+ aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU());
}
}
@@ -398,8 +375,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
final double oZ = aBaseMetaTileEntity.getZCoord() + 8D / 16D;
final ParticleEventBuilder particleEventBuilder = new ParticleEventBuilder()
- .setWorld(getBaseMetaTileEntity().getWorld())
- .setIdentifier(ParticleFX.PORTAL);
+ .setWorld(getBaseMetaTileEntity().getWorld()).setIdentifier(ParticleFX.PORTAL);
for (int i = 0; i < 9; i++) {
final double dX = (XSTR_INSTANCE.nextFloat() - 0.5D) / 2D;
@@ -415,10 +391,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
final double mY = -(dXZ * dY) / 4D;
final double mZ = dZ * 4D;
- particleEventBuilder
- .setMotion(mX, mY, mZ)
- .setPosition(x, y, z)
- .run();
+ particleEventBuilder.setMotion(mX, mY, mZ).setPosition(x, y, z).run();
}
}
}
@@ -498,8 +471,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()
+ if ((getBaseMetaTileEntity().getStoredEU() + tEU) < getBaseMetaTileEntity().getEUCapacity()
&& getBaseMetaTileEntity().addStackToSlot(getOutputSlot(), tOutputStack)) {
decrStackSize(getInputSlot(), 1);
} else {
@@ -516,8 +488,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
private long absorbFromEgg() {
if (!hasEgg()) return 0;
if (!sAllowMultipleEggs) {
- if (sActiveSiphon != null
- && sActiveSiphon != this
+ if (sActiveSiphon != null && sActiveSiphon != this
&& sActiveSiphon.getBaseMetaTileEntity() != null
&& !sActiveSiphon.getBaseMetaTileEntity().isInvalidTileEntity()
&& sActiveSiphon.isChunkLoaded()
@@ -575,20 +546,18 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
long tEU = 0;
- long tEUtoGen = getBaseMetaTileEntity().getEUCapacity()
- - getBaseMetaTileEntity().getUniversalEnergyStored();
+ long tEUtoGen = getBaseMetaTileEntity().getEUCapacity() - getBaseMetaTileEntity().getUniversalEnergyStored();
List<Aspect> mAvailableEssentiaAspects = mMagicalEnergyBB.getAvailableAspects();
// try to drain 1 of whatever aspect available in containers within RANGE
for (int i = mAvailableEssentiaAspects.size() - 1; i >= 0 && tEUtoGen > 0; i--) {
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())) {
+ if (tAspectEU <= tEUtoGen && AspectSourceHelper.drainEssentia(
+ (TileEntity) getBaseMetaTileEntity(),
+ aspect,
+ ForgeDirection.UNKNOWN,
+ mMagicalEnergyBB.getRange())) {
tEUtoGen -= tAspectEU;
tEU += tAspectEU;
}
@@ -634,6 +603,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
* Handles Bounding Box ranged operations for Magic sources
*/
static class MagicalEnergyBB {
+
private final GT_MetaTileEntity_MagicalEnergyAbsorber mAbsorber;
private final MagicalEnergyBBListener mListener;
private final int mDefaultTier;
@@ -709,8 +679,8 @@ 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() {
@@ -788,8 +758,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
}
/**
- * Change the Bounding Box tier relatively to offset
- * with wrapping at tier limits
+ * Change the Bounding Box tier relatively to offset with wrapping at tier limits
*
* @param aOffset relative tier change
*/
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 6ca6da874f..5fe5107dc4 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
@@ -15,8 +15,8 @@ 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) {
+ public GT_MetaTileEntity_NaquadahReactor(int aID, String aName, String[] aDescription, String aNameRegional,
+ int aTier) {
super(aID, aName, aNameRegional, aTier, aDescription);
if (aTier > 8 || aTier < 4) {
new Exception("Tier without Recipe Map!").printStackTrace();
@@ -34,8 +34,7 @@ public class GT_MetaTileEntity_NaquadahReactor extends GT_MetaTileEntity_BasicGe
@Override
public boolean isOutputFacing(byte aSide) {
- return (aSide > 1)
- && (aSide != getBaseMetaTileEntity().getFrontFacing())
+ return (aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing())
&& (aSide != getBaseMetaTileEntity().getBackFacing());
}
@@ -91,133 +90,79 @@ 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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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 4e0b428fa4..6fbdf73189 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
@@ -35,90 +35,59 @@ 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]
- };
+ return new ITexture[] { super.getFront(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS),
+ OVERLAYS_ENERGY_OUT[mTier] };
}
@Override
public ITexture[] getBack(byte aColor) {
- return new ITexture[] {super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[] { super.getBack(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS) };
}
@Override
public ITexture[] getBottom(byte aColor) {
- return new ITexture[] {super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[] { super.getBottom(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS) };
}
@Override
public ITexture[] getTop(byte aColor) {
- return new ITexture[] {super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[] { super.getTop(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS) };
}
@Override
public ITexture[] getSides(byte aColor) {
- return new ITexture[] {super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS)};
+ return new ITexture[] { super.getSides(aColor)[0], TextureFactory.of(MACHINE_CASING_FUSION_GLASS) };
}
@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]
- };
+ 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] };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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()
- };
+ 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() };
}
@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 bec1b90ad1..bf0e913ce7 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
@@ -2,6 +2,8 @@ package gregtech.common.tileentities.generators;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.interfaces.ITexture;
@@ -11,15 +13,18 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicGenera
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGenerator {
public int mEfficiency;
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"
- });
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ new String[] { "Converts Steam into EU", "Base rate: 2L of Steam -> 1 EU" });
onConfigLoad();
}
@@ -65,8 +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
@@ -87,134 +92,84 @@ 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]
- };
+ 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] };
}
@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())
- };
+ return new ITexture[] { super.getBack(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getBottom(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getTop(aColor)[0],
+ 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())
- };
+ return new ITexture[] { super.getSides(aColor)[0],
+ 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]
- };
+ 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] };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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())
- };
+ 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()) };
}
@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 b3da47ae89..4a5cb72be9 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
@@ -9,8 +9,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
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) {
+
+ public GT_MetaTileEntity_BasicHull_Bronze(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
@@ -18,8 +19,8 @@ public class GT_MetaTileEntity_BasicHull_Bronze extends GT_MetaTileEntity_BasicH
super(aName, aTier, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull_Bronze(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_Bronze(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -32,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 0589f8f236..85e3218f9e 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
@@ -9,44 +9,43 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
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) {
+
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
- public GT_MetaTileEntity_BasicHull_BronzeBricks(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull_BronzeBricks(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_BronzeBricks(String aName, int aTier, String[] aDescription,
+ 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 d8d8cfed63..2ec1d32e36 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
@@ -9,8 +9,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
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) {
+
+ public GT_MetaTileEntity_BasicHull_Steel(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
@@ -31,17 +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 2a0827e278..e31e793f03 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
@@ -9,43 +9,43 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_N
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) {
+
+ public GT_MetaTileEntity_BasicHull_SteelBricks(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
- public GT_MetaTileEntity_BasicHull_SteelBricks(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
- public GT_MetaTileEntity_BasicHull_SteelBricks(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_BasicHull_SteelBricks(String aName, int aTier, String[] aDescription,
+ 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 f8bc564ab4..cac1ef936e 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
@@ -3,6 +3,12 @@ package gregtech.common.tileentities.machines;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH_ACTIVE;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.implementations.IPowerChannelState;
@@ -17,11 +23,13 @@ import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
import appeng.util.item.AEItemStack;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotGroup;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import cpw.mods.fml.common.Optional;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
@@ -36,15 +44,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.modularui.widget.AESlotWidget;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.util.ForgeDirection;
@Optional.Interface(iface = "appeng.api.implementations.IPowerChannelState", modid = "appliedenergistics2")
public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch_InputBus
implements IConfigurationCircuitSupport, IAddGregtechLogo, IAddUIWidgets, IPowerChannelState {
+
private static final int SLOT_COUNT = 16;
private BaseActionSource requestSource = null;
private AENetworkProxy gridProxy = null;
@@ -53,14 +57,19 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
private boolean processingRecipe = false;
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"
- });
+ 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" });
disableSort = true;
}
- public GT_MetaTileEntity_Hatch_InputBus_ME(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_Hatch_InputBus_ME(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, SLOT_COUNT * 2 + 1, aDescription, aTextures);
disableSort = true;
}
@@ -72,12 +81,12 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_INPUT_HATCH_ACTIVE)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_INPUT_HATCH_ACTIVE) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_INPUT_HATCH)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_INPUT_HATCH) };
}
@Override
@@ -98,12 +107,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()));
+ if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner(
+ getBaseMetaTileEntity().getWorld()
+ .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName()));
}
}
return this.gridProxy;
@@ -165,12 +176,10 @@ 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[] {};
}
@@ -238,8 +247,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
this.setInventorySlotContents(aIndex + SLOT_COUNT, null);
return null;
}
- } catch (final GridAccessException ignored) {
- }
+ } catch (final GridAccessException ignored) {}
return null;
} else {
// AE available but no items requested
@@ -279,12 +287,12 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
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);
+ proxy.getEnergy().extractAEPower(
+ request.getStackSize(),
+ Actionable.MODULATE,
+ PowerMultiplier.CONFIG);
setInventorySlotContents(i + SLOT_COUNT, oldStack);
- } catch (final GridAccessException ignored) {
- }
+ } catch (final GridAccessException ignored) {}
}
savedStackSizes[i] = 0;
shadowInventory[i] = null;
@@ -312,8 +320,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
ItemStack s = (result != null) ? result.getItemStack() : null;
setInventorySlotContents(aIndex + SLOT_COUNT, s);
return s;
- } catch (final GridAccessException ignored) {
- }
+ } catch (final GridAccessException ignored) {}
}
}
return null;
@@ -327,12 +334,11 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
final SlotWidget[] aeSlotWidgets = new SlotWidget[16];
- builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4)
- .startFromSlot(0)
- .endAtSlot(15)
- .phantom(true)
+ 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) return;
@@ -345,9 +351,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
}
if (getBaseMetaTileEntity().isServerSide()) {
final ItemStack newInfo = updateInformationSlot(aSlotIndex, cursorStack);
- aeSlotWidgets[getMcSlot().getSlotIndex()]
- .getMcSlot()
- .putStack(newInfo);
+ aeSlotWidgets[getMcSlot().getSlotIndex()].getMcSlot().putStack(newInfo);
}
}
@@ -357,29 +361,22 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
}
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));
+ }).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));
}
@Override
public void addGregTechLogo(ModularWindow.Builder builder) {
- builder.widget(new DrawableWidget()
- .setDrawable(getGUITextureSet().getGregTechLogo())
- .setSize(17, 17)
- .setPos(80, 63));
+ builder.widget(
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(80, 63));
}
}
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 e52ff2796b..6099473660 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
@@ -3,6 +3,18 @@ package gregtech.common.tileentities.machines;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_HATCH_ACTIVE;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+
import appeng.api.AEApi;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.networking.GridFlags;
@@ -30,24 +42,14 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
@Optional.Interface(iface = "appeng.api.implementations.IPowerChannelState", modid = "appliedenergistics2")
public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatch_OutputBus
implements IPowerChannelState {
+
private BaseActionSource requestSource = null;
private AENetworkProxy gridProxy = null;
- IItemList<IAEItemStack> itemCache =
- GregTech_API.mAE2 ? AEApi.instance().storage().createItemList() : null;
+ IItemList<IAEItemStack> itemCache = GregTech_API.mAE2 ? AEApi.instance().storage().createItemList() : null;
long lastOutputTick = 0;
long tickCounter = 0;
boolean lastOutputFailed = false;
@@ -59,14 +61,12 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
aName,
aNameRegional,
1,
- new String[] {
- "Item Output for Multiblocks", "Stores directly into ME",
- },
+ 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) {
+ public GT_MetaTileEntity_Hatch_OutputBus_ME(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 0, aDescription, aTextures);
}
@@ -77,12 +77,12 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH_ACTIVE)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH_ACTIVE) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_HATCH) };
}
@Override
@@ -101,7 +101,7 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
/**
* Attempt to store items in connected ME network. Returns how many items did not fit (if the network was down e.g.)
*
- * @param stack input stack
+ * @param stack input stack
* @return amount of items left over
*/
@Optional.Method(modid = "appliedenergistics2")
@@ -132,8 +132,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).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
@@ -142,12 +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()));
+ if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner(
+ getBaseMetaTileEntity().getWorld()
+ .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName()));
}
}
return this.gridProxy;
@@ -243,8 +245,8 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
continue;
}
NBTTagCompound tagItemStack = tag.getCompoundTag("itemStack");
- final IAEItemStack s =
- AEApi.instance().storage().createItemStack(GT_Utility.loadItem(tagItemStack));
+ final IAEItemStack s = AEApi.instance().storage()
+ .createItemStack(GT_Utility.loadItem(tagItemStack));
if (s != null) {
s.setStackSize(tag.getLong("size"));
itemCache.add(s);
@@ -271,11 +273,9 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
public String[] getInfoData() {
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);
+ ss.add(
+ "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 {
@@ -283,8 +283,11 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
ss.add(String.format("The bus contains %d cached stacks: ", itemCache.size()));
int counter = 0;
for (IAEItemStack s : itemCache) {
- ss.add(s.getItem().getItemStackDisplayName(s.getItemStack()) + ": " + EnumChatFormatting.GOLD
- + nc.toWideReadableForm(s.getStackSize()) + EnumChatFormatting.RESET);
+ ss.add(
+ 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 6fbcbe4681..e60dec5c51 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
@@ -3,6 +3,18 @@ package gregtech.common.tileentities.machines;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_FLUID_HATCH;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_FLUID_HATCH_ACTIVE;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
@@ -35,23 +47,13 @@ import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
@Optional.Interface(iface = "appeng.api.implementations.IPowerChannelState", modid = "appliedenergistics2")
public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_Output implements IPowerChannelState {
+
private BaseActionSource requestSource = null;
private AENetworkProxy gridProxy = null;
- IItemList<IAEFluidStack> fluidCache =
- GregTech_API.mAE2 ? AEApi.instance().storage().createFluidList() : null;
+ IItemList<IAEFluidStack> fluidCache = GregTech_API.mAE2 ? AEApi.instance().storage().createFluidList() : null;
long lastOutputTick = 0;
long tickCounter = 0;
boolean lastOutputFailed = false;
@@ -63,9 +65,7 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
aName,
aNameRegional,
1,
- new String[] {
- "Fluid Output for Multiblocks", "Stores directly into ME",
- },
+ new String[] { "Fluid Output for Multiblocks", "Stores directly into ME", },
0);
}
@@ -80,12 +80,12 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_FLUID_HATCH)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_FLUID_HATCH) };
}
@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_ME_FLUID_HATCH_ACTIVE)};
+ return new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_ME_FLUID_HATCH_ACTIVE) };
}
@Override
@@ -108,7 +108,7 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
/**
* Attempt to store fluid in connected ME network. Returns how much fluid is accepted (if the network was down e.g.)
*
- * @param aFluid input fluid
+ * @param aFluid input fluid
* @return amount of fluid filled
*/
@Optional.Method(modid = "appliedenergistics2")
@@ -154,7 +154,8 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
if (!getBaseMetaTileEntity().getCoverInfoAtSide(aSide).isGUIClickable()) return;
infiniteCache = !infiniteCache;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.hatch.infiniteCacheFluid." + infiniteCache));
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.hatch.infiniteCacheFluid." + infiniteCache));
}
@Override
@@ -163,12 +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()));
+ if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner(
+ getBaseMetaTileEntity().getWorld()
+ .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName()));
}
}
return this.gridProxy;
@@ -254,8 +257,8 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
for (int i = 0; i < l.tagCount(); ++i) {
NBTTagCompound tag = l.getCompoundTagAt(i);
NBTTagCompound tagFluidStack = tag.getCompoundTag("fluidStack");
- final IAEFluidStack s =
- AEApi.instance().storage().createFluidStack(GT_Utility.loadFluid(tagFluidStack));
+ final IAEFluidStack s = AEApi.instance().storage()
+ .createFluidStack(GT_Utility.loadFluid(tagFluidStack));
if (s != null) {
s.setStackSize(tag.getLong("size"));
fluidCache.add(s);
@@ -282,11 +285,9 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
public String[] getInfoData() {
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);
+ ss.add(
+ "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 {
@@ -294,8 +295,12 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
ss.add(String.format("The hatch contains %d cached fluids: ", fluidCache.size()));
int counter = 0;
for (IAEFluidStack s : fluidCache) {
- ss.add(s.getFluidStack().getLocalizedName() + ": " + EnumChatFormatting.GOLD
- + nc.toWideReadableForm(s.getStackSize()) + " mB" + EnumChatFormatting.RESET);
+ ss.add(
+ s.getFluidStack().getLocalizedName() + ": "
+ + EnumChatFormatting.GOLD
+ + nc.toWideReadableForm(s.getStackSize())
+ + " mB"
+ + EnumChatFormatting.RESET);
if (++counter > 100) break;
}
}
@@ -303,11 +308,8 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
}
@Optional.Method(modid = "appliedenergistics2")
- public static IAEFluidStack fluidAEInsert(
- final IEnergySource energy,
- final IMEInventory<IAEFluidStack> cell,
- final IAEFluidStack input,
- final BaseActionSource src) {
+ public static IAEFluidStack fluidAEInsert(final IEnergySource energy, final IMEInventory<IAEFluidStack> cell,
+ 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 ee2ddcdfed..34589d2c1c 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
@@ -3,6 +3,21 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraft.world.chunk.Chunk;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -17,29 +32,17 @@ import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import ic2.core.Ic2Items;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkCoordIntPair;
-import net.minecraft.world.chunk.Chunk;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_BasicMachine {
+
boolean ready = false;
int radius;
int step;
int cX;
int cZ;
- public GT_MetaTileEntity_AdvSeismicProspector(
- int aID, String aName, String aNameRegional, int aTier, int aRadius, int aStep) {
+ public GT_MetaTileEntity_AdvSeismicProspector(int aID, String aName, String aNameRegional, int aTier, int aRadius,
+ int aStep) {
super(
aID,
aName,
@@ -53,76 +56,43 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba
"", // NEI name
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ TextureFactory.builder().addIcon(OVERLAY_BOTTOM_ROCK_BREAKER_GLOW).glow().build()));
radius = aRadius;
step = aStep;
}
@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"
- };
+ 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" };
}
- protected GT_MetaTileEntity_AdvSeismicProspector(
- String aName,
- int aTier,
- String[] aDescription,
- ITexture[][][] aTextures,
- String aGUIName,
- String aNEIName,
- int aRadius,
- int aStep) {
+ protected GT_MetaTileEntity_AdvSeismicProspector(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures, String aGUIName, String aNEIName, int aRadius, int aStep) {
super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
radius = aRadius;
step = aStep;
@@ -146,42 +116,40 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba
if (aBaseMetaTileEntity.isServerSide()) {
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))) {
+ 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))) {
this.ready = true;
this.mMaxProgresstime = (aPlayer.capabilities.isCreativeMode ? 20 : 800);
- } else if (ready
- && mMaxProgresstime == 0
+ } 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);
- }
+ 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;
@@ -205,10 +173,9 @@ 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);
+ Chunk tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(
+ xChunk + i + x * oilfieldSize,
+ zChunk + j + z * oilfieldSize);
FluidStack tFluid = undergroundOilReadInformation(tChunk);
if (tFluid != null) {
if (tFluid.amount > max) max = tFluid.amount;
@@ -220,12 +187,10 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba
}
}
- aOils.add(++oilFieldCount + "," + min + "-" + max + ","
- + tFluids.get(cInts).getLocalizedName());
+ aOils.add(++oilFieldCount + "," + min + "-" + max + "," + tFluids.get(cInts).getLocalizedName());
}
}
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
private void prospectOres(Map<String, Integer> aOres) {
@@ -264,10 +229,11 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba
if (tBlock instanceof GT_Block_Ores_Abstract) {
TileEntity tTileEntity = getBaseMetaTileEntity().getWorld().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];
+ 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];
if ((tMaterial != null) && (tMaterial != Materials._NULL)) return tMaterial.mDefaultLocalName;
}
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 e718fe0a2d..f94b8404fa 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
@@ -2,6 +2,8 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,9 +13,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine {
+
ItemStack aInputCache;
ItemStack aOutputCache;
int aTypeCache = 0;
@@ -32,73 +34,49 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_BOXINATOR_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_BOXINATOR_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_Boxinator(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Boxinator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -107,11 +85,11 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
}
private boolean hasValidCache(ItemStack mItem, int mType, boolean mClearOnFailure) {
- if (aInputCache != null
- && aOutputCache != null
+ if (aInputCache != null && aOutputCache != null
&& aTypeCache == mType
&& aInputCache.isItemEqual(mItem)
- && ItemStack.areItemStackTagsEqual(mItem, aInputCache)) return true;
+ && ItemStack.areItemStackTagsEqual(mItem, aInputCache))
+ return true;
// clear cache if it was invalid
if (mClearOnFailure) {
aInputCache = null;
@@ -135,8 +113,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))
+ if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1))
&& (GT_Utility.getContainerItem(tSlot0, true) == null)) {
if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) {
boolean tIsCached = hasValidCache(tSlot0, 1, true);
@@ -156,8 +133,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()
+ this.mOutputItems[0] = tIsCached ? aOutputCache.copy()
: GT_ModHandler.getRecipeOutput(tSlot0, tSlot0, null, tSlot0, tSlot0);
if (this.mOutputItems[0] != null) {
if (canOutput(this.mOutputItems[0])) {
@@ -174,10 +150,17 @@ 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()
+ this.mOutputItems[0] = tIsCached ? aOutputCache.copy()
: GT_ModHandler.getRecipeOutput(
- tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0);
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0,
+ tSlot0);
if (this.mOutputItems[0] != null) {
if (canOutput(this.mOutputItems[0])) {
getInputAt(0).stackSize -= 9;
@@ -196,24 +179,22 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ 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))
+ if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.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)
@@ -222,10 +203,8 @@ public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine
&& 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 f6223a4a0d..28caaef181 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
@@ -13,18 +13,18 @@ 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) {
+ public GT_MetaTileEntity_Charger(int aID, String aName, String aNameRegional, int aTier, String aDescription,
+ int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
}
- public GT_MetaTileEntity_Charger(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ public GT_MetaTileEntity_Charger(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ int aSlotCount) {
super(aName, aTier, aDescription, aTextures, aSlotCount);
}
- public GT_MetaTileEntity_Charger(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ public GT_MetaTileEntity_Charger(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ int aSlotCount) {
super(aName, aTier, aDescription, aTextures, aSlotCount);
}
@@ -65,18 +65,17 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf
if (mMetaTileEntity.dechargerSlotCount() > 0
&& 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.increaseStoredEnergyUnits(
GT_ModHandler.dischargeElectricItem(
mMetaTileEntity.mInventory[i],
- GT_Utility.safeInt(Math.min(
- V[mTier] * 15,
- mBaseMetaTileEntity.getEUCapacity()
- - mBaseMetaTileEntity.getStoredEU())),
+ GT_Utility.safeInt(
+ Math.min(
+ V[mTier] * 15,
+ mBaseMetaTileEntity.getEUCapacity()
+ - mBaseMetaTileEntity.getStoredEU())),
(int) Math.min(Integer.MAX_VALUE, mMetaTileEntity.getInputTier()),
true,
false,
@@ -88,9 +87,7 @@ public class GT_MetaTileEntity_Charger extends GT_MetaTileEntity_BasicBatteryBuf
}
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(
GT_ModHandler.chargeElectricItem(
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 3dc9fd7b63..2cab223249 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
@@ -1,7 +1,12 @@
package gregtech.common.tileentities.machines.basic;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
@@ -11,9 +16,6 @@ import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.render.TextureFactory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine implements IAddUIWidgets {
@@ -29,43 +31,43 @@ public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine
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_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_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_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) {
+ public GT_MetaTileEntity_CuringOven(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_CuringOven(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return (super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack))
&& ItemList.Cell_Empty.isStackEqual(aStack);
}
@@ -78,36 +80,34 @@ public class GT_MetaTileEntity_CuringOven extends GT_MetaTileEntity_BasicMachine
@Override
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;
+ 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;
+ }
}
}
- }
- 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_Disassembler.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
index ff46aada64..bc6f50fde6 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Disassembler.java
@@ -3,7 +3,19 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.MOD_ID_RC;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
import com.google.common.collect.ArrayListMultimap;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -25,15 +37,6 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.extensions.ArrayExt;
import ic2.api.item.IC2Items;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.oredict.OreDictionary;
public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachine {
@@ -45,9 +48,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
aTier,
1,
new String[] {
- "Disassembles Machines up to " + GT_Values.TIER_COLORS[aTier] + GT_Values.VOLTAGE_NAMES[aTier],
- "Can also disassemble most assembler recipes!"
- },
+ "Disassembles Machines up to " + GT_Values.TIER_COLORS[aTier] + GT_Values.VOLTAGE_NAMES[aTier],
+ "Can also disassemble most assembler recipes!" },
1,
9,
"Disassembler.png",
@@ -56,101 +58,65 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
// Textures
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_ACTIVE_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_DISASSEMBLER),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_DISASSEMBLER_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_SIDE_DISASSEMBLER_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_ACTIVE_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_FRONT_DISASSEMBLER),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_DISASSEMBLER_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_DISASSEMBLER_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_TOP_DISASSEMBLER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_ACTIVE_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_TOP_DISASSEMBLER),
- TextureFactory.builder()
- .addIcon(OVERLAY_TOP_DISASSEMBLER_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_TOP_DISASSEMBLER_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE_GLOW)
- .glow()
- .build()),
+ TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_ACTIVE_GLOW).glow().build()),
TextureFactory.of(
TextureFactory.of(OVERLAY_BOTTOM_DISASSEMBLER),
- TextureFactory.builder()
- .addIcon(OVERLAY_BOTTOM_DISASSEMBLER_GLOW)
- .glow()
- .build()));
+ TextureFactory.builder().addIcon(OVERLAY_BOTTOM_DISASSEMBLER_GLOW).glow().build()));
}
- public GT_MetaTileEntity_Disassembler(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ public GT_MetaTileEntity_Disassembler(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
}
- public GT_MetaTileEntity_Disassembler(
- String aName,
- int aTier,
- String[] aDescription,
- ITexture[][][] aTextures,
- String aGUIName,
- String aNEIName) {
+ public GT_MetaTileEntity_Disassembler(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 1, 9, aGUIName, aNEIName);
}
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Disassembler(
- this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName);
+ this.mName,
+ this.mTier,
+ this.mDescriptionArray,
+ this.mTextures,
+ this.mGUIName,
+ this.mNEIName);
}
- private static final ItemStack[][] alwaysReplace = {
- {
+ private static final ItemStack[][] alwaysReplace = { {
// ItemStack to look for
- new ItemStack(Blocks.trapped_chest, 1, OreDictionary.WILDCARD_VALUE)
- },
- {
- // ItemStack to replace
- new ItemStack(Blocks.chest)
- }
- };
+ new ItemStack(Blocks.trapped_chest, 1, OreDictionary.WILDCARD_VALUE) },
+ {
+ // ItemStack to replace
+ new ItemStack(Blocks.chest) } };
- private static final Object[][] OreDictionaryOverride = {
- {
+ private static final Object[][] OreDictionaryOverride = { {
// String to look for
- "plankWood", "stoneCobble", "gemDiamond", "logWood", "stickWood", "treeSapling"
- },
- {
- // ItemStack to replace
- new ItemStack(Blocks.planks),
- new ItemStack(Blocks.cobblestone),
- new ItemStack(Items.diamond),
- new ItemStack(Blocks.log),
- new ItemStack(Items.stick),
- new ItemStack(Blocks.sapling)
- }
- };
+ "plankWood", "stoneCobble", "gemDiamond", "logWood", "stickWood", "treeSapling" },
+ {
+ // ItemStack to replace
+ new ItemStack(Blocks.planks), new ItemStack(Blocks.cobblestone), new ItemStack(Items.diamond),
+ new ItemStack(Blocks.log), new ItemStack(Items.stick), new ItemStack(Blocks.sapling) } };
public static ArrayListMultimap<GT_ItemStack, ItemStack> getOutputHardOverrides() {
return outputHardOverrides;
@@ -215,10 +181,10 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
if (GT_Utility.isStackInvalid(is)) return DID_NOT_FIND_RECIPE;
- if (is.getItem() instanceof GT_MetaGenerated_Tool
- || isCircuit(is)
+ if (is.getItem() instanceof GT_MetaGenerated_Tool || isCircuit(is)
|| blackList.stream().anyMatch(t -> GT_Utility.areStacksEqual(t.toStack(), is, true))
- || compareToUnpacker(is)) return DID_NOT_FIND_RECIPE;
+ || compareToUnpacker(is))
+ return DID_NOT_FIND_RECIPE;
Integer handleHardOverride = handleHardOverride(is);
if (handleHardOverride != null) return handleHardOverride;
@@ -270,8 +236,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
- return setOutputsAndTime(recipe.inputs, recipe.stackSize)
- ? FOUND_AND_SUCCESSFULLY_USED_RECIPE
+ return setOutputsAndTime(recipe.inputs, recipe.stackSize) ? FOUND_AND_SUCCESSFULLY_USED_RECIPE
: FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
@@ -283,8 +248,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
private int checkRecipeMap() {
- GT_Recipe gt_recipe = GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.findRecipe(
- this.getBaseMetaTileEntity(), true, this.maxEUInput(), null, this.getAllInputs());
+ GT_Recipe gt_recipe = GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes
+ .findRecipe(this.getBaseMetaTileEntity(), true, this.maxEUInput(), null, this.getAllInputs());
if (gt_recipe == null) return DID_NOT_FIND_RECIPE;
if (gt_recipe.isRecipeInputEqual(false, null, this.getAllInputs())) {
if (gt_recipe.mSpecialValue == -100) {
@@ -323,8 +288,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
ItemStack[] output = new ItemStack[inputs.length];
List<GT_Recipe> recipesColl = null;
- if (recipes.size() > 1)
- recipesColl = recipes.stream().skip(1).map(x -> x.recipe).collect(Collectors.toList());
+ if (recipes.size() > 1) recipesColl = recipes.stream().skip(1).map(x -> x.recipe).collect(Collectors.toList());
handleRecipeTransformation(inputs, output, recipesColl);
@@ -335,8 +299,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
EUt);
}
- private static void handleRecipeTransformation(
- ItemStack[] inputs, ItemStack[] output, List<? extends GT_Recipe> recipesColl) {
+ private static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output,
+ List<? extends GT_Recipe> recipesColl) {
for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++) {
Set<ItemStack[]> inputsStacks = null;
if (recipesColl != null)
@@ -349,15 +313,15 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
/**
* Public Interface for ReverseRecipes, do not call inside of this class.
*/
- public static void handleRecipeTransformation(
- ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks) {
+ public static void handleRecipeTransformation(ItemStack[] inputs, ItemStack[] output,
+ Set<ItemStack[]> inputsStacks) {
for (int i = 0, inputsLength = inputs.length; i < inputsLength; i++)
handleRecipeTransformationInternal(inputs, output, inputsStacks, i);
addOthersAndHandleAlwaysReplace(inputs, output);
}
- private static void handleRecipeTransformationInternal(
- ItemStack[] inputs, ItemStack[] output, Set<ItemStack[]> inputsStacks, int i) {
+ private static void handleRecipeTransformationInternal(ItemStack[] inputs, ItemStack[] output,
+ Set<ItemStack[]> inputsStacks, int i) {
ItemStack input = inputs[i];
ItemData data = GT_OreDictUnificator.getItemData(input);
if (data == null || data.mMaterial == null || data.mMaterial.mMaterial == null || data.mPrefix == null) {
@@ -405,9 +369,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
private static ItemStack handleWildcard(ItemStack stack) {
- if (stack != null
- && stack.getItemDamage() == OreDictionary.WILDCARD_VALUE
- && !stack.getItem().isDamageable()) {
+ if (stack != null && stack.getItemDamage() == OreDictionary.WILDCARD_VALUE && !stack.getItem().isDamageable()) {
stack.setItemDamage(0);
}
return stack;
@@ -420,8 +382,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
return stack;
}
- private static void handleReplacement(
- Set<ItemStack[]> inputsStacks, ItemData data, ItemStack[] output, ItemStack input, int i) {
+ private static void handleReplacement(Set<ItemStack[]> inputsStacks, ItemData data, ItemStack[] output,
+ ItemStack input, int i) {
AtomicReference<Materials> toRpl = new AtomicReference<>();
Materials first = data.mMaterial.mMaterial;
if (inputsStacks != null) {
@@ -440,17 +402,12 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
}
- private static void handleInputStacks(
- Set<ItemStack[]> inputsStacks,
- AtomicReference<? super Materials> toRpl,
- ItemData data,
- Materials first,
- int i) {
+ private static void handleInputStacks(Set<ItemStack[]> inputsStacks, AtomicReference<? super Materials> toRpl,
+ ItemData data, Materials first, int i) {
final int finalIndex = i;
inputsStacks.forEach(stackArray -> {
ItemData dataAgainst = GT_OreDictUnificator.getItemData(stackArray[finalIndex]);
- if (dataAgainst == null
- || dataAgainst.mMaterial == null
+ if (dataAgainst == null || dataAgainst.mMaterial == null
|| dataAgainst.mMaterial.mMaterial == null
|| dataAgainst.mPrefix == null
|| dataAgainst.mPrefix != data.mPrefix) {
@@ -473,8 +430,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
toRpl.set(Materials.Rubber);
}
- private static void handleDifferentMaterialsOnRecipes(
- Materials first, Materials second, AtomicReference<? super Materials> toRpl) {
+ private static void handleDifferentMaterialsOnRecipes(Materials first, Materials second,
+ AtomicReference<? super Materials> toRpl) {
if (!first.equals(second))
if (first.equals(Materials.Aluminium) && second.equals(Materials.Iron)) toRpl.set(second);
else if (first.equals(Materials.Steel) && second.equals(Materials.Iron)) toRpl.set(second);
@@ -488,7 +445,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
else if (first.equals(Materials.Polystyrene) && second.equals(Materials.Plastic)) toRpl.set(second);
else if (first.equals(Materials.Silicone) && second.equals(Materials.Plastic)) toRpl.set(second);
else if (first.equals(Materials.NetherQuartz)
- || first.equals(Materials.CertusQuartz) && second.equals(Materials.Quartzite)) toRpl.set(second);
+ || first.equals(Materials.CertusQuartz) && second.equals(Materials.Quartzite))
+ toRpl.set(second);
else if (first.equals(Materials.Plastic) && second.equals(Materials.Wood)) toRpl.set(second);
else if (first.equals(Materials.Diamond) && second.equals(Materials.Glass)) toRpl.set(second);
}
@@ -523,6 +481,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
static class DissassembleReference {
+
final int stackSize;
ItemStack[] inputs;
final GT_Recipe recipe;
@@ -560,9 +519,7 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
boolean isDone = GT_Utility.areStacksEqual(y, out, true) && y.stackSize <= is.stackSize;
if (isDone) stacksize.set(y.stackSize);
return isDone;
- }))
- .map(x -> new DissassembleReference(stacksize.get(), x.mInputs, x))
- .collect(Collectors.toList());
+ })).map(x -> new DissassembleReference(stacksize.get(), x.mInputs, x)).collect(Collectors.toList());
// Is there only one way to create it?
if (possibleRecipes.size() == 1) return possibleRecipes;
@@ -575,21 +532,15 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
private static double getCheaperInputs(GT_MetaTileEntity_Disassembler.DissassembleReference x) {
- double fluidInputValueRaw = Arrays.stream(x.recipe.mFluidInputs)
- .flatMapToInt(f -> IntStream.of(f.amount))
+ double fluidInputValueRaw = Arrays.stream(x.recipe.mFluidInputs).flatMapToInt(f -> IntStream.of(f.amount))
.sum();
fluidInputValueRaw = fluidInputValueRaw > 0 ? fluidInputValueRaw : 144D;
- double inputValue = Arrays.stream(x.inputs)
- .flatMapToInt(f -> IntStream.of(f.stackSize))
- .sum()
+ double inputValue = Arrays.stream(x.inputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum()
+ (fluidInputValueRaw / 144D);
- double fluidOutputValueRaw = Arrays.stream(x.recipe.mFluidOutputs)
- .flatMapToInt(f -> IntStream.of(f.amount))
+ double fluidOutputValueRaw = Arrays.stream(x.recipe.mFluidOutputs).flatMapToInt(f -> IntStream.of(f.amount))
.sum();
fluidOutputValueRaw = fluidOutputValueRaw > 0 ? fluidOutputValueRaw : 144D;
- double outputValue = Arrays.stream(x.recipe.mOutputs)
- .flatMapToInt(f -> IntStream.of(f.stackSize))
- .sum()
+ double outputValue = Arrays.stream(x.recipe.mOutputs).flatMapToInt(f -> IntStream.of(f.stackSize)).sum()
+ (fluidOutputValueRaw / 144D);
return outputValue / inputValue;
}
@@ -599,8 +550,8 @@ public class GT_MetaTileEntity_Disassembler extends GT_MetaTileEntity_BasicMachi
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& aStack.getTagCompound() != null
&& aStack.getTagCompound().getCompoundTag("GT.CraftingComponents") != 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 516d2dda66..a75876b82d 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
@@ -8,6 +8,27 @@ import static gregtech.api.metatileentity.BaseTileEntity.STALLED_STUTTERING_TOOL
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import static gregtech.api.util.GT_Utility.moveMultipleItemStacks;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+
import com.google.common.collect.ImmutableSet;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable;
@@ -27,6 +48,7 @@ import com.gtnewhorizons.modularui.common.widget.SlotGroup;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
import com.mojang.authlib.GameProfile;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.*;
@@ -52,25 +74,6 @@ import gregtech.api.util.GT_ApiaryModifier;
import gregtech.api.util.GT_ApiaryUpgrade;
import gregtech.api.util.GT_Utility;
import gregtech.common.GT_Client;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.*;
-import java.util.stream.Collectors;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.ChunkCoordinates;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.util.Vec3;
-import net.minecraft.world.World;
-import net.minecraft.world.biome.BiomeGenBase;
public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicMachine
implements IBeeHousing, IBeeHousingInventory, IErrorLogic, IBeeModifier, IBeeListener, IAddUIWidgets {
@@ -97,80 +100,56 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
aNameRegional,
aTier,
4,
- new String[] {"BEES GOES BRRRR", EnumChatFormatting.GRAY + AuthorKuba},
+ 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.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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_IndustrialApiary(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -252,13 +231,13 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
final HashMap<GT_Utility.ItemId, ItemStack> pollen = new HashMap<>();
if (isRetrievingPollen && floweringMod > 0f) {
- final int icycles =
- (int) cycles + (getWorld().rand.nextFloat() < (cycles - (float) ((int) cycles)) ? 1 : 0);
+ final int icycles = (int) cycles
+ + (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());
+ final ItemStack s = p.getGenome().getSpeciesRoot()
+ .getMemberStack(p, EnumGermlingType.POLLEN.ordinal());
if (s != null) {
final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(s);
pollen.computeIfAbsent(id, k -> {
@@ -285,19 +264,16 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
final HashMap<GT_Utility.ItemId, Float> drops = new HashMap<>();
final HashMap<GT_Utility.ItemId, ItemStack> dropstacks = new HashMap<>();
- for (Map.Entry<ItemStack, Float> entry :
- primary.getProductChances().entrySet()) {
+ for (Map.Entry<ItemStack, Float> entry : primary.getProductChances().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
+ 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()) {
+ for (Map.Entry<ItemStack, Float> entry : secondary.getProductChances().entrySet()) {
final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey());
drops.merge(
id,
@@ -308,8 +284,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
dropstacks.computeIfAbsent(id, k -> entry.getKey());
}
if (primary.isJubilant(genome, this) && secondary.isJubilant(genome, this))
- for (Map.Entry<ItemStack, Float> entry :
- primary.getSpecialtyChances().entrySet()) {
+ for (Map.Entry<ItemStack, Float> entry : primary.getSpecialtyChances().entrySet()) {
final GT_Utility.ItemId id = GT_Utility.ItemId.createNoCopy(entry.getKey());
drops.merge(
id,
@@ -361,24 +336,20 @@ 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();
s.stackSize = entry.getValue().intValue()
- + (getWorld().rand.nextFloat()
- < (entry.getValue()
- - (float) entry.getValue().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;
- break;
- } else this.mOutputItems[i++] = s.splitStack(s.getMaxStackSize());
- if (i >= imax) break;
- }
+ if (s.stackSize > 0 && i < imax) while (true) {
+ if (s.stackSize <= s.getMaxStackSize()) {
+ this.mOutputItems[i++] = s;
+ break;
+ } else this.mOutputItems[i++] = s.splitStack(s.getMaxStackSize());
+ if (i >= imax) break;
+ }
}
- for (ItemStack s : pollen.values())
- if (i < imax) this.mOutputItems[i++] = s;
- else break;
+ for (ItemStack s : pollen.values()) if (i < imax) this.mOutputItems[i++] = s;
+ else break;
// Overclock
@@ -475,15 +446,13 @@ 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));
+ effectData[0] = ((IAlleleBeeAcceleratableEffect) effect).doEffectAccelerated(
+ genome,
+ effectData[0],
+ this,
+ usedBeeLife / (effect instanceof AlleleEffectThrottled
+ ? (float) AlleleBeeEffectThrottledField.getInt(effect)
+ : 1f));
}
if (!effect.isCombinable()) return;
@@ -493,15 +462,13 @@ 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));
+ effectData[1] = ((IAlleleBeeAcceleratableEffect) secondary).doEffectAccelerated(
+ genome,
+ effectData[0],
+ this,
+ usedBeeLife / (secondary instanceof AlleleEffectThrottled
+ ? (float) AlleleBeeEffectThrottledField.getInt(secondary)
+ : 1f));
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -512,9 +479,10 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isClientSide()) {
if (GT_Client.changeDetected == 4) {
- /* Client tick counter that is set to 5 on hiding pipes and covers.
- * It triggers a texture update next client tick when reaching 4, with provision for 3 more update tasks,
- * spreading client change detection related work and network traffic on different ticks, until it reaches 0.
+ /*
+ * Client tick counter that is set to 5 on hiding pipes and covers. It triggers a texture update next
+ * client tick when reaching 4, with provision for 3 more update tasks, spreading client change
+ * detection related work and network traffic on different ticks, until it reaches 0.
*/
aBaseMetaTileEntity.issueTextureUpdate();
}
@@ -537,8 +505,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
if (!aBaseMetaTileEntity.isActive()) {
if (aBaseMetaTileEntity.isAllowedToWork()
- && (aBaseMetaTileEntity.hasInventoryBeenModified()
- || aTick % 600 == 0
+ && (aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0
|| aBaseMetaTileEntity.hasWorkJustBeenEnabled())
&& hasEnoughEnergyToCheckRecipe()) {
final int check = checkRecipe();
@@ -572,13 +539,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
if (usedQueen != null) {
if (usedQueenBee == null) usedQueenBee = beeRoot.getMember(usedQueen);
doEffect();
- if (!retrievingPollenInThisOperation
- && floweringMod > 0f
+ if (!retrievingPollenInThisOperation && floweringMod > 0f
&& 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;
+ if (retrievedpollen != null && (usedQueenBee.pollinateRandom(this, retrievedpollen)
+ || this.mProgresstime % (pollinationDelay * 5) == 0))
+ retrievedpollen = null;
}
}
@@ -593,21 +559,20 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
if (usedQueenBee != null) doAcceleratedEffects();
updateModifiers();
for (int i = 0; i < mOutputItems.length; i++)
- 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())) {
- 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 (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())) {
+ 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])) break;
- }
+ if (aBaseMetaTileEntity
+ .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
+ break;
+ }
Arrays.fill(mOutputItems, null);
mEUt = 0;
mProgresstime = 0;
@@ -616,8 +581,8 @@ 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;
@@ -644,8 +609,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
}
public void cancelProcess() {
- if (this.getBaseMetaTileEntity().isActive()
- && this.getBaseMetaTileEntity().isServerSide()
+ if (this.getBaseMetaTileEntity().isActive() && this.getBaseMetaTileEntity().isServerSide()
&& usedQueen != null
&& beeRoot.isMember(usedQueen, EnumBeeType.QUEEN.ordinal())) {
Arrays.fill(mOutputItems, null);
@@ -663,9 +627,8 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
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());
+ if (aIndex == queen) return beeRoot.isMember(aStack, EnumBeeType.QUEEN.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;
@@ -741,10 +704,9 @@ 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());
+ if (owner == null) owner = new GameProfile(
+ this.getBaseMetaTileEntity().getOwnerUuid(),
+ this.getBaseMetaTileEntity().getOwnerName());
return owner;
}
@@ -868,12 +830,16 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
|| getWorld().getBlockMetadata(flowercoords.posX, flowercoords.posY, flowercoords.posZ)
!= flowerBlockMeta)
if (!FlowerManager.flowerRegistry.isAcceptedFlower(
- flowerType, getWorld(), flowercoords.posX, flowercoords.posY, flowercoords.posZ))
+ 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) {
@@ -1044,6 +1010,7 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
// endregion
static final IBeekeepingLogic dummylogic = new IBeekeepingLogic() {
+
@Override
public boolean canWork() {
return true;
@@ -1093,103 +1060,86 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- builder.widget(new SlotWidget(new ApiarySlot(inventoryHandler, queen))
+ 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));
+ .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()
+ 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()
+ 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(
+ 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())))
@@ -1201,18 +1151,12 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
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));
+ .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
@@ -1233,37 +1177,31 @@ public class GT_MetaTileEntity_IndustrialApiary extends GT_MetaTileEntity_BasicM
@Override
protected SlotWidget createChargerSlot(int x, int y, String tooltipKey, Object[] tooltipArgs) {
- return (SlotWidget)
- super.createChargerSlot(x, y, tooltipKey, tooltipArgs).setPos(79, 62);
+ return (SlotWidget) super.createChargerSlot(x, y, tooltipKey, tooltipArgs).setPos(79, 62);
}
@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());
+ 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());
}
@Override
protected List<String> getErrorDescriptions() {
if (!mErrorStates.isEmpty()) {
- return mErrorStates.stream()
- .map(state ->
- EnumChatFormatting.RED + StatCollector.translateToLocal("for." + state.getDescription()))
+ return mErrorStates.stream().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();
}
@@ -1306,8 +1244,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 {
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 b68d3bc436..d1c03e1527 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
@@ -3,6 +3,10 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.Arrays;
+
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -17,10 +21,9 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.power.BasicMachineEUPower;
import gregtech.common.power.Power;
-import java.util.Arrays;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMachine {
+
public static int sUUAperUUM = 1;
public static int sUUASpeedBonus = 4;
public static int sDurationMultiplier = 3215;
@@ -41,68 +44,39 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_MASSFAB_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_MASSFAB_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Massfabricator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
EUt = V[1] * (long) Math.pow(2, mTier + 2);
}
@@ -110,7 +84,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
@@ -126,8 +105,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);
@@ -159,11 +138,10 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac
tFluid.amount -= sUUAperUUM;
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;
+ 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;
}
return DID_NOT_FIND_RECIPE;
}
@@ -188,6 +166,7 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac
}
protected class MassfabricatorPower extends BasicMachineEUPower {
+
protected MassfabricatorPower(byte tier, int amperage) {
super(tier, amperage);
}
@@ -204,7 +183,7 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac
recipeEuPerTick = Integer.MAX_VALUE - 1;
recipeDuration = Integer.MAX_VALUE - 1;
} else {
- recipeEuPerTick = (int) (V[1] << 2); // 2^2=4 so shift <<2
+ recipeEuPerTick = (int) (V[1] << 2); // 2^2=4 so shift <<2
recipeDuration = (int) xMaxProgresstime;
}
} else {
@@ -218,9 +197,8 @@ public class GT_MetaTileEntity_Massfabricator extends GT_MetaTileEntity_BasicMac
while (tempEUt <= V[mTier - 1]) {
tempEUt <<= 2; // this actually controls overclocking
recipeDuration >>= 1; // this is effect of overclocking
- if (recipeDuration == 0)
- xEUt = (long) (xEUt
- / 1.1D); // U know, if the time is less than 1 tick make the machine use less power
+ if (recipeDuration == 0) xEUt = (long) (xEUt / 1.1D); // U know, if the time is less than 1 tick
+ // make the machine use less power
}
if (xEUt > Integer.MAX_VALUE - 1) {
recipeEuPerTick = Integer.MAX_VALUE - 1;
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 14a213b156..32a0ad8537 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
@@ -7,6 +7,16 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW;
+import java.util.function.Consumer;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
@@ -14,6 +24,7 @@ import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Materials;
@@ -31,14 +42,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
-import java.util.function.Consumer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.world.World;
-import net.minecraftforge.common.DimensionManager;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEntity_BasicTank
implements IAddGregtechLogo, IAddUIWidgets {
@@ -60,21 +63,23 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt
public TileEntity tTile = null;
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"
- });
- }
-
- public GT_MetaTileEntity_MicrowaveEnergyTransmitter(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(
+ 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) {
super(aName, aTier, 3, aDescription, aTextures);
}
- public GT_MetaTileEntity_MicrowaveEnergyTransmitter(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_MicrowaveEnergyTransmitter(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
}
@@ -89,51 +94,36 @@ 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)
- };
- }
-
- @Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- 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],
+ 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) };
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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_ACTIVE_GLOW).glow().build() };
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER),
+ TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build() };
}
@Override
@@ -158,8 +148,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);
@@ -193,19 +183,13 @@ 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));
+ return this.mDebug || (sInterDimensionalTeleportAllowed && (this.hasBlock
+ || 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));
+ return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD)
+ && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId));
}
@Override
@@ -218,8 +202,7 @@ public class GT_MetaTileEntity_MicrowaveEnergyTransmitter extends GT_MetaTileEnt
if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
this.hasBlock = checkForBlock();
}
- if ((getBaseMetaTileEntity().isAllowedToWork())
- && (getBaseMetaTileEntity().getRedstone())) {
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
if (getBaseMetaTileEntity().getStoredEU() > (V[mTier] * 16)) {
if (mPassiveEnergyUse) {
getBaseMetaTileEntity().decreaseStoredEnergyUnits(2L << (mTier - 1), false);
@@ -258,8 +241,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)) {
@@ -278,13 +261,13 @@ 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)));
+ 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)));
}
@Override
@@ -424,27 +407,26 @@ 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))
+ 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));
addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7);
@@ -453,33 +435,38 @@ 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) {
+ private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift,
+ 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) {
- 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));
+ private void addChangeNumberButton(ModularWindow.Builder builder, IDrawable overlay, Consumer<Integer> setter,
+ 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));
}
@Override
@@ -489,9 +476,7 @@ 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));
+ builder.widget(
+ 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 1c1ed70c20..7e4d5f8165 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
@@ -3,6 +3,19 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.GT_Values.debugBlockMiner;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.ChunkPosition;
+import net.minecraftforge.common.util.FakePlayer;
+
import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import com.gtnewhorizons.modularui.api.math.Pos2d;
@@ -10,6 +23,7 @@ import com.gtnewhorizons.modularui.api.math.Size;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
+
import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.ITexture;
@@ -24,24 +38,14 @@ import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.common.misc.GT_DrillingLogicDelegate;
import gregtech.common.misc.GT_IDrillingLogicDelegateOwner;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.common.util.FakePlayer;
@SuppressWarnings("ObjectEquality")
public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
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
- static final int[] ENERGY = {8, 8, 32, 128, 512}; // Miner energy consumption per tier
+
+ 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
+ static final int[] ENERGY = { 8, 8, 32, 128, 512 }; // Miner energy consumption per tier
/** Miner configured radius */
private int radiusConfig;
@@ -60,91 +64,71 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
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)
- },
+ 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(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()),
+ .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(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()),
+ .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.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()),
+ .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(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()));
+ .glow().build()));
mSpeed = SPEED[aTier];
radiusConfig = RADIUS[mTier];
}
- public GT_MetaTileEntity_Miner(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ public GT_MetaTileEntity_Miner(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Miner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName);
mSpeed = SPEED[aTier];
radiusConfig = RADIUS[mTier];
@@ -162,8 +146,8 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) //
&& aStack.getItem() == GT_DrillingLogicDelegate.MINING_PIPE_STACK.getItem();
}
@@ -241,8 +225,10 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
if (!aBaseMetaTileEntity.isUniversalEnergyStored((long) ENERGY[mTier] * (mSpeed - mProgresstime))) {
mMaxProgresstime = 0;
if (debugBlockMiner) {
- GT_Log.out.println("MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed) + " have "
- + aBaseMetaTileEntity.getUniversalEnergyStored());
+ GT_Log.out.println(
+ "MINER: Not enough energy yet, want " + (ENERGY[mTier] * mSpeed)
+ + " have "
+ + aBaseMetaTileEntity.getUniversalEnergyStored());
}
return;
}
@@ -272,13 +258,12 @@ 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));
+ isOre = GT_Utility.isOre(oreBlock, aBaseMetaTileEntity.getWorld().getBlockMetadata(x, y, z));
} // someone else might have removed the block
while (!isOre && !oreBlockPositions.isEmpty());
@@ -390,19 +375,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
@@ -415,7 +399,10 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
return mSpeed;
}
- /** @deprecated This method are obsolete, and may be removed in further updates. Please use 'this.getPipe().descent()' access! */
+ /**
+ * @deprecated This method are obsolete, and may be removed in further updates. Please use
+ * 'this.getPipe().descent()' access!
+ */
@Deprecated
public boolean moveOneDown(IGregTechTileEntity tileEntity) {
boolean descends = pipe.descent(tileEntity);
@@ -425,7 +412,10 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
return descends;
}
- /** @deprecated This method are obsolete, and may be removed in further updates. Please use 'this.getPipe().getFakePlayer(te)' access! */
+ /**
+ * @deprecated This method are obsolete, and may be removed in further updates. Please use
+ * 'this.getPipe().getFakePlayer(te)' access!
+ */
@Deprecated
protected FakePlayer getFakePlayer(IGregTechTileEntity aBaseTile) {
return pipe.getFakePlayer(aBaseTile);
@@ -441,12 +431,18 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine
}
private static final FallbackableUITexture progressBarTexture = new FallbackableUITexture(
- UITexture.fullImage("gregtech", "gui/progressbar/miner"), GT_UITextures.PROGRESSBAR_CANNER);
+ UITexture.fullImage("gregtech", "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)));
+ builder.widget(
+ 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 65f62f240a..054ca1694a 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
@@ -7,16 +7,18 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW;
+import java.util.Arrays;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_SpawnEventHandler;
-import java.util.Arrays;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_TieredMachineBlock {
@@ -29,60 +31,50 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered
aNameRegional,
aTier,
0,
- "Repels nasty Creatures. Range: " + (4 + (12 * aTier)) + " unpowered / " + (16 + (48 * aTier))
- + " powered. Costs " + (1L << (aTier * 2)) + " EU/t");
+ "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) {
+ public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GT_MetaTileEntity_MonsterRepellent(
- String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_MonsterRepellent(String aName, int aTier, int aInvSlotCount, String[] aDescription,
+ 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) {
- if (aSide != ForgeDirection.UP.ordinal()) return new ITexture[] {MACHINE_CASINGS[mTier][aColorIndex + 1]};
- if (aActive)
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1],
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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_ACTIVE_GLOW).glow().build() };
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER),
+ 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
- };
+ int[] tCoords = { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),
+ aBaseMetaTileEntity.getZCoord(), aBaseMetaTileEntity.getWorld().provider.dimensionId };
if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) {
GT_SpawnEventHandler.mobReps.add(tCoords);
}
@@ -97,23 +89,16 @@ 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
- };
+ int[] tCoords = { aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),
+ 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
- };
+ int[] tCoords = { this.getBaseMetaTileEntity().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 2a7e28f10b..f905717c5a 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
@@ -2,6 +2,11 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
@@ -12,12 +17,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachine {
+
public GT_MetaTileEntity_PotionBrewer(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
@@ -32,73 +34,49 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_POTIONBREWER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_POTIONBREWER_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_PotionBrewer(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -156,7 +134,8 @@ 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));
@@ -167,7 +146,8 @@ 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));
@@ -178,7 +158,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");
}
@@ -205,8 +186,8 @@ public class GT_MetaTileEntity_PotionBrewer extends GT_MetaTileEntity_BasicMachi
}
@Override
- public boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& getRecipeList().containsInput(aStack);
}
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 6771ba0fcc..7da1ec5e43 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
@@ -1,5 +1,9 @@
package gregtech.common.tileentities.machines.basic;
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -8,10 +12,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine {
+
public GT_MetaTileEntity_Printer(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
@@ -26,8 +29,8 @@ public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine {
GT_Recipe.GT_Recipe_Map.sPrinterRecipes.mNEIName);
}
- public GT_MetaTileEntity_Printer(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ public GT_MetaTileEntity_Printer(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ String aGUIName, String aNEIName) {
super(aName, aTier, 1, aDescription, aTextures, 2, 2, aGUIName, aNEIName);
}
@@ -35,28 +38,27 @@ public class GT_MetaTileEntity_Printer extends GT_MetaTileEntity_BasicMachine {
public int checkRecipe() {
if (getOutputAt(0) != null) {
this.mOutputBlocked += 1;
- } else if ((GT_Utility.isStackValid(getInputAt(0)))
- && (getInputAt(0).stackSize > 0)
+ } 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), (ItemStack) 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;
+ 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), (ItemStack) 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 26eed71b41..012f6e547f 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
@@ -3,22 +3,12 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.GT_Values.debugBlockPump;
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@@ -33,11 +23,24 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidHandler;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.modularui.GT_UIInfos;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+
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)));
@@ -60,17 +63,22 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
private boolean mDisallowRetract = true;
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",
- });
+ 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", });
radiusConfig = getMaxDistanceForTier(mTier);
}
@@ -93,8 +101,13 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
public void saveNBTData(NBTTagCompound aNBT) {
boolean wasPumping = this.wasPumping || !this.mPumpList.isEmpty();
if (debugBlockPump) {
- GT_Log.out.println("PUMP: NBT:Save - WasPumping - " + wasPumping + " blocks (" + this.mPrimaryPumpedBlock
- + ", " + this.mSecondaryPumpedBlock + ")");
+ GT_Log.out.println(
+ "PUMP: NBT:Save - WasPumping - " + wasPumping
+ + " blocks ("
+ + this.mPrimaryPumpedBlock
+ + ", "
+ + this.mSecondaryPumpedBlock
+ + ")");
}
super.saveNBTData(aNBT);
aNBT.setString(
@@ -102,8 +115,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mPrimaryPumpedBlock == null ? "" : Block.blockRegistry.getNameForObject(this.mPrimaryPumpedBlock));
aNBT.setString(
"mPumpedBlock2",
- this.mSecondaryPumpedBlock == null
- ? ""
+ this.mSecondaryPumpedBlock == null ? ""
: Block.blockRegistry.getNameForObject(this.mSecondaryPumpedBlock));
aNBT.setBoolean("wasPumping", wasPumping);
aNBT.setInteger("radiusConfig", radiusConfig);
@@ -122,8 +134,12 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mDisallowRetract = aNBT.getBoolean("mDisallowRetract");
if (debugBlockPump) {
- GT_Log.out.println("PUMP: NBT:Load - WasPumping - " + this.wasPumping + "("
- + aNBT.getString("mPumpedBlock1") + ") " + this.mPrimaryPumpedBlock);
+ GT_Log.out.println(
+ "PUMP: NBT:Load - WasPumping - " + this.wasPumping
+ + "("
+ + aNBT.getString("mPumpedBlock1")
+ + ") "
+ + this.mPrimaryPumpedBlock);
}
}
@@ -151,15 +167,17 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
}
GT_Utility.sendChatToPlayer(
aPlayer,
- StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (radiusConfig * 2 + 1) + "x"
+ 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) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ)) return true;
mDisallowRetract = !mDisallowRetract;
GT_Utility.sendChatToPlayer(
@@ -216,13 +234,10 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mPumpCountBelow = 0;
IGregTechTileEntity tTileEntity;
- for (int i = 1;
- (i < 21)
- && ((tTileEntity = getBaseMetaTileEntity()
- .getIGregTechTileEntityAtSideAndDistance((byte) 0, i))
- != null)
- && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump));
- i++) {
+ for (int i = 1; (i < 21)
+ && ((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;
@@ -239,8 +254,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
if ((getBaseMetaTileEntity().isUniversalEnergyStored(this.getEuUsagePerAction()))
&& ((this.mFluid == null) || (this.mFluid.amount + 1000 <= getCapacity()))) {
boolean tMovedOneDown = false;
- if ((this.mPumpList.isEmpty())
- && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) {
+ if ((this.mPumpList.isEmpty()) && (getBaseMetaTileEntity().getTimer() % 100L == 0L)) {
if (!this.wasPumping) {
tMovedOneDown = moveOneDown();
if (!tMovedOneDown) {
@@ -265,17 +279,19 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
GT_Log.out.println("PUMP: Was pumping, didn't move down");
}
}
- int x = getBaseMetaTileEntity().getXCoord(),
- z = getBaseMetaTileEntity().getZCoord();
+ int x = getBaseMetaTileEntity().getXCoord(), z = getBaseMetaTileEntity().getZCoord();
if (!this.hasValidFluid()) {
// We don't have a valid block, let's try to find one
int y = getYOfPumpHead();
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);
+ 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);
}
// First look down
checkForFluidToPump(x, y - 1, z);
@@ -294,20 +310,22 @@ 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
+ if ((tMovedOneDown) || this.wasPumping
|| ((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)
- // 3) We have an empty queue and enough time has passed
- // 4) A long while has passed
+ // 1) We just moved down
+ // 2) We were previously pumping (and possibly just reloaded)
+ // 3) We have an empty queue and enough time has passed
+ // 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());
+ GT_Log.out.println(
+ "PUMP: Rebuilding pump list - Size " + this.mPumpList.size()
+ + " WasPumping: "
+ + this.wasPumping
+ + " Timer "
+ + getBaseMetaTileEntity().getTimer());
}
int yPump = getBaseMetaTileEntity().getYCoord() - 1, yHead = getYOfPumpHead();
@@ -329,7 +347,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mPumpTimer = mPumpTimer == 0 ? 1 : mPumpTimer;
}
} else {
- // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps
+ // We somehow have a valid fluid, but the head of the pump isn't below the pump. Perhaps
// someone broke some pipes
// -- Clear the queue and we should try to move down until we can find a valid fluid
this.clearQueue(false);
@@ -338,10 +356,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
GT_Log.out.println("PUMP: Not enough energy? Free space?");
}
} else {
- if (!mRetractDone
- && ((aTick % 5) == 0)
- && ((this.mInventory[0] == null)
- || this.mInventory[0].stackSize == 0
+ 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())))) {
@@ -355,8 +371,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
final int tZCoord = this.getBaseMetaTileEntity().getZCoord();
this.getBaseMetaTileEntity().getWorld().setBlockToAir(tXCoord, tHeadY, tZCoord);
if (tHeadY < this.getBaseMetaTileEntity().getYCoord() - 1) {
- getBaseMetaTileEntity()
- .getWorld()
+ getBaseMetaTileEntity().getWorld()
.setBlock(tXCoord, tHeadY + 1, tZCoord, MINING_PIPE_TIP_BLOCK);
}
if (this.mInventory[0] == null) {
@@ -407,8 +422,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
}
private boolean moveOneDown() {
- if ((this.mInventory[0] == null)
- || (this.mInventory[0].stackSize < 1)
+ if ((this.mInventory[0] == null) || (this.mInventory[0].stackSize < 1)
|| (!GT_Utility.areStacksEqual(this.mInventory[0], MINING_PIPE))) {
// No mining pipes
if (debugBlockPump) {
@@ -428,10 +442,8 @@ 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))) {
+ if ((!consumeFluid(x, yHead - 1, z)) && (!getBaseMetaTileEntity().getBlock(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");
@@ -440,7 +452,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");
}
@@ -461,8 +479,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
// Let's play find the pump head!
// TODO: Handle pipe|pipe|head|pipe|pipe
- int y = getBaseMetaTileEntity().getYCoord() - 1,
- x = getBaseMetaTileEntity().getXCoord(),
+ int y = getBaseMetaTileEntity().getYCoord() - 1, x = getBaseMetaTileEntity().getXCoord(),
z = getBaseMetaTileEntity().getZCoord();
while (y > 0) {
@@ -550,8 +567,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
}
}
- private boolean queueFluid(
- int aX, int aY, int aZ, ArrayDeque<ChunkPosition> fluidsFound, Set<ChunkPosition> checked) {
+ private boolean queueFluid(int aX, int aY, int aZ, ArrayDeque<ChunkPosition> fluidsFound,
+ 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
@@ -598,13 +615,11 @@ 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));
+ 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));
}
private boolean consumeFluid(int aX, int aY, int aZ) {
@@ -615,8 +630,8 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
Block aBlock = getBaseMetaTileEntity().getBlock(aX, aY, aZ);
if (aBlock != null && ((this.mPrimaryPumpedBlock == aBlock) || (this.mSecondaryPumpedBlock == aBlock))) {
- boolean isWaterOrLava =
- ((this.mPrimaryPumpedBlock == Blocks.water || this.mPrimaryPumpedBlock == Blocks.lava));
+ boolean isWaterOrLava = ((this.mPrimaryPumpedBlock == Blocks.water
+ || 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
@@ -630,26 +645,24 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
else if (this.mPrimaryPumpedBlock == Blocks.lava) this.mFluid = GT_ModHandler.getLava(1000L);
else {
// Not water or lava; try to drain and set to air
- this.mFluid =
- ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true);
+ this.mFluid = ((IFluidBlock) aBlock).drain(getBaseMetaTileEntity().getWorld(), aX, aY, aZ, true);
}
- } else if (GT_ModHandler.isWater(this.mFluid)
- || GT_ModHandler.isLava(this.mFluid)
+ } 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;
+ 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);
@@ -665,24 +678,29 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
}
@Override
- public ArrayList<String> getSpecialDebugInfo(
- IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, 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()));
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer,
+ 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()));
return aList;
}
@@ -777,19 +795,11 @@ 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) {
- 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)
- };
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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) };
}
@Override
@@ -799,12 +809,10 @@ 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),
- };
+ 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), };
}
private FakePlayer mFakePlayer = null;
@@ -819,11 +827,14 @@ 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 57536d0e9d..6add532358 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
@@ -2,6 +2,12 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.HashMap;
+import java.util.NoSuchElementException;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Element;
import gregtech.api.enums.ItemList;
@@ -16,12 +22,9 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
-import java.util.HashMap;
-import java.util.NoSuchElementException;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine {
+
public static final HashMap<Materials, Long> MASS_OVERRIDES = new HashMap<>();
public static final double EXPONENT = GregTech_API.sOPStuff.get("Replicator", "Nerf Exponent", 1.2D);
private static int sHeaviestElementMass = 0;
@@ -49,73 +52,49 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_REPLICATOR_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_REPLICATOR_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_Replicator(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Replicator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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) {
@@ -129,9 +108,7 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine
ItemStack tDataOrb = getSpecialSlot();
if ((ItemList.Tool_DataOrb.isStackEqual(tDataOrb, false, true))
&& (Behaviour_DataOrb.getDataTitle(tDataOrb).equals("Elemental-Scan"))) {
- Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb))
- .mLinkedMaterials
- .get(0);
+ 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)) {
@@ -178,8 +155,8 @@ public class GT_MetaTileEntity_Replicator extends GT_MetaTileEntity_BasicMachine
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& ItemList.Cell_Empty.isStackEqual(aStack);
}
@@ -193,8 +170,7 @@ 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()
+ .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 6c0f6cb051..584164fa94 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
@@ -2,6 +2,9 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.ITexture;
@@ -12,10 +15,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachine {
+
public GT_MetaTileEntity_RockBreaker(int aID, String aName, String aNameRegional, int aTier) {
super(
aID,
@@ -30,73 +32,49 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_RockBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -105,8 +83,8 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& getRecipeList().containsInput(aStack);
}
@@ -130,12 +108,13 @@ public class GT_MetaTileEntity_RockBreaker extends GT_MetaTileEntity_BasicMachin
|| (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);
- }
+ 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 7780e56eee..20b42e7bb4 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
@@ -4,6 +4,13 @@ import static gregtech.api.enums.GT_Values.*;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes;
+import java.util.Objects;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IIndividual;
import gregtech.GT_Mod;
@@ -24,11 +31,6 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
-import java.util.Objects;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
@@ -46,73 +48,49 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_SCANNER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_SCANNER_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_Scanner(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_Scanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -182,8 +160,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
return 2;
}
ItemData tData = GT_OreDictUnificator.getAssociation(aStack);
- if ((tData != null)
- && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell))
+ 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)
@@ -230,8 +207,11 @@ 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()));
+ this.mOutputItems[0].setTagCompound(
+ 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)
@@ -240,56 +220,47 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
}
if ((aStack.getItem().getUnlocalizedName().contains("Schematic")
- || aStack.getItem().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(MOD_ID_GC_CORE, "item.schematic", 1L, 0))
+ if (stackItemID == Item.getIdFromItem(
+ Objects.requireNonNull(GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0))
.getItem())) {
- if (stackItemDamage == 0
- && aStack.toString()
- .equals(Objects.requireNonNull(GT_ModHandler.getModItem(
- MOD_ID_GC_CORE, "item.schematic", 1L, 0))
- .copy()
- .toString())) sTier = "100";
- else if (stackItemDamage == 1
- && aStack.toString()
- .equals(Objects.requireNonNull(GT_ModHandler.getModItem(
- MOD_ID_GC_CORE, "item.schematic", 1L, 1))
- .copy()
- .toString())) sTier = "2";
+ if (stackItemDamage == 0 && aStack.toString().equals(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 0)).copy()
+ .toString()))
+ sTier = "100";
+ else if (stackItemDamage == 1 && aStack.toString().equals(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_CORE, "item.schematic", 1L, 1)).copy()
+ .toString()))
+ sTier = "2";
} else {
- if (stackItemID
- == Item.getIdFromItem(Objects.requireNonNull(
- GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0))
- .getItem())) {
- if (stackItemDamage == 0
- && aStack.toString()
- .equals(Objects.requireNonNull(GT_ModHandler.getModItem(
- MOD_ID_GC_MARS, "item.schematic", 1L, 0))
- .copy()
- .toString())) sTier = "3";
- else if (stackItemDamage == 1
- && aStack.toString()
- .equals(Objects.requireNonNull(GT_ModHandler.getModItem(
- MOD_ID_GC_MARS, "item.schematic", 1L, 1))
- .copy()
- .toString())) sTier = "101";
- else if (stackItemDamage == 2
- && aStack.toString()
- .equals(Objects.requireNonNull(GT_ModHandler.getModItem(
- MOD_ID_GC_MARS, "item.schematic", 1L, 2))
- .copy()
- .toString())) sTier = "102";
+ if (stackItemID == Item.getIdFromItem(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).getItem())) {
+ if (stackItemDamage == 0 && aStack.toString().equals(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 0)).copy()
+ .toString()))
+ sTier = "3";
+ else if (stackItemDamage == 1 && aStack.toString().equals(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 1)).copy()
+ .toString()))
+ sTier = "101";
+ else if (stackItemDamage == 2 && aStack.toString().equals(
+ Objects.requireNonNull(
+ GT_ModHandler.getModItem(MOD_ID_GC_MARS, "item.schematic", 1L, 2)).copy()
+ .toString()))
+ sTier = "102";
} else if (aStack.getUnlocalizedName().matches(".*\\d+.*"))
- sTier = aStack.getUnlocalizedName()
- .split("(?<=\\D)(?=\\d)")[1]
- .substring(0, 1);
+ sTier = aStack.getUnlocalizedName().split("(?<=\\D)(?=\\d)")[1].substring(0, 1);
else sTier = "1";
}
@@ -298,8 +269,11 @@ 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)));
+ this.mOutputItems[0].setTagCompound(
+ GT_Utility.getNBTContainingShort(
+ new NBTTagCompound(),
+ "rocket_tier",
+ Short.parseShort(sTier)));
calculateOverclockedNess(480, 36000);
// In case recipe is too OP for that machine
@@ -379,8 +353,8 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& getRecipeList().containsInput(aStack);
}
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 ff54291188..4e8af7d283 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
@@ -2,6 +2,17 @@ package gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -17,15 +28,6 @@ import gregtech.common.GT_UndergroundOil;
import gregtech.common.blocks.GT_Block_Ores_Abstract;
import gregtech.common.blocks.GT_TileEntity_Ores;
import ic2.core.Ic2Items;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_BasicMachine {
@@ -45,73 +47,49 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic
"",
TextureFactory.of(
TextureFactory.of(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE),
- TextureFactory.builder()
- .addIcon(OVERLAY_SIDE_ROCK_BREAKER_ACTIVE_GLOW)
- .glow()
- .build()),
+ 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.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.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.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.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.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.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()));
+ 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) {
+ public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String aDescription, ITexture[][][] aTextures,
+ 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) {
+ public GT_MetaTileEntity_SeismicProspector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures,
+ 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
@@ -119,18 +97,14 @@ public class GT_MetaTileEntity_SeismicProspector extends GT_MetaTileEntity_Basic
if (aBaseMetaTileEntity.isServerSide()) {
ItemStack aStack = aPlayer.getCurrentEquippedItem();
ItemData stackData = GT_OreDictUnificator.getItemData(aStack);
- if (!ready
- && (aStack != null)
+ 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
+ || (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.getItemDamage() == ItemList.Block_Powderbarrel.get(1).getItemDamage()
&& aStack.stackSize >= 8))) {
if ((!aPlayer.capabilities.isCreativeMode) && (aStack.stackSize != 111)) {
if (aStack.getItem() == Item.getItemFromBlock(Blocks.tnt)) {
@@ -140,89 +114,84 @@ 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
+ } 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<String>();
-
- // 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(
+ this.ready = false;
+ GT_Utility.ItemNBT.setBookTitle(aPlayer.getCurrentEquippedItem(), "Raw Prospection Data");
+ List<String> tStringList = new ArrayList<String>();
+
+ // 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);
+ 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(
+ } 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);
+ 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);
+ }
+ }
+ GT_Utility.ItemNBT.setProspectionData(
+ aPlayer.getCurrentEquippedItem(),
+ this.getBaseMetaTileEntity().getXCoord(),
+ this.getBaseMetaTileEntity().getYCoord(),
+ this.getBaseMetaTileEntity().getZCoord(),
+ this.getBaseMetaTileEntity().getWorld().provider.dimensionId,
+ tFluid,
+ tStringArray);
}
- }
- 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);
- }
}
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 0d09c59832..2b1f0fa349 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
@@ -9,28 +9,9 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TELEPORTER_SIDES_GLOW;
-import com.gtnewhorizons.modularui.api.drawable.IDrawable;
-import com.gtnewhorizons.modularui.api.screen.ModularWindow;
-import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
-import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
-import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
-import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
-import com.gtnewhorizons.modularui.common.widget.TextWidget;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.gui.modularui.GT_UITextures;
-import gregtech.api.gui.modularui.GUITextureSet;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.modularui.IAddGregtechLogo;
-import gregtech.api.interfaces.modularui.IAddUIWidgets;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Config;
-import gregtech.api.util.GT_Utility;
import java.util.List;
import java.util.function.Consumer;
+
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityHanging;
@@ -60,6 +41,28 @@ import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fluids.FluidStack;
+import com.gtnewhorizons.modularui.api.drawable.IDrawable;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
+import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
+import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
+import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.gui.modularui.GT_UIInfos;
+import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.gui.modularui.GUITextureSet;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.modularui.IAddGregtechLogo;
+import gregtech.api.interfaces.modularui.IAddUIWidgets;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Utility;
+
public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
implements IAddGregtechLogo, IAddUIWidgets {
@@ -75,11 +78,14 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
// public boolean hasEgg = false;
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"
- });
+ 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" });
}
public GT_MetaTileEntity_Teleporter(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -95,8 +101,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
if ((aEntity instanceof EntityFX)) {
return -1.0F;
}
- } catch (Throwable e) {
- }
+ } catch (Throwable e) {}
if ((aEntity instanceof EntityFishHook)) {
return -1.0F;
}
@@ -191,54 +196,30 @@ 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)
- };
- }
-
- @Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
- if (aSide != this.getBaseMetaTileEntity().getFrontFacing())
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1],
- TextureFactory.of(OVERLAY_TELEPORTER_SIDES),
- TextureFactory.builder()
- .addIcon(OVERLAY_TELEPORTER_SIDES_GLOW)
- .glow()
- .build()
- };
- if (aActive)
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1],
+ 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) };
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ if (aSide != this.getBaseMetaTileEntity().getFrontFacing()) return new ITexture[] {
+ MACHINE_CASINGS[mTier][aColorIndex + 1], 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()
- };
- 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_ACTIVE_GLOW).glow().build() };
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_TELEPORTER),
+ TextureFactory.builder().addIcon(OVERLAY_TELEPORTER_GLOW).glow().build() };
}
@Override
@@ -263,10 +244,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;
}
@@ -274,8 +255,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
@Override
public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) {
if (getBaseMetaTileEntity().isServerSide()) {
- if ((this.mTargetX == 0)
- && (this.mTargetY == 0)
+ if ((this.mTargetX == 0) && (this.mTargetY == 0)
&& (this.mTargetZ == 0)
&& (this.mTargetD == Integer.MIN_VALUE)) {
this.mTargetX = aBaseMetaTileEntity.getXCoord();
@@ -288,36 +268,33 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
}
// public boolean checkForEgg() {
- // for (byte i = -5; i <= 5; i = (byte) (i + 1)) {
- // 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) == Blocks.dragon_egg) {
- // return true;
- // }
- // }
- // }
- // }
- // return false;
+ // for (byte i = -5; i <= 5; i = (byte) (i + 1)) {
+ // 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) == Blocks.dragon_egg) {
+ // return true;
+ // }
+ // }
+ // }
+ // }
+ // return false;
// }
public boolean hasDimensionalTeleportCapability() {
- return this.mDebug
- ||
- // (
+ return this.mDebug ||
+ // (
sInterDimensionalTeleportAllowed // &&
- // (
- // this.hasEgg ||
- // mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && mFluid.amount >= 1000
- // )
+ // (
+ // this.hasEgg ||
+ // 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));
+ return this.mDebug || (hasDimensionalTeleportCapability() && GT_Utility.isRealDimension(this.mTargetD)
+ && GT_Utility.isRealDimension(getBaseMetaTileEntity().getWorld().provider.dimensionId));
}
@Override
@@ -329,18 +306,17 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
super.onPostTick(aBaseMetaTileEntity, aTick);
if (getBaseMetaTileEntity().isServerSide()) {
// if (getBaseMetaTileEntity().getTimer() % 100L == 50L) {
- // this.hasEgg = checkForEgg();
+ // this.hasEgg = checkForEgg();
// }
- if ((getBaseMetaTileEntity().isAllowedToWork())
- && (getBaseMetaTileEntity().getRedstone())) {
+ if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(sPassiveEnergyDrain, false)) {
// if (hasDimensionalTeleportCapability() && this.mTargetD !=
// getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasEgg ||
// mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)))&& new XSTR().nextInt(10)==0) {
- // mFluid.amount--;
- // if (mFluid.amount < 1) {
- // mFluid = null;
- // }
+ // mFluid.amount--;
+ // if (mFluid.amount < 1) {
+ // mFluid = null;
+ // }
// }
int tDistance = distanceCalculation();
if (mInventory[0] != null) {
@@ -356,13 +332,20 @@ 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,
+ 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
+ (long) (Math.pow(tDistance, 1.5) * tDistance
* (tStacksize
- (mInventory[0] == null ? 0 : mInventory[0].stackSize))
* sFPowerMultiplyer),
@@ -370,66 +353,32 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
}
}
}
- List 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));
+ List 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));
for (Object tObject : entities_in_box) {
if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) {
Entity tEntity = (Entity) tObject;
- // GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5)));
- if (getBaseMetaTileEntity()
- .decreaseStoredEnergyUnits(
- (long) (Math.pow(tDistance, 1.5)
- * weightCalculation(tEntity)
- * sFPowerMultiplyer),
- false)) {
+ // GT_FML_LOGGER.info("teleport"+(Math.pow(tDistance, 1.5)));
+ if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(
+ (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)))) {
- // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) *
+ // mFluid.amount = mFluid.amount - ((int) Math.min(10, (Math.pow(tDistance, 1.5) *
// weightCalculation(tEntity) / 8192)));
- // if (mFluid.amount < 1) {
- // mFluid = null;
- // }
+ // if (mFluid.amount < 1) {
+ // mFluid = null;
+ // }
// }
if (tEntity.ridingEntity != null) {
tEntity.mountEntity(null);
@@ -446,14 +395,15 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank
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);
+ ((EntityLivingBase) tEntity).setPositionAndUpdate(
+ 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);
}
}
}
@@ -470,11 +420,14 @@ 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))));
+ && (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
@@ -614,27 +567,26 @@ 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))
+ 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));
addChangeNumberButtons(builder, GT_UITextures.OVERLAY_BUTTON_MINUS_LARGE, -512, -64, 7);
@@ -643,33 +595,38 @@ 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) {
+ private void addChangeNumberButtons(ModularWindow.Builder builder, IDrawable overlay, int addNumberShift,
+ 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) {
- 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));
+ private void addChangeNumberButton(ModularWindow.Builder builder, IDrawable overlay, Consumer<Integer> setter,
+ 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));
}
@Override
@@ -679,9 +636,7 @@ 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));
+ builder.widget(
+ 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 f6bc532469..cae467c4a0 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
@@ -6,18 +6,16 @@
*
* This file is part of GregTech.
*
- * GregTech is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * GregTech is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * GregTech is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * GregTech is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
*
- * You should have received a copy of the GNU Lesser General Public License
- * along with GregTech. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License along with GregTech. If not, see
+ * <http://www.gnu.org/licenses/>.
*/
package gregtech.common.tileentities.machines.long_distance;
@@ -28,14 +26,6 @@ import static mcp.mobius.waila.api.SpecialChars.RED;
import static mcp.mobius.waila.api.SpecialChars.RESET;
import static mcp.mobius.waila.api.SpecialChars.YELLOW;
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_Block_LongDistancePipe;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
-import gregtech.api.util.GT_Utility;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -43,8 +33,10 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
+
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -55,7 +47,17 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_Block_LongDistancePipe;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull_NonElectric;
+import gregtech.api.util.GT_Utility;
+
public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_MetaTileEntity_BasicHull_NonElectric {
+
public static int minimalDistancePoints = 64;
protected GT_MetaTileEntity_LongDistancePipelineBase mTarget = null;
// these two are updated by machine block update thread, so must be volatile
@@ -63,13 +65,13 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
protected volatile ChunkCoordinates mTargetPos = null;
protected GT_MetaTileEntity_LongDistancePipelineBase mTooCloseTarget = null, mTooCloseSender = null;
- public GT_MetaTileEntity_LongDistancePipelineBase(
- int aID, String aName, String aNameRegional, int aTier, String aDescription) {
+ public GT_MetaTileEntity_LongDistancePipelineBase(int aID, String aName, String aNameRegional, int aTier,
+ String aDescription) {
super(aID, aName, aNameRegional, aTier, aDescription);
}
- public GT_MetaTileEntity_LongDistancePipelineBase(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_LongDistancePipelineBase(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -89,7 +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;
}
}
@@ -125,15 +129,15 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
// We don't have a target position, scan the pipes
scanPipes();
} else if (mTarget == null || mTarget.isDead()) {
- // We don't have a target, or it's dead. Try checking the target position
+ // We don't have a target, or it's dead. Try checking the target position
mTarget = null;
if (world.blockExists(mTargetPos.posX, mTargetPos.posY, mTargetPos.posZ)) {
// Only check if the target position is loaded
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)
+ && ((tMeta = ((BaseMetaTileEntity) te)
+ .getMetaTileEntity()) instanceof GT_MetaTileEntity_LongDistancePipelineBase)
&& isSameClass((GT_MetaTileEntity_LongDistancePipelineBase) tMeta)) {
// It's the right type!
mTarget = (GT_MetaTileEntity_LongDistancePipelineBase) tMeta;
@@ -147,8 +151,7 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
if (mTooCloseSender != null && (mTooCloseSender.isDead() || mTooCloseSender.mTarget != null))
mTooCloseSender = null;
if (mTarget == null || mTarget == this) return false;
- if (mTarget.mSender == null
- || mTarget.mSender.isDead()
+ if (mTarget.mSender == null || mTarget.mSender.isDead()
|| mTarget.mSender.mTarget == null
|| mTarget.mSender.mTarget.isDead()) {
mTarget.mSender = this;
@@ -159,17 +162,23 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
}
@Override
- public ArrayList<String> getSpecialDebugInfo(
- IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, int aLogLevel, ArrayList<String> aList) {
+ public ArrayList<String> getSpecialDebugInfo(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer,
+ 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));
+ aList.addAll(
+ 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));
+ aList.addAll(
+ Arrays.asList(
+ checkTarget() ? "Has Target" : "Has no loaded Target",
+ "Target should be around: X: " + mTargetPos.posX
+ + " Y: "
+ + mTargetPos.posY
+ + " Z: "
+ + mTargetPos.posZ));
}
return aList;
@@ -201,8 +210,8 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
HashSet<ChunkCoordinates> tVisited = new HashSet<>(Collections.singletonList(getCoords())),
tWires = new HashSet<>();
- Queue<ChunkCoordinates> tQueue =
- new LinkedList<>(Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing())));
+ Queue<ChunkCoordinates> tQueue = new LinkedList<>(
+ Collections.singletonList(getFacingOffset(gtTile, gtTile.getBackFacing())));
while (!tQueue.isEmpty()) {
final ChunkCoordinates aCoords = tQueue.poll();
@@ -231,15 +240,13 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
} else {
// 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) {
- final GT_MetaTileEntity_LongDistancePipelineBase tGtTile =
- (GT_MetaTileEntity_LongDistancePipelineBase)
- ((BaseMetaTileEntity) tTileEntity).getMetaTileEntity();
- if (isSameClass(tGtTile)
- && tWires.contains(tGtTile.getFacingOffset(
+ if (tTileEntity != gtTile && tTileEntity instanceof BaseMetaTileEntity
+ && ((BaseMetaTileEntity) tTileEntity)
+ .getMetaTileEntity() instanceof GT_MetaTileEntity_LongDistancePipelineBase) {
+ final GT_MetaTileEntity_LongDistancePipelineBase tGtTile = (GT_MetaTileEntity_LongDistancePipelineBase) ((BaseMetaTileEntity) tTileEntity)
+ .getMetaTileEntity();
+ if (isSameClass(tGtTile) && tWires.contains(
+ 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
@@ -276,7 +283,9 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
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() {
@@ -302,8 +311,8 @@ public abstract class GT_MetaTileEntity_LongDistancePipelineBase extends GT_Meta
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currentTip, IWailaDataAccessor accessor,
+ IWailaConfigHandler config) {
final NBTTagCompound tag = accessor.getNBTData();
final int facing = getBaseMetaTileEntity().getFrontFacing();
final int side = (byte) accessor.getSide().ordinal();
@@ -326,8 +335,8 @@ 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) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ 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 849ce40101..ce020560cb 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
@@ -6,18 +6,16 @@
*
* This file is part of GregTech.
*
- * GregTech is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * GregTech is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * GregTech is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * GregTech is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
*
- * You should have received a copy of the GNU Lesser General Public License
- * along with GregTech. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License along with GregTech. If not, see
+ * <http://www.gnu.org/licenses/>.
*/
package gregtech.common.tileentities.machines.long_distance;
@@ -27,26 +25,28 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_FRON
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_FLUID_SIDE_GLOW;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Utility;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Utility;
+
public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEntity_LongDistancePipelineBase {
- static final FluidTankInfo[] emptyTank = {new FluidTankInfo(null, Integer.MAX_VALUE)};
+
+ static final FluidTankInfo[] emptyTank = { new FluidTankInfo(null, Integer.MAX_VALUE) };
public GT_MetaTileEntity_LongDistancePipelineFluid(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, "Sends fluids over long distances");
}
- public GT_MetaTileEntity_LongDistancePipelineFluid(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_LongDistancePipelineFluid(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -109,29 +109,14 @@ public class GT_MetaTileEntity_LongDistancePipelineFluid extends GT_MetaTileEnti
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
- if (aSide == aFacing)
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1], 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)
- };
- else
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1],
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1],
+ 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) };
+ 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.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 0559290df6..d62e87c707 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
@@ -6,18 +6,16 @@
*
* This file is part of GregTech.
*
- * GregTech is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * GregTech is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * GregTech is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * GregTech is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
*
- * You should have received a copy of the GNU Lesser General Public License
- * along with GregTech. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License along with GregTech. If not, see
+ * <http://www.gnu.org/licenses/>.
*/
package gregtech.common.tileentities.machines.long_distance;
@@ -27,24 +25,26 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_FRONT
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPELINE_ITEM_SIDE_GLOW;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.ISidedInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.ISidedInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntity_LongDistancePipelineBase {
+
public GT_MetaTileEntity_LongDistancePipelineItem(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, "Sends Items over long distances");
}
- public GT_MetaTileEntity_LongDistancePipelineItem(
- String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_LongDistancePipelineItem(String aName, int aTier, String aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -145,7 +145,7 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit
return false;
}
- // // Relay Sided Inventories
+ // // Relay Sided Inventories
//
@Override
@@ -188,29 +188,14 @@ public class GT_MetaTileEntity_LongDistancePipelineItem extends GT_MetaTileEntit
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
- if (aSide == aFacing)
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1], 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)
- };
- else
- return new ITexture[] {
- MACHINE_CASINGS[mTier][aColorIndex + 1],
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1],
+ 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) };
+ 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.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 3dde1feb83..51c7c2eb13 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
@@ -1,9 +1,10 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_EnhancedMultiBlockBase;
-import net.minecraft.item.ItemStack;
public abstract class GT_MetaTileEntity_AbstractMultiFurnace<T extends GT_MetaTileEntity_AbstractMultiFurnace<T>>
extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> {
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 e5b7110659..6f09aa6ede 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
@@ -10,10 +10,19 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
@@ -34,84 +43,66 @@ import gregtech.api.util.*;
import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.IGT_HatchAdder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-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("IC2", "blockAlloyGlass", 0, true),
- ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true),
- // warded glass
- ofBlockUnlocalizedName("Thaumcraft", "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),
+ 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("IC2", "blockAlloyGlass", 0, true),
+ ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true),
+ // warded glass
+ ofBlockUnlocalizedName("Thaumcraft", "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', InputBus.newAny(16, 5, ForgeDirection.DOWN))
- .addElement('o', OutputBus.newAny(16, 4, ForgeDirection.DOWN))
- .build();
+ .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);
@@ -129,12 +120,9 @@ public class GT_MetaTileEntity_AssemblyLine
@Override
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) // ?
+ 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")
@@ -143,10 +131,8 @@ public class GT_MetaTileEntity_AssemblyLine
.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)
+ .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)
@@ -155,41 +141,18 @@ public class GT_MetaTileEntity_AssemblyLine
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][16]};
+ return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][16] };
}
@Override
@@ -220,10 +183,9 @@ public class GT_MetaTileEntity_AssemblyLine
int[] tFluidSlot = null;
boolean foundRecipe = false;
- nextDataStick:
- for (ItemStack tDataStick : tDataStickList) {
- GT_AssemblyLineUtils.LookupResult tLookupResult =
- GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick, false);
+ nextDataStick: for (ItemStack tDataStick : tDataStickList) {
+ GT_AssemblyLineUtils.LookupResult tLookupResult = GT_AssemblyLineUtils
+ .findAssemblyLineRecipeFromDataStick(tDataStick, false);
if (tLookupResult.getType() == GT_AssemblyLineUtils.LookupResultType.INVALID_STICK) continue;
@@ -281,8 +243,8 @@ public class GT_MetaTileEntity_AssemblyLine
continue nextDataStick;
} else {
if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) {
- GT_MetaTileEntity_Hatch_MultiInput tMultiHatch =
- (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i);
+ GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches
+ .get(i);
if (!tMultiHatch.hasFluid(tRecipe.mFluidInputs[i])
|| tMultiHatch.getFluidAmount(tRecipe.mFluidInputs[i])
< tRecipe.mFluidInputs[i].amount) {
@@ -318,7 +280,7 @@ public class GT_MetaTileEntity_AssemblyLine
if (GT_Values.D1) {
GT_FML_LOGGER.info("Find available recipe");
}
- mOutputItems = new ItemStack[] {tRecipe.mOutput};
+ mOutputItems = new ItemStack[] { tRecipe.mOutput };
foundRecipe = true;
break;
}
@@ -338,8 +300,8 @@ public class GT_MetaTileEntity_AssemblyLine
for (int i = 0; i < tFluids.length; i++) {
if (mInputHatches.get(i) instanceof GT_MetaTileEntity_Hatch_MultiInput) {
- GT_MetaTileEntity_Hatch_MultiInput tMultiHatch =
- (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches.get(i);
+ GT_MetaTileEntity_Hatch_MultiInput tMultiHatch = (GT_MetaTileEntity_Hatch_MultiInput) mInputHatches
+ .get(i);
tMultiHatch.getFluid(tFluidSlot[i]).amount -= tFluids[i];
if (tMultiHatch.getFluid(tFluidSlot[i]).amount <= 0) {
tMultiHatch.setFluid(null, tFluidSlot[i]);
@@ -494,6 +456,7 @@ public class GT_MetaTileEntity_AssemblyLine
}
private enum DataHatchElement implements IHatchElement<GT_MetaTileEntity_AssemblyLine> {
+
DataAccess;
@Override
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 7536735634..5babf4405d 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
@@ -1,5 +1,10 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+
+import org.lwjgl.input.Keyboard;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.SteamVariant;
@@ -11,23 +16,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import org.lwjgl.input.Keyboard;
public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace
implements ISecondaryDescribable {
- private static final ITexture[] FACING_SIDE = {TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)};
+
+ 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)
- };
+ 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_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) {
@@ -59,32 +57,22 @@ public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_Pri
protected GT_Multiblock_Tooltip_Builder getTooltip() {
if (tooltipBuilder == null) {
tooltipBuilder = new GT_Multiblock_Tooltip_Builder();
- tooltipBuilder
- .addMachineType("Blast Furnace")
- .addInfo("Controller Block for the Bricked Blast Furnace")
+ 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")
+ .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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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 734d11e4c8..8c22ab780f 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
@@ -5,25 +5,22 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.SteamVariant;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace {
- 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()
- };
+
+ 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() };
public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -35,17 +32,12 @@ public class GT_MetaTileEntity_BronzeBlastFurnace extends GT_MetaTileEntity_Prim
@Override
public String[] getDescription() {
- return new String[] {"Disabled"};
+ return new String[] { "Disabled" };
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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 8a2f969b18..4f1aec7f4a 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
@@ -7,6 +7,16 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.ChunkPosition;
+import net.minecraftforge.oredict.OreDictionary;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.OrePrefixes;
@@ -21,14 +31,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.common.GT_Pollution;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.ChunkPosition;
-import net.minecraftforge.oredict.OreDictionary;
public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMultiBlockBase
implements ISecondaryDescribable {
@@ -110,15 +112,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul
if (isWoodLog(
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);
+ getBaseMetaTileEntity().getWorld().setBlock(
+ getBaseMetaTileEntity().getXCoord() + tPos.chunkPosX,
+ getBaseMetaTileEntity().getYCoord() + tPos.chunkPosY,
+ getBaseMetaTileEntity().getZCoord() + tPos.chunkPosZ,
+ GregTech_API.sBlockReinforced,
+ 4,
+ 3);
}
running = false;
return false;
@@ -134,13 +134,12 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul
if (OreDictionary.getOreName(id).equals("logWood")) return true;
}
String tTool = log.getHarvestTool(meta);
- return OrePrefixes.log.contains(new ItemStack(log, 1, meta))
- && ("axe".equals(tTool))
+ return OrePrefixes.log.contains(new ItemStack(log, 1, meta)) && ("axe".equals(tTool))
&& (log.getMaterial() == Material.wood);
}
- private boolean checkAllBlockSides(
- int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1, ArrayList<? super ChunkPosition> aList2) {
+ private boolean checkAllBlockSides(int aX, int aY, int aZ, ArrayList<? super ChunkPosition> aList1,
+ ArrayList<? super ChunkPosition> aList2) {
boolean expandToChunkXPos = false;
boolean expandToChunkXNeg = false;
boolean expandToChunkYPos = false;
@@ -151,7 +150,8 @@ 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;
}
@@ -159,7 +159,8 @@ 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;
}
@@ -167,17 +168,18 @@ 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;
- } else if (!(blockYPos == Blocks.dirt
- || blockYPos == Blocks.grass
+ && (!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;
- }
+ 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;
}
@@ -185,7 +187,8 @@ 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;
}
@@ -193,7 +196,8 @@ 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;
}
@@ -250,50 +254,29 @@ 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()
+ 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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- return new ITexture[] {
- casingTexturePages[0][10],
- TextureFactory.of(OVERLAY_FRONT_ROCK_BREAKER),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_ROCK_BREAKER_GLOW)
- .glow()
- .build(),
- };
+ 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(), };
}
- return new ITexture[] {casingTexturePages[0][10]};
+ return new ITexture[] { casingTexturePages[0][10] };
}
@Override
@@ -308,15 +291,13 @@ public class GT_MetaTileEntity_Charcoal_Pit extends GT_MetaTileEntity_TooltipMul
super.onPostTick(aBaseMetaTileEntity, aTimer);
if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
- new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setMotion(0D, 0.3D, 0D)
+ 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();
+ .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 5e6651cdad..aa082afee0 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
@@ -4,8 +4,20 @@ import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES;
import static gregtech.api.enums.GT_Values.debugCleanroom;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.HashMap;
+import java.util.Map;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import net.minecraftforge.common.config.ConfigCategory;
+import net.minecraftforge.common.config.Configuration;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ISecondaryDescribable;
@@ -19,18 +31,10 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
-import java.util.HashMap;
-import java.util.Map;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-import net.minecraftforge.common.config.ConfigCategory;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiBlockBase
implements IConstructable, ISecondaryDescribable {
+
private int mHeight = -1;
public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) {
@@ -49,22 +53,17 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
@Override
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")
+ 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")
+ .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")
.addCasingInfo("Plascrete", 20)
- .addStructureInfo(
- GT_Values.cleanroomGlass + "% of the Plascrete can be replaced with Reinforced Glass") // check
+ .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
@@ -72,14 +71,13 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
.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");
+ .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit").toolTipFinisher("Gregtech");
return tt;
}
@Override
public String[] getStructureDescription(ItemStack itemStack) {
- return new String[] {"The structure in both X and Z axis has to be a square."};
+ return new String[] { "The structure in both X and Z axis has to be a square." };
}
@Override
@@ -195,17 +193,17 @@ 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))) {
if (tBlock instanceof ic2.core.block.BlockIC2Door) {
if ((tMeta & 8) == 0) {
// let's not fiddle with bits anymore.
if (Math.abs(dZ) < z) // on side parallel to z axis
- doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6;
+ doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6;
else if (Math.abs(dX) < x) // on side parallel to x axis
- doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7;
+ doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7;
// corners ignored
}
mDoorCount++;
@@ -222,8 +220,9 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
mHullCount++;
} else {
if (debugCleanroom) {
- GT_Log.out.println("Cleanroom: Incorrect GT block? "
- + tBlock.getUnlocalizedName());
+ GT_Log.out.println(
+ "Cleanroom: Incorrect GT block? "
+ + tBlock.getUnlocalizedName());
}
return false;
}
@@ -236,9 +235,8 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
if (config.containsKey(key)) {
otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1);
} else {
- if (debugCleanroom)
- GT_Log.out.println("Cleanroom: not allowed block "
- + tBlock.getUnlocalizedName());
+ if (debugCleanroom) GT_Log.out.println(
+ "Cleanroom: not allowed block " + tBlock.getUnlocalizedName());
return false;
}
}
@@ -250,8 +248,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
}
}
}
- if (this.mMaintenanceHatches.size() != 1
- || this.mEnergyHatches.size() != 1
+ if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1
|| mDoorCount > 4
|| mHullCount > 10) {
return false;
@@ -289,26 +286,25 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
private void setCallbacks(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity) {
for (int dX = -x + 1; dX <= x - 1; dX++)
- for (int dZ = -z + 1; dZ <= z - 1; dZ++)
- for (int dY = -1; dY >= y + 1; dY--) {
- TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ);
+ for (int dZ = -z + 1; dZ <= z - 1; dZ++) for (int dY = -1; dY >= y + 1; dY--) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ);
- if (tTileEntity instanceof IGregTechTileEntity) {
- IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ IMetaTileEntity iMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
- if (iMetaTileEntity instanceof IMachineCallback<?>)
- checkAndSetCallback((IMachineCallback<?>) iMetaTileEntity);
+ if (iMetaTileEntity instanceof IMachineCallback<?>)
+ checkAndSetCallback((IMachineCallback<?>) iMetaTileEntity);
- } else if (tTileEntity instanceof IMachineCallback<?>)
- checkAndSetCallback((IMachineCallback<?>) tTileEntity);
- }
+ } else if (tTileEntity instanceof IMachineCallback<?>)
+ checkAndSetCallback((IMachineCallback<?>) tTileEntity);
+ }
}
@SuppressWarnings("unchecked")
private void checkAndSetCallback(IMachineCallback<?> iMachineCallback) {
- if (debugCleanroom)
- GT_Log.out.println("Cleanroom: IMachineCallback detected, checking for cleanroom: "
- + (iMachineCallback.getType() == this.getClass()));
+ if (debugCleanroom) GT_Log.out.println(
+ "Cleanroom: IMachineCallback detected, checking for cleanroom: "
+ + (iMachineCallback.getType() == this.getClass()));
if (iMachineCallback.getType() == this.getClass())
((IMachineCallback<GT_MetaTileEntity_Cleanroom>) iMachineCallback).setCallbackBase(this);
}
@@ -319,32 +315,18 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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())
- };
+ 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()) };
}
- return new ITexture[] {TextureFactory.of(BLOCK_PLASCRETE)};
+ return new ITexture[] { TextureFactory.of(BLOCK_PLASCRETE) };
}
@Override
@@ -381,21 +363,20 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
int y = baseEntity.getYCoord();
int z = baseEntity.getZCoord();
int yoff = Math.max(i * 2, 3);
- for (int X = x - i; X <= x + i; X++)
- for (int Y = y; Y >= y - yoff; Y--)
- for (int Z = z - i; Z <= z + i; Z++) {
- if (X == x && Y == y && Z == z) continue;
- if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) {
- if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2);
- else world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2);
- } else if (Y == y) {
- if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11);
- else world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2);
- }
- }
+ for (int X = x - i; X <= x + i; X++) for (int Y = y; Y >= y - yoff; Y--) for (int Z = z - i; Z <= z + i; Z++) {
+ if (X == x && Y == y && Z == z) continue;
+ if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) {
+ if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockReinforced, 2);
+ else world.setBlock(X, Y, Z, GregTech_API.sBlockReinforced, 2, 2);
+ } else if (Y == y) {
+ if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTech_API.sBlockCasings3, 11);
+ else world.setBlock(X, Y, Z, GregTech_API.sBlockCasings3, 11, 2);
+ }
+ }
}
private static class ConfigEntry {
+
int percentage;
int allowedCount;
int meta;
@@ -434,20 +415,14 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB
for (ConfigCategory cc : cfg.getCategory(category).getChildren()) {
final String name = cc.get("Name").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()));
+ if (cc.containsKey("Meta")) config.put(
+ 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));
} 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()));
+ if (cc.containsKey("Meta")) config.put(
+ 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));
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
index af1468396b..e61cfc0feb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller1.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_ConcreteBackfiller1 extends GT_MetaTileEntity_ConcreteBackfillerBase {
+
public GT_MetaTileEntity_ConcreteBackfiller1(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
index 05646676e7..c175d73cb1 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ConcreteBackfiller2.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_ConcreteBackfiller2 extends GT_MetaTileEntity_ConcreteBackfillerBase {
+
public GT_MetaTileEntity_ConcreteBackfiller2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
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 de477af9e4..dd2f54455a 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
@@ -3,15 +3,18 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.GT_Values.VN;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+
import com.google.common.collect.ImmutableList;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import java.util.List;
-import net.minecraft.item.ItemStack;
public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTileEntity_DrillerBase {
@@ -29,24 +32,18 @@ public abstract class GT_MetaTileEntity_ConcreteBackfillerBase extends GT_MetaTi
String casings = getCasingBlockItem().get(0).getDisplayName();
final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
- tt.addMachineType("Concrete Backfiller")
- .addInfo("Controller Block for the " + aStructureName)
+ 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")
+ .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)
+ .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");
+ .addOutputBus("Mining Pipes, optional, any base casing", 1).toolTipFinisher("Gregtech");
return tt;
}
@@ -73,8 +70,8 @@ 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) {
+ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
if (isRefillableBlock(xPipe, yHead - 1, zPipe)) return tryRefillBlock(xPipe, yHead - 1, zPipe);
int radius = getRadius();
if (mLastXOff == 0 && mLastZOff == 0) {
@@ -107,9 +104,11 @@ 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()) return false;
- if (!GT_Utility.setBlockByFakePlayer(
- getFakePlayer(aBaseTile), aX, aY, aZ, GregTech_API.sBlockConcretes, 8, true)) return false;
+ || aBaseTile.getBlock(aX, aY, aZ).getMaterial().isSolid())
+ return false;
+ if (!GT_Utility
+ .setBlockByFakePlayer(getFakePlayer(aBaseTile), aX, aY, aZ, GregTech_API.sBlockConcretes, 8, true))
+ return false;
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 d6fd5deca4..83ffdd014f 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
@@ -14,10 +14,20 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DIESEL_ENGINE
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -31,46 +41,34 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidStack;
-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<IStructureDefinition<GT_MetaTileEntity_DieselEngine>>() {
- @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();
- }
- };
+ private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_DieselEngine>>() {
+
+ @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();
+ }
+ };
protected int fuelConsumption = 0;
protected int fuelValue = 0;
protected int fuelRemaining = 0;
@@ -87,67 +85,37 @@ public class GT_MetaTileEntity_DieselEngine
@Override
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")
+ 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")
- .addCasingInfo("Stable Titanium Machine Casing", 16)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, false)
+ .addController("Front center").addCasingInfo("Stable Titanium Machine Casing", 16)
.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)
+ .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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[0][50]};
+ return new ITexture[] { casingTexturePages[0][50] };
}
@Override
@@ -161,8 +129,7 @@ public class GT_MetaTileEntity_DieselEngine
}
/**
- * The nominal energy output
- * This can be further multiplied by {@link #getMaxEfficiency(ItemStack)} when boosted
+ * The nominal energy output This can be further multiplied by {@link #getMaxEfficiency(ItemStack)} when boosted
*/
protected int getNominalOutput() {
return 2048;
@@ -173,9 +140,8 @@ public class GT_MetaTileEntity_DieselEngine
}
/**
- * x times fuel will be consumed when boosted
- * This will however NOT increase power output
- * Go tweak {@link #getMaxEfficiency(ItemStack)} and {@link #getNominalOutput()} instead
+ * x times fuel will be consumed when boosted This will however NOT increase power output Go tweak
+ * {@link #getMaxEfficiency(ItemStack)} and {@link #getNominalOutput()} instead
*/
protected int getBoostFactor() {
return 2;
@@ -243,8 +209,7 @@ public class GT_MetaTileEntity_DieselEngine
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 1)
- && !mMufflerHatches.isEmpty()
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 1) && !mMufflerHatches.isEmpty()
&& mMaintenanceHatches.size() == 1;
}
@@ -336,32 +301,51 @@ public class GT_MetaTileEntity_DieselEngine
}
}
- 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 + " %"
- };
+ 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
+ + " %" };
}
@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 275c1c43a5..c6c98912e0 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
@@ -13,11 +13,19 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_DISTILLATION_
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.enums.Textures.BlockIcons;
@@ -31,15 +39,11 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
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";
protected static final String STRUCTURE_PIECE_LAYER = "layer";
@@ -48,42 +52,29 @@ 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)
+ 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"},
- }))
+ .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(),
+ .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(),
+ 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,
@@ -99,11 +90,8 @@ public class GT_MetaTileEntity_DistillationTower
// hint element only used in top layer
.addElement(
'L',
- buildHatchAdder(GT_MetaTileEntity_DistillationTower.class)
- .atLeast(layeredOutputHatch)
- .casingIndex(CASING_INDEX)
- .dot(2)
- .disallowOnly(ForgeDirection.UP)
+ buildHatchAdder(GT_MetaTileEntity_DistillationTower.class).atLeast(layeredOutputHatch)
+ .casingIndex(CASING_INDEX).dot(2).disallowOnly(ForgeDirection.UP)
.buildAndChain(GregTech_API.sBlockCasings4, 1))
.addElement(
'c',
@@ -146,59 +134,32 @@ public class GT_MetaTileEntity_DistillationTower
@Override
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")
+ 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")
+ .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)
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)};
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX) };
}
@Override
@@ -256,7 +217,7 @@ public class GT_MetaTileEntity_DistillationTower
getBaseMetaTileEntity(),
false,
gregtech.api.enums.GT_Values.V[tTier],
- new FluidStack[] {tFluid},
+ new FluidStack[] { tFluid },
inputs);
if (tRecipe != null) {
if (tRecipe.isRecipeInputEqual(true, tFluids, inputs)) {
@@ -269,7 +230,7 @@ public class GT_MetaTileEntity_DistillationTower
this.mEUt = (-this.mEUt);
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)};
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
this.mOutputFluids = tRecipe.mFluidOutputs.clone();
updateSlots();
return true;
@@ -291,15 +252,14 @@ public class GT_MetaTileEntity_DistillationTower
}
protected int getCurrentLayerOutputHatchCount() {
- return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0
- ? 0
+ return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0
: mOutputHatchesByLayer.get(mHeight - 1).size();
}
protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null
- || aTileEntity.isDead()
- || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false;
+ if (aTileEntity == null || aTileEntity.isDead()
+ || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output))
+ return false;
while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>());
GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity();
tHatch.updateTexture(aBaseCasingIndex);
@@ -333,8 +293,7 @@ public class GT_MetaTileEntity_DistillationTower
if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) {
return false;
}
- if (mOutputHatchesByLayer.size() < mHeight
- || mOutputHatchesByLayer.get(mHeight - 1).isEmpty())
+ if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty())
// layer without output hatch
return false;
if (mTopLayerFound) {
@@ -394,11 +353,27 @@ 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);
+ 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, stackSize, 1, tTotalHeight - 1, 0, elementBudget, env, false, true);
+ STRUCTURE_PIECE_TOP_HINT,
+ stackSize,
+ 1,
+ tTotalHeight - 1,
+ 0,
+ elementBudget,
+ env,
+ false,
+ true);
}
}
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 ba5c28b3a4..55ccfd6230 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
@@ -13,12 +13,27 @@ import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraftforge.common.util.FakePlayer;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
@@ -33,58 +48,46 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.IGT_HatchAdder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.ChunkCoordIntPair;
-import net.minecraftforge.common.util.FakePlayer;
-import net.minecraftforge.common.util.ForgeDirection;
public abstract class GT_MetaTileEntity_DrillerBase
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);
private static final Block miningPipeBlock = GT_Utility.getBlockFromStack(miningPipe);
private static final Block miningPipeTipBlock = GT_Utility.getBlockFromStack(miningPipeTip);
protected static final String STRUCTURE_PIECE_MAIN = "main";
- protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>> STRUCTURE_DEFINITION =
- new ClassValue<IStructureDefinition<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(
+ protected static final ClassValue<IStructureDefinition<GT_MetaTileEntity_DrillerBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<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())))
- .build();
- }
- };
+ .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();
+ }
+ };
private Block casingBlock;
private int casingMeta;
@@ -133,41 +136,17 @@ public abstract class GT_MetaTileEntity_DrillerBase
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {getCasingTextureForId(casingTextureIndex)};
+ return new ITexture[] { getCasingTextureForId(casingTextureIndex) };
}
@Override
@@ -190,20 +169,20 @@ public abstract class GT_MetaTileEntity_DrillerBase
workState = aNBT.getBoolean("isPickingPipes") ? STATE_UPWARD : STATE_DOWNWARD;
if (aNBT.hasKey("chunkLoadingEnabled")) mChunkLoadingEnabled = aNBT.getBoolean("chunkLoadingEnabled");
if (aNBT.getBoolean("isChunkloading")) {
- mCurrentChunk =
- new ChunkCoordIntPair(aNBT.getInteger("loadedChunkXPos"), aNBT.getInteger("loadedChunkZPos"));
+ mCurrentChunk = new ChunkCoordIntPair(
+ aNBT.getInteger("loadedChunkXPos"),
+ aNBT.getInteger("loadedChunkZPos"));
}
}
@Override
- public boolean onSolderingToolRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (aSide == getBaseMetaTileEntity().getFrontFacing()) {
mChunkLoadingEnabled = !mChunkLoadingEnabled;
GT_Utility.sendChatToPlayer(
aPlayer,
- mChunkLoadingEnabled
- ? GT_Utility.trans("502", "Mining chunk loading enabled")
+ mChunkLoadingEnabled ? GT_Utility.trans("502", "Mining chunk loading enabled")
: GT_Utility.trans("503", "Mining chunk loading disabled"));
return true;
}
@@ -219,8 +198,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()
- && mCurrentChunk != null
+ if (aBaseMetaTileEntity.isServerSide() && mCurrentChunk != null
&& !mWorkChunkNeedsReload
&& !aBaseMetaTileEntity.isAllowedToWork()) {
// if machine has stopped, stop chunkloading
@@ -242,6 +220,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
/**
* Added for compability reasons
+ *
* @return true if the state is 0 false otherwise.
* @deprecated compatibility reason
*/
@@ -270,19 +249,18 @@ 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;
+ if (b != miningPipeTipBlock && !GT_Utility.setBlockByFakePlayer(
+ getFakePlayer(getBaseMetaTileEntity()),
+ xPipe,
+ yHead - 1,
+ zPipe,
+ miningPipeTipBlock,
+ 0,
+ isSimulating))
+ return 3;
if (!isSimulating) {
if (yHead != yDrill) getBaseMetaTileEntity().getWorld().setBlock(xPipe, yHead, zPipe, miningPipeBlock);
- if (b != miningPipeBlock && b != miningPipeTipBlock)
- getBaseMetaTileEntity().decrStackSize(1, 1);
+ if (b != miningPipeBlock && b != miningPipeTipBlock) getBaseMetaTileEntity().decrStackSize(1, 1);
}
return 0;
@@ -315,7 +293,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
private boolean tryOutputPipe() {
if (!getBaseMetaTileEntity().addStackToSlot(1, GT_Utility.copyAmount(1, miningPipe)))
- mOutputItems = new ItemStack[] {GT_Utility.copyAmount(1, miningPipe)};
+ mOutputItems = new ItemStack[] { GT_Utility.copyAmount(1, miningPipe) };
return true;
}
@@ -361,8 +339,8 @@ public abstract class GT_MetaTileEntity_DrillerBase
return false;
}
- protected boolean workingDownward(
- ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) {
+ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
switch (tryLowerPipeState()) {
case 2:
mMaxProgresstime = 0;
@@ -378,8 +356,8 @@ 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) {
+ protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
switch (tryLowerPipeState(true)) {
case 0:
workState = STATE_DOWNWARD;
@@ -390,8 +368,8 @@ 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) {
+ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
if (tryPickPipe()) {
return true;
} else {
@@ -436,8 +414,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
updateCoordinates();
- return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)
- && checkHatches()
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0) && checkHatches()
&& GT_Utility.getTier(getMaxInputVoltage()) >= getMinTier()
&& mMaintenanceHatches.size() == 1;
}
@@ -465,6 +442,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
protected boolean checkCasingBlock(int xOff, int yOff, int zOff) {
return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta);
}
+
// meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight
// operation)
@Deprecated
@@ -612,6 +590,7 @@ public abstract class GT_MetaTileEntity_DrillerBase
}
protected enum DataHatchElement implements IHatchElement<GT_MetaTileEntity_DrillerBase> {
+
DataAccess;
@Override
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 15f04c5fda..37a9b924e8 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
@@ -8,10 +8,20 @@ import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import java.util.ArrayList;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
@@ -24,59 +34,44 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_ElectricBlastFurnace
extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_ElectricBlastFurnace>
implements ISurvivalConstructable {
+
private int mHeatingCapacity = 0;
private boolean isBussesSeparate = false;
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)
- };
+ protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.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);
@@ -94,69 +89,39 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
@Override
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")
+ 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")
- .addCasingInfo("Heat Proof Machine Casing", 0)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 4, 3, true)
+ .addController("Front bottom").addCasingInfo("Heat Proof Machine Casing", 0)
.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)
+ .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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[0][CASING_INDEX]};
+ return new ITexture[] { casingTexturePages[0][CASING_INDEX] };
}
@Override
@@ -211,8 +176,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;
@@ -230,16 +195,17 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
if (tHeatCapacityDivTiers > 0) {
this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
- this.mMaxProgresstime >>=
- Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if possible
+ this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if
+ // possible
if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0), tRecipe.getOutput(1)};
- this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
+ this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
updateSlots();
return true;
}
+
/**
* Calcualtes overclocked ness using long integers
*
@@ -272,9 +238,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
tempEUt <<= 2; // this actually controls overclocking
// xEUt *= 4;//this is effect of everclocking
mMaxProgresstime >>= 1; // this is effect of overclocking
- xEUt = mMaxProgresstime == 0
- ? xEUt >> 1
- : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power
+ xEUt = mMaxProgresstime == 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick make
+ // the machine use less power
timesOverclocked++;
}
if (xEUt > Integer.MAX_VALUE - 1) {
@@ -362,31 +327,60 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
}
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
@@ -404,7 +398,8 @@ public class GT_MetaTileEntity_ElectricBlastFurnace
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
isBussesSeparate = !isBussesSeparate;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
}
@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 407e661c57..66951a889d 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
@@ -6,6 +6,11 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESE
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_EXTREME_DIESEL_ENGINE_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
@@ -18,10 +23,6 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_DieselEngine {
@@ -36,28 +37,21 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die
@Override
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")
+ 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")
- .addCasingInfo("Robust Tungstensteel Machine Casing", 16)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, false)
+ .addController("Front center").addCasingInfo("Robust Tungstensteel Machine Casing", 16)
.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)
+ .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");
+ .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;
}
@@ -67,41 +61,19 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[0][60]};
+ return new ITexture[] { casingTexturePages[0][60] };
}
@Override
@@ -197,31 +169,50 @@ public class GT_MetaTileEntity_ExtremeDieselEngine extends GT_MetaTileEntity_Die
}
}
- 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 + " %"
- };
+ 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
+ + " %" };
}
}
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 adfefee6c1..1f2b4f8222 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
@@ -12,6 +12,15 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.filterByMTETier;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidStack;
+
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
@@ -25,6 +34,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.GT_Mod;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
@@ -41,101 +51,65 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidStack;
public abstract class GT_MetaTileEntity_FusionComputer
extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_FusionComputer>
implements ISurvivalConstructable, IAddUIWidgets {
+
public static final String STRUCTURE_PIECE_MAIN = "main";
- private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>> STRUCTURE_DEFINITION =
- new ClassValue<IStructureDefinition<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();
- }
- };
+ private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_FusionComputer>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<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();
+ }
+ };
public GT_Recipe mLastRecipe;
public long mEUStore;
@@ -143,14 +117,8 @@ public abstract class GT_MetaTileEntity_FusionComputer
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()
+ TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW).extFacing().build(),
+ TextureFactory.builder().addIcon(MACHINE_CASING_FUSION_GLASS_YELLOW_GLOW).extFacing().glow()
.build()));
}
@@ -194,20 +162,16 @@ public abstract class GT_MetaTileEntity_FusionComputer
@Override
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()
+ 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");
+ .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
+ if (checkPiece(STRUCTURE_PIECE_MAIN, 7, 1, 12) && mInputHatches.size() > 1
&& !mOutputHatches.isEmpty()
&& !mEnergyHatches.isEmpty()) {
mWrench = true;
@@ -262,28 +226,13 @@ public abstract class GT_MetaTileEntity_FusionComputer
public abstract int getFusionCoilMeta();
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide == aFacing)
- return new ITexture[] {
- TextureFactory.builder()
- .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()
- };
+ return new ITexture[] { TextureFactory.builder().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() };
}
/**
@@ -331,11 +280,15 @@ 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);
+ this.getBaseMetaTileEntity(),
+ this.mLastRecipe,
+ false,
+ GT_Values.V[tier()],
+ tFluids);
}
if ((tRecipe == null && !mRunningOnLoad) || (maxEUStore() < tRecipe.mSpecialValue)) {
@@ -400,9 +353,8 @@ public abstract class GT_MetaTileEntity_FusionComputer
for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
if (isValidMetaTileEntity(tHatch)) {
long energyToMove = GT_Values.V[tier()] / 16;
- if (aBaseMetaTileEntity.getStoredEU() + energyToMove < maxEUStore()
- && tHatch.getBaseMetaTileEntity()
- .decreaseStoredEnergyUnits(energyToMove, false)) {
+ if (aBaseMetaTileEntity.getStoredEU() + energyToMove < maxEUStore() && tHatch
+ .getBaseMetaTileEntity().decreaseStoredEnergyUnits(energyToMove, false)) {
aBaseMetaTileEntity.increaseStoredEnergyUnits(energyToMove, true);
}
}
@@ -418,7 +370,8 @@ public abstract class GT_MetaTileEntity_FusionComputer
if (mOutputFluids != null)
for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
mEfficiency = Math.max(
- 0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1])));
+ 0,
+ Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1])));
mOutputItems = null;
mProgresstime = 0;
mMaxProgresstime = 0;
@@ -426,19 +379,16 @@ public abstract class GT_MetaTileEntity_FusionComputer
if (mOutputFluids != null && mOutputFluids.length > 0) {
try {
GT_Mod.achievements.issueAchivementHatchFluid(
- aBaseMetaTileEntity
- .getWorld()
+ aBaseMetaTileEntity.getWorld()
.getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
mOutputFluids[0]);
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
this.mEUStore = aBaseMetaTileEntity.getStoredEU();
if (aBaseMetaTileEntity.isAllowedToWork()) checkRecipe();
}
} else {
- if (aTick % 100 == 0
- || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
|| aBaseMetaTileEntity.hasInventoryBeenModified()) {
turnCasingActive(mMaxProgresstime > 0);
if (aBaseMetaTileEntity.isAllowedToWork()) {
@@ -448,7 +398,8 @@ public abstract class GT_MetaTileEntity_FusionComputer
criticalStopMachine();
}
aBaseMetaTileEntity.decreaseStoredEnergyUnits(
- this.mLastRecipe.mSpecialValue - this.mEUt, true);
+ this.mLastRecipe.mSpecialValue - this.mEUt,
+ true);
}
}
if (mMaxProgresstime <= 0) mEfficiency = Math.max(0, mEfficiency - 1000);
@@ -459,8 +410,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);
}
}
@@ -510,10 +461,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
+ String tier = tier() == 6 ? EnumChatFormatting.RED + "I" + EnumChatFormatting.RESET
+ : tier() == 7 ? EnumChatFormatting.YELLOW + "II" + EnumChatFormatting.RESET
: tier() == 8 ? EnumChatFormatting.GRAY + "III" + EnumChatFormatting.RESET : "IV";
float plasmaOut = 0;
int powerRequired = 0;
@@ -524,17 +473,26 @@ 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"
- };
+ 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" };
}
@Override
@@ -560,10 +518,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));
+ builder.widget(
+ new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17)
+ .setPos(155, 145));
}
@Override
@@ -573,63 +530,61 @@ public abstract class GT_MetaTileEntity_FusionComputer
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- builder.widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure."))
- .setDefaultColor(COLOR_TEXT_WHITE.get())
- .setEnabled(widget -> !mMachine)
- .setPos(10, 8))
+ 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(
+ 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));
+ 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 ef218cb643..f032a9b53e 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
@@ -3,23 +3,20 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION1_GLOW;
+import net.minecraft.block.Block;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
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_GLOW).extFacing().glow().build());
public GT_MetaTileEntity_FusionComputer1(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
@@ -67,22 +64,16 @@ public class GT_MetaTileEntity_FusionComputer1 extends GT_MetaTileEntity_FusionC
@Override
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!!!")
+ 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")
- .addCasingInfo("LuV Machine Casing", 79)
- .addStructureInfo("Cover the coils with casing")
+ .addInfo("number of energy hatches * cap, you can't do it").addSeparator()
+ .beginStructureBlock(15, 3, 15, false).addController("See diagram when placed")
+ .addCasingInfo("LuV Machine Casing", 79).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")
+ .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 a763e1f639..6d95abd1cb 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
@@ -3,23 +3,20 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION2_GLOW;
+import net.minecraft.block.Block;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
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_GLOW).extFacing().glow().build());
public GT_MetaTileEntity_FusionComputer2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
@@ -67,22 +64,16 @@ public class GT_MetaTileEntity_FusionComputer2 extends GT_MetaTileEntity_FusionC
@Override
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!!!")
+ 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")
- .addCasingInfo("Fusion Machine Casing", 79)
- .addStructureInfo("Cover the coils with casing")
+ .addInfo("number of energy hatches * cap, you can't do it").addSeparator()
+ .beginStructureBlock(15, 3, 15, false).addController("See diagram when placed")
+ .addCasingInfo("Fusion Machine Casing", 79).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")
+ .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 c2c0367d61..210a427f32 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
@@ -3,23 +3,20 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FUSION3_GLOW;
+import net.minecraft.block.Block;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
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_GLOW).extFacing().glow().build());
public GT_MetaTileEntity_FusionComputer3(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, 6);
@@ -67,22 +64,16 @@ public class GT_MetaTileEntity_FusionComputer3 extends GT_MetaTileEntity_FusionC
@Override
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")
+ 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")
- .addCasingInfo("Fusion Machine Casing Mk II", 79)
- .addStructureInfo("Cover the coils with casing")
+ .addInfo("number of energy hatches * cap, you can't do it").addSeparator()
+ .beginStructureBlock(15, 3, 15, false).addController("See diagram when placed")
+ .addCasingInfo("Fusion Machine Casing Mk II", 79).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")
+ .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 6c35a3e9c2..e5921aaf32 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
@@ -7,11 +7,19 @@ import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.ITexture;
@@ -26,49 +34,41 @@ import gregtech.api.util.GT_Log;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-public class GT_MetaTileEntity_HeatExchanger
- extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger>
- implements ISurvivalConstructable {
+public class GT_MetaTileEntity_HeatExchanger extends
+ 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(
+ 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();
+ .build();
public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25)
private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch;
@@ -93,23 +93,16 @@ public class GT_MetaTileEntity_HeatExchanger
@Override
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")
+ 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")
+ .addInfo("Then go to the Discord to understand the wiki").addSeparator()
+ .beginStructureBlock(3, 4, 3, false).addController("Front bottom")
.addCasingInfo("Stable Titanium Machine Casing", 20)
- .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)
+ .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;
}
@@ -129,41 +122,18 @@ public class GT_MetaTileEntity_HeatExchanger
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[0][CASING_INDEX]};
+ return new ITexture[] { casingTexturePages[0][CASING_INDEX] };
}
@Override
@@ -221,11 +191,11 @@ public class GT_MetaTileEntity_HeatExchanger
return false;
}
- superheated = fluidAmountToConsume
- >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the
+ superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have
+ // enough hot fluid. Used in the
// onRunningTick method.
- fluidAmountToConsume = Math.min(
- fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot fluid per second
+ fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot
+ // fluid per second
mInputHotFluidHatch.drain(fluidAmountToConsume, true);
this.mMaxProgresstime = 20;
this.mEUt = (int) (fluidAmountToConsume * steam_output_multiplier * efficiency);
@@ -253,8 +223,8 @@ public class GT_MetaTileEntity_HeatExchanger
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mEUt > 0) {
- int tGeneratedEU =
- (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate.
+ int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to
+ // generate.
if (tGeneratedEU > 0) {
if (superheated) tGeneratedEU /= 2; // We produce half as much superheated steam if necessary
@@ -267,8 +237,9 @@ public class GT_MetaTileEntity_HeatExchanger
if (depleteInput(distilledStack)) // Consume the distilled water
{
if (superheated) {
- addOutput(FluidRegistry.getFluidStack(
- "ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam
+ addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate
+ // superheated
+ // steam
} else {
addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
}
@@ -357,26 +328,43 @@ public class GT_MetaTileEntity_HeatExchanger
@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 1b2c690a57..ed7ca009c5 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
@@ -4,7 +4,12 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+
import com.gtnewhorizon.structurelib.structure.IStructureElement;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.SoundResource;
@@ -18,11 +23,10 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_ImplosionCompressor
extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ImplosionCompressor> {
+
public GT_MetaTileEntity_ImplosionCompressor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -39,21 +43,13 @@ public class GT_MetaTileEntity_ImplosionCompressor
@Override
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")
+ 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")
- .addCasingInfo("Solid Steel Machine Casing", 16)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true)
+ .addController("Front center").addCasingInfo("Solid Steel Machine Casing", 16)
.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");
+ .addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1).addMufflerHatch("Any casing", 1)
+ .addInputBus("Any casing", 1).addOutputBus("Any casing", 1).toolTipFinisher("Gregtech");
return tt;
}
@@ -64,41 +60,19 @@ public class GT_MetaTileEntity_ImplosionCompressor
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][16]};
+ return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][16] };
}
@Override
@@ -131,8 +105,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;
@@ -143,7 +117,7 @@ public class GT_MetaTileEntity_ImplosionCompressor
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
- this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0), tRecipe.getOutput(1) };
sendLoopStart((byte) 20);
updateSlots();
return true;
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 1d52753a8c..8b7c5cdf99 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
@@ -6,11 +6,23 @@ import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -28,15 +40,6 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.*;
-import java.util.stream.Collectors;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
public class GT_MetaTileEntity_IntegratedOreFactory
extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_IntegratedOreFactory>
@@ -52,57 +55,58 @@ public class GT_MetaTileEntity_IntegratedOreFactory
private static final String SIFTER = "Sifter";
private static final String CHEM_WASH = "Chemical Bathing";
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', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass")))
- .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', ofBlockAnyMeta(GameRegistry.findBlock("IC2", "blockAlloyGlass")))
+ .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<>();
@@ -178,31 +182,20 @@ public class GT_MetaTileEntity_IntegratedOreFactory
@Override
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.")
+ 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")
+ .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)
+ .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");
+ .addMufflerHatch("Output Pollution", 3).addOutputBus("Output products", 4).toolTipFinisher("Gregtech");
return tt;
}
@@ -276,8 +269,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory
if (tCharged <= 0) break;
int tID = GT_Utility.stackToInt(ore);
if (tID == 0) continue;
- if (isPureDust.contains(tID)
- || isImpureDust.contains(tID)
+ if (isPureDust.contains(tID) || isImpureDust.contains(tID)
|| isCrushedPureOre.contains(tID)
|| isThermal.contains(tID)
|| isCrushedOre.contains(tID)
@@ -369,7 +361,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;
@@ -394,7 +387,8 @@ public class GT_MetaTileEntity_IntegratedOreFactory
des = "";
}
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor", des, getTime() / 20));
+ aPlayer,
+ StatCollector.translateToLocalFormatted("GT5U.machines.oreprocessor", des, getTime() / 20));
}
@Override
@@ -420,8 +414,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 {
@@ -446,7 +440,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory
getBaseMetaTileEntity(),
false,
GT_Values.V[15],
- new FluidStack[] {GT_ModHandler.getDistilledWater(Integer.MAX_VALUE)},
+ new FluidStack[] { GT_ModHandler.getDistilledWater(Integer.MAX_VALUE) },
aStack);
if (tRecipe != null) {
tProduct.addAll(getOutputStack(tRecipe, aStack.stackSize));
@@ -468,8 +462,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 {
@@ -490,8 +484,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 {
@@ -512,8 +506,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 {
@@ -541,8 +535,7 @@ public class GT_MetaTileEntity_IntegratedOreFactory
getStoredFluids().toArray(new FluidStack[0]),
aStack);
if (tRecipe != null && tRecipe.getRepresentativeFluidInput(0) != null) {
- FluidStack tInputFluid =
- tRecipe.getRepresentativeFluidInput(0).copy();
+ FluidStack tInputFluid = tRecipe.getRepresentativeFluidInput(0).copy();
int tStored = getFluidAmount(tInputFluid);
int tWashed = Math.min(tStored / tInputFluid.amount, aStack.stackSize);
depleteInput(new FluidStack(tInputFluid.getFluid(), tWashed * tInputFluid.amount));
@@ -622,8 +615,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
+ return checkPiece(STRUCTURE_PIECE_MAIN, 8, 9, 1) && mMaintenanceHatches.size() <= 1
&& !mMufflerHatches.isEmpty();
}
@@ -664,46 +656,25 @@ 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);
return informationData.toArray(new String[0]);
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2)};
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX2) };
}
}
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 b0c9e55a81..93d42acec0 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
@@ -14,10 +14,19 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_Utility.formatNumbers;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.GT_Mod;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -33,47 +42,41 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-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<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>>() {
- @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();
- }
- };
+ private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeBoiler>>() {
+
+ @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();
+ }
+ };
private boolean firstRun = true;
private int mSuperEfficencyIncrease = 0;
private int integratedCircuitConfig = 0; // Steam output is reduced by 1000L per config
@@ -100,7 +103,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler
// 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))
+ tt.addInfo(
+ "Produces " + formatNumbers((getEUt() * 40) * ((runtimeBoost(20) / (20f)) / superToNormalSteam))
+ "L of Superheated Steam with 1 Coal at "
+ formatNumbers((getEUt() * 40L) / superToNormalSteam)
+ "L/s") // ?
@@ -108,29 +112,27 @@ public abstract class GT_MetaTileEntity_LargeBoiler
.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") // ?
+ 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");
}
- tt.addInfo(String.format(
+ 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)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 5, 3, false)
.addController("Front bottom")
.addCasingInfo(getCasingMaterial() + " " + getCasingBlockType() + " Casing", 24) // ?
.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");
+ .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;
}
@@ -166,46 +168,25 @@ public abstract class GT_MetaTileEntity_LargeBoiler
@Override
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())));
+ return Math.max(
+ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())};
+ return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) };
}
@Override
@@ -262,8 +243,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler
if (tFluid != null) {
tFluid.amount = 1000;
if (depleteInput(tFluid)) {
- this.mMaxProgresstime =
- adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)));
+ this.mMaxProgresstime = adjustBurnTimeForConfig(
+ Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)));
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease();
return true;
@@ -285,7 +266,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime));
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease();
- this.mOutputItems = new ItemStack[] {GT_Utility.getContainerItem(tInput, true)};
+ this.mOutputItems = new ItemStack[] { GT_Utility.getContainerItem(tInput, true) };
tInput.stackSize -= 1;
updateSlots();
if (this.mEfficiencyIncrease > 5000) {
@@ -311,7 +292,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime));
this.mEUt = adjustEUtForConfig(getEUt());
this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease();
- this.mOutputItems = new ItemStack[] {GT_Utility.getContainerItem(tInput, true)};
+ this.mOutputItems = new ItemStack[] { GT_Utility.getContainerItem(tInput, true) };
tInput.stackSize -= 1;
updateSlots();
if (this.mEfficiencyIncrease > 5000) {
@@ -338,12 +319,11 @@ public abstract class GT_MetaTileEntity_LargeBoiler
@Override
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)));
+ if (this.mSuperEfficencyIncrease > 0) mEfficiency = Math.max(
+ 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;
@@ -422,8 +402,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasingAmount = 0;
mFireboxAmount = 0;
- return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0)
- && mCasingAmount >= 24
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 4, 0) && mCasingAmount >= 24
&& mFireboxAmount >= 3
&& mMaintenanceHatches.size() == 1
&& !mMufflerHatches.isEmpty();
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
index 970000da11..2effcf7966 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Bronze.java
@@ -1,10 +1,11 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.block.Block;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Bronze extends GT_MetaTileEntity_LargeBoiler {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
index bc30228b3a..c7bd766945 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Steel.java
@@ -1,12 +1,14 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.block.Block;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Steel extends GT_MetaTileEntity_LargeBoiler {
+
public GT_MetaTileEntity_LargeBoiler_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
index bda83f7210..61f2756622 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_Titanium.java
@@ -1,12 +1,14 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.block.Block;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_Titanium extends GT_MetaTileEntity_LargeBoiler {
+
public GT_MetaTileEntity_LargeBoiler_Titanium(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
index 3b73b4f407..f00ea287b2 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler_TungstenSteel.java
@@ -1,12 +1,14 @@
package gregtech.common.tileentities.machines.multi;
+import net.minecraft.block.Block;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import net.minecraft.block.Block;
public class GT_MetaTileEntity_LargeBoiler_TungstenSteel extends GT_MetaTileEntity_LargeBoiler {
+
public GT_MetaTileEntity_LargeBoiler_TungstenSteel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
pollutionPerSecond = GT_Mod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond;
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 ce1031e284..a6739e6fa2 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
@@ -7,10 +7,23 @@ import static gregtech.api.enums.GT_HatchElement.*;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import java.util.ArrayList;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IChatComponent;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.*;
import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.interfaces.IHeatingCoil;
@@ -23,51 +36,39 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Single_Recipe_Check;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.IChatComponent;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.FluidStack;
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(
+ 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();
+ .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;
@@ -88,63 +89,33 @@ public class GT_MetaTileEntity_LargeChemicalReactor
@Override
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")
+ 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")
.addCasingInfo("Chemically Inert Machine Casing", 8)
.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")
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[1][48]};
+ return new ITexture[] { casingTexturePages[1][48] };
}
@Override
@@ -187,15 +158,19 @@ public class GT_MetaTileEntity_LargeChemicalReactor
}
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;
}
if (mLockedToSingleRecipe) {
- mSingleRecipeCheck =
- tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build();
+ mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build();
}
}
@@ -232,8 +207,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
mCasingAmount = 0;
mCoilAmount = 0;
- return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0)
- && mCasingAmount >= 8
+ return checkPiece(STRUCTURE_PIECE_MAIN, 1, 1, 0) && mCasingAmount >= 8
&& mCoilAmount == 1
&& !mEnergyHatches.isEmpty()
&& mMaintenanceHatches.size() == 1;
@@ -268,6 +242,7 @@ public class GT_MetaTileEntity_LargeChemicalReactor
}
private enum CoilStructureElement implements IStructureElement<GT_MetaTileEntity_LargeChemicalReactor> {
+
INSTANCE;
@Override
@@ -282,15 +257,15 @@ public class GT_MetaTileEntity_LargeChemicalReactor
}
@Override
- public boolean spawnHint(
- GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z, ItemStack trigger) {
+ public boolean spawnHint(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z,
+ 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) {
+ public boolean placeBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y, int z,
+ ItemStack trigger) {
if (t.mCoilAmount > 0) return false;
boolean b = world.setBlock(x, y, z, GregTech_API.sBlockCasings5, 0, 3);
if (b) t.mCoilAmount++;
@@ -298,42 +273,23 @@ 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) {
+ public PlaceResult survivalPlaceBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y,
+ 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) {
- return BlocksToPlace.create(IntStream.range(0, 8)
- .mapToObj(i -> new ItemStack(GregTech_API.sBlockCasings5, 1, i))
- .collect(Collectors.toList()));
+ 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()));
}
@Override
- public PlaceResult survivalPlaceBlock(
- GT_MetaTileEntity_LargeChemicalReactor t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(GT_MetaTileEntity_LargeChemicalReactor t, World world, int x, int y,
+ 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;
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 84e6ab520c..0f700950f2 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
@@ -9,11 +9,25 @@ import static gregtech.api.enums.Textures.BlockIcons.TURBINE_NEW_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.TURBINE_NEW_EMPTY;
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.enums.Dyes;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -25,54 +39,36 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.LightingHelper;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gregtech.common.render.GT_RenderUtil;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.RenderBlocks;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.IBlockAccess;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-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<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>>() {
- @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();
- }
- };
+ private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_LargeTurbine>>() {
+
+ @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();
+ }
+ };
protected int baseEff = 0;
protected int optFlow = 0;
@@ -81,7 +77,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine
protected int counter = 0;
protected boolean looseFit = false;
protected int overflowMultiplier = 0;
- protected float[] flowMultipliers = new float[] {1, 1, 1};
+ protected float[] flowMultipliers = new float[] { 1, 1, 1 };
// client side stuff
protected boolean mHasTurbine;
@@ -106,8 +102,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1)
- && mMaintenanceHatches.size() == 1
+ return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1
&& mMufflerHatches.isEmpty() == (getPollutionPerTick(null) == 0);
}
@@ -136,7 +131,7 @@ public abstract class GT_MetaTileEntity_LargeTurbine
@Override
public boolean renderInWorld(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) {
if (!isNewStyleRendering() || !mMachine) return false;
- int[] tABCCoord = new int[] {-1, -1, 0};
+ int[] tABCCoord = new int[] { -1, -1, 0 };
int[] tXYZOffset = new int[3];
byte tFacing = getBaseMetaTileEntity().getFrontFacing();
ExtendedFacing tExtendedFacing = getExtendedFacing();
@@ -163,8 +158,12 @@ public abstract class GT_MetaTileEntity_LargeTurbine
int tZ = tXYZOffset[2] + aZ;
// 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));
+ Tessellator.instance.setBrightness(
+ tBlock.getMixedBrightnessForBlock(
+ aWorld,
+ aX + tDirection.offsetX,
+ tY + tDirection.offsetY,
+ aZ + tDirection.offsetZ));
tLighting.setupLighting(tBlock, tX, tY, tZ, tFacing).setupColor(tFacing, Dyes._NULL.mRGBa);
GT_RenderUtil.renderBlockIcon(
aRenderer,
@@ -217,32 +216,28 @@ public abstract class GT_MetaTileEntity_LargeTurbine
@Override
public boolean checkRecipe(ItemStack aStack) {
- if ((counter & 7) == 0
- && (aStack == null
- || !(aStack.getItem() instanceof GT_MetaGenerated_Tool)
- || aStack.getItemDamage() < 170
- || aStack.getItemDamage() > 179)) {
+ if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool)
+ || aStack.getItemDamage() < 170
+ || aStack.getItemDamage() > 179)) {
stopMachine();
return false;
}
ArrayList<FluidStack> tFluids = getStoredFluids();
if (!tFluids.isEmpty()) {
- if (baseEff == 0
- || optFlow == 0
+ if (baseEff == 0 || optFlow == 0
|| 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) Math.max(
- Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem())
- .getToolStats(aStack)
- .getSpeedMultiplier()
- * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed
- * 50));
+ 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));
overflowMultiplier = getOverflowMultiplier(aStack);
@@ -259,12 +254,10 @@ public abstract class GT_MetaTileEntity_LargeTurbine
}
}
- int newPower = fluidIntoPower(
- tFluids,
- optFlow,
- baseEff,
- overflowMultiplier,
- flowMultipliers); // How much the turbine should be producing with this flow
+ int newPower = fluidIntoPower(tFluids, optFlow, baseEff, overflowMultiplier, flowMultipliers); // How much the
+ // turbine should
+ // be producing
+ // with this flow
int difference = newPower - this.mEUt; // difference between current output and new output
// Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in
@@ -285,13 +278,13 @@ public abstract class GT_MetaTileEntity_LargeTurbine
} else {
this.mMaxProgresstime = 1;
this.mEfficiencyIncrease = 10;
- // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
+ // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
return true;
}
}
- abstract int fluidIntoPower(
- ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier, float[] flowMultipliers);
+ abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier,
+ float[] flowMultipliers);
abstract float getOverflowEfficiency(int totalFlow, int actualOptimalFlow, int overflowMultiplier);
@@ -351,26 +344,21 @@ public abstract class GT_MetaTileEntity_LargeTurbine
}
String tRunning = mMaxProgresstime > 0
- ? EnumChatFormatting.GREEN
- + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ EnumChatFormatting.RESET
- : EnumChatFormatting.RED
- + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ EnumChatFormatting.RESET;
String tMaintainance = getIdealStatus() == getRepairStatus()
- ? EnumChatFormatting.GREEN
- + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ EnumChatFormatting.RESET
- : EnumChatFormatting.RED
- + StatCollector.translateToLocal("GT5U.turbine.maintenance.true")
+ : 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));
+ tDura = GT_Utility.safeInt(
+ (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1])
+ * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1));
}
long storedEnergy = 0;
@@ -382,40 +370,64 @@ public abstract class GT_MetaTileEntity_LargeTurbine
}
}
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"))
- ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW
- + GT_Utility.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t";
+ ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": "
+ + EnumChatFormatting.YELLOW
+ + GT_Utility.safeInt((long) realOptFlow)
+ + EnumChatFormatting.RESET
+ + " L/t";
return ret;
}
public boolean hasTurbine() {
- return getBaseMetaTileEntity() != null && getBaseMetaTileEntity().isClientSide()
- ? mHasTurbine
+ return getBaseMetaTileEntity() != null && getBaseMetaTileEntity().isClientSide() ? mHasTurbine
: this.getMaxEfficiency(mInventory[1]) > 0;
}
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 ad56dd7be4..79078febec 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
@@ -2,6 +2,12 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
@@ -12,10 +18,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeTurbine {
@@ -28,49 +30,28 @@ 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]
- };
+ 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] };
}
@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")
+ 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")
- .addCasingInfo("Stainless Steel Turbine Casing", 24)
- .addDynamoHatch("Back center", 1)
- .addMaintenanceHatch("Side centered", 2)
- .addMufflerHatch("Side centered", 2)
- .addInputHatch("Gas Fuel, Side centered", 2)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, true)
+ .addController("Front center").addCasingInfo("Stainless Steel Turbine Casing", 24)
+ .addDynamoHatch("Back center", 1).addMaintenanceHatch("Side centered", 2)
+ .addMufflerHatch("Side centered", 2).addInputHatch("Gas Fuel, Side centered", 2)
.toolTipFinisher("Gregtech");
return tt;
}
@@ -113,19 +94,14 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT
}
@Override
- int fluidIntoPower(
- ArrayList<FluidStack> aFluids,
- int aOptFlow,
- int aBaseEff,
- int overflowMultiplier,
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier,
float[] flowMultipliers) {
if (aFluids.size() >= 1) {
int tEU = 0;
int actualOptimalFlow = 0;
- FluidStack firstFuelType = new FluidStack(
- aFluids.get(0),
- 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ 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);
if (aOptFlow < fuelValue) {
@@ -177,9 +153,9 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT
// EU/t output cap to properly tier the LGT against the Advanced LGT, will be implemented in a future dev
// update
- /*if (tEU > 8192) {
- tEU = 8192;
- }*/
+ /*
+ * if (tEU > 8192) { tEU = 8192; }
+ */
// If next output is above the maximum the dynamo can handle, set it to the maximum instead of exploding the
// turbine
@@ -203,9 +179,8 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT
float efficiency = 0;
if (totalFlow > actualOptimalFlow) {
- efficiency = 1.0f
- - Math.abs((totalFlow - actualOptimalFlow))
- / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1));
+ efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow))
+ / ((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 185da58b28..fbad39dd32 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
@@ -2,6 +2,12 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
@@ -12,12 +18,9 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntity_LargeTurbine {
+
public GT_MetaTileEntity_LargeTurbine_GasAdvanced(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -27,49 +30,27 @@ 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]
- };
+ 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] };
}
@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 ")
+ 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("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")
- .addCasingInfo("Advanced Gas Turbine Casing", 24)
- .addDynamoHatch("Back center", 1)
- .addMaintenanceHatch("Side centered", 2)
- .addMufflerHatch("Side centered", 2)
- .addInputHatch("Gas Fuel, Side centered", 2)
+ .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, true)
+ .addController("Front center").addCasingInfo("Advanced Gas Turbine Casing", 24)
+ .addDynamoHatch("Back center", 1).addMaintenanceHatch("Side centered", 2)
+ .addMufflerHatch("Side centered", 2).addInputHatch("Gas Fuel, Side centered", 2)
.toolTipFinisher("Gregtech");
return tt;
}
@@ -112,19 +93,14 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit
}
@Override
- int fluidIntoPower(
- ArrayList<FluidStack> aFluids,
- int aOptFlow,
- int aBaseEff,
- int overflowMultiplier,
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier,
float[] flowMultipliers) {
if (aFluids.size() >= 1) {
int tEU = 0;
int actualOptimalFlow = 0;
- FluidStack firstFuelType = new FluidStack(
- aFluids.get(0),
- 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ 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);
if (fuelValue < 100) {
@@ -200,9 +176,8 @@ public class GT_MetaTileEntity_LargeTurbine_GasAdvanced extends GT_MetaTileEntit
float efficiency = 0;
if (totalFlow > actualOptimalFlow) {
- efficiency = 1.0f
- - Math.abs((totalFlow - actualOptimalFlow))
- / ((float) actualOptimalFlow * ((overflowMultiplier * 3) - 1));
+ efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow))
+ / ((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 779de1a17a..a28c28518c 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
@@ -4,6 +4,14 @@ import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
import static gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine_Steam.calculateLooseFlow;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
@@ -13,12 +21,6 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_LargeTurbine {
@@ -34,49 +36,27 @@ 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]
- };
+ 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] };
}
@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")
+ 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")
- .addCasingInfo("Titanium Turbine Casing", 24)
- .addDynamoHatch("Back center", 1)
- .addMaintenanceHatch("Side centered", 2)
- .addInputHatch("Superheated Steam, Side centered", 2)
- .addOutputHatch("Steam, Side centered", 2)
- .toolTipFinisher("Gregtech");
+ .addInfo("Use screwdriver to adjust fitting of turbine").addSeparator()
+ .beginStructureBlock(3, 3, 4, true).addController("Front center")
+ .addCasingInfo("Titanium Turbine Casing", 24).addDynamoHatch("Back center", 1)
+ .addMaintenanceHatch("Side centered", 2).addInputHatch("Superheated Steam, Side centered", 2)
+ .addOutputHatch("Steam, Side centered", 2).toolTipFinisher("Gregtech");
return tt;
}
@@ -106,11 +86,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
}
@Override
- int fluidIntoPower(
- ArrayList<FluidStack> aFluids,
- int aOptFlow,
- int aBaseEff,
- int overflowEfficiency,
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency,
float[] flowMultipliers) {
if (looseFit) {
long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff);
@@ -145,13 +121,10 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
if (!achievement) {
try {
GT_Mod.achievements.issueAchievement(
- this.getBaseMetaTileEntity()
- .getWorld()
- .getPlayerEntityByName(
- this.getBaseMetaTileEntity().getOwnerName()),
+ this.getBaseMetaTileEntity().getWorld()
+ .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()),
"efficientsteam");
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
achievement = true;
}
} else if (GT_ModHandler.isAnySteam(aFluidStack)) {
@@ -164,8 +137,10 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
if (totalFlow == (GT_Utility.safeInt((long) realOptFlow))) {
tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L);
} else {
- float efficiency =
- getOverflowEfficiency(totalFlow, (GT_Utility.safeInt((long) realOptFlow)), overflowMultiplier);
+ float efficiency = getOverflowEfficiency(
+ totalFlow,
+ (GT_Utility.safeInt((long) realOptFlow)),
+ overflowMultiplier);
tEU *= efficiency;
tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L));
}
@@ -192,9 +167,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);
}
@@ -208,8 +182,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La
looseFit ^= true;
GT_Utility.sendChatToPlayer(
aPlayer,
- looseFit
- ? GT_Utility.trans("500", "Fitting: Loose - More Flow")
+ 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 272a3ddcc1..5479d277e2 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
@@ -2,6 +2,15 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -15,13 +24,6 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_LargeTurbine {
@@ -34,47 +36,26 @@ 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]
- };
+ 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] };
}
@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")
+ 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")
- .addCasingInfo("Tungstensteel Turbine Casing", 24)
- .addDynamoHatch("Back center", 1)
- .addMaintenanceHatch("Side centered", 2)
- .addInputHatch("Plasma Fluid, Side centered", 2)
- .addOutputHatch("Molten Fluid, optional, Side centered", 2)
- .toolTipFinisher("Gregtech");
+ .addInfo("Use your Fusion Reactor to produce the Plasma").addSeparator()
+ .beginStructureBlock(3, 3, 4, true).addController("Front center")
+ .addCasingInfo("Tungstensteel Turbine Casing", 24).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;
}
@@ -111,11 +92,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
}
@Override
- int fluidIntoPower(
- ArrayList<FluidStack> aFluids,
- int aOptFlow,
- int aBaseEff,
- int overflowMultiplier,
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowMultiplier,
float[] flowMultipliers) {
if (aFluids.size() >= 1) {
aOptFlow *= 800; // CHANGED THINGS HERE, check recipe runs once per 20 ticks
@@ -123,12 +100,11 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
int actualOptimalFlow = 0;
- FluidStack firstFuelType = new FluidStack(
- aFluids.get(0),
- 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest!
+ 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.
@@ -202,9 +178,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
float efficiency = 0;
if (totalFlow > actualOptimalFlow) {
- efficiency = 1.0f
- - Math.abs((totalFlow - actualOptimalFlow))
- / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1));
+ efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow))
+ / ((float) actualOptimalFlow * ((overflowMultiplier * 3) + 1));
} else {
efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow);
}
@@ -214,31 +189,28 @@ 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)) {
+ if ((counter & 7) == 0 && (aStack == null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool)
+ || aStack.getItemDamage() < 170
+ || aStack.getItemDamage() > 179)) {
stopMachine();
return false;
}
ArrayList<FluidStack> tFluids = getStoredFluids();
if (!tFluids.isEmpty()) {
- if (baseEff == 0
- || optFlow == 0
+ if (baseEff == 0 || optFlow == 0
|| 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) Math.max(
- Float.MIN_NORMAL,
- ((GT_MetaGenerated_Tool) aStack.getItem())
- .getToolStats(aStack)
- .getSpeedMultiplier()
- * ((GT_MetaGenerated_Tool) aStack.getItem()).getPrimaryMaterial(aStack).mToolSpeed
- * 50));
+ 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));
overflowMultiplier = getOverflowMultiplier(aStack);
flowMultipliers[0] = GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mSteamMultiplier;
@@ -254,12 +226,10 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
return false;
}
- int newPower = fluidIntoPower(
- tFluids,
- optFlow,
- baseEff,
- overflowMultiplier,
- flowMultipliers); // How much the turbine should be producing with this flow
+ int newPower = fluidIntoPower(tFluids, optFlow, baseEff, overflowMultiplier, flowMultipliers); // How much the
+ // turbine should
+ // be producing
+ // with this flow
int difference = newPower - this.mEUt; // difference between current output and new output
@@ -281,7 +251,7 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
} else {
this.mMaxProgresstime = 20;
this.mEfficiencyIncrease = 200;
- // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
+ // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here.
return true;
}
@@ -297,26 +267,21 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
}
String tRunning = mMaxProgresstime > 0
- ? EnumChatFormatting.GREEN
- + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true")
+ EnumChatFormatting.RESET
- : EnumChatFormatting.RED
- + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false")
+ EnumChatFormatting.RESET;
String tMaintainance = getIdealStatus() == getRepairStatus()
- ? EnumChatFormatting.GREEN
- + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false")
+ EnumChatFormatting.RESET
- : EnumChatFormatting.RED
- + StatCollector.translateToLocal("GT5U.turbine.maintenance.true")
+ : 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));
+ tDura = GT_Utility.safeInt(
+ (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1])
+ * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1])) + 1));
}
long storedEnergy = 0;
@@ -328,34 +293,59 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar
}
}
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 + Integer.toString(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
+ + Integer.toString(tDura)
+ + EnumChatFormatting.RESET
+ + "%", /* 7 */
+ StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": "
+ + EnumChatFormatting.GREEN
+ + mPollutionReduction
+ + EnumChatFormatting.RESET
+ + " %" /* 8 */
};
if (!this.getClass().getName().contains("Steam"))
- ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW
- + GT_Utility.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/s";
+ ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": "
+ + 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 b66bf85fb7..35deef3fed 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
@@ -4,6 +4,14 @@ import static gregtech.api.enums.GT_Values.STEAM_PER_WATER;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
@@ -13,12 +21,6 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_LargeTurbine {
@@ -35,48 +37,27 @@ 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]
- };
+ 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] };
}
@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")
+ 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")
- .addCasingInfo("Turbine Casing", 24)
- .addDynamoHatch("Back center", 1)
- .addMaintenanceHatch("Side centered", 2)
- .addInputHatch("Steam, Side centered", 2)
- .addOutputHatch("Distilled Water, Side centered", 2)
+ .addInfo("Use screwdriver to adjust fitting of turbine").addSeparator()
+ .beginStructureBlock(3, 3, 4, true).addController("Front center").addCasingInfo("Turbine Casing", 24)
+ .addDynamoHatch("Back center", 1).addMaintenanceHatch("Side centered", 2)
+ .addInputHatch("Steam, Side centered", 2).addOutputHatch("Distilled Water, Side centered", 2)
.toolTipFinisher("Gregtech");
return tt;
}
@@ -114,11 +95,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
}
@Override
- int fluidIntoPower(
- ArrayList<FluidStack> aFluids,
- int aOptFlow,
- int aBaseEff,
- int overflowEfficiency,
+ int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff, int overflowEfficiency,
float[] flowMultipliers) {
if (looseFit) {
long[] calculatedFlow = calculateLooseFlow(aOptFlow, aBaseEff);
@@ -142,9 +119,8 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
int remainingFlow = GT_Utility.safeInt((long) (realOptFlow * (0.5f * overflowMultiplier + 1)));
storedFluid = 0;
- for (int i = 0;
- i < aFluids.size() && remainingFlow > 0;
- i++) { // loop through each hatch; extract inputs and track totals.
+ for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and
+ // track totals.
final FluidStack aFluidStack = aFluids.get(i);
if (GT_ModHandler.isAnySteam(aFluidStack)) {
flow = Math.min(aFluidStack.amount, remainingFlow); // try to use up to the max flow defined just above
@@ -154,10 +130,8 @@ 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()),
+ this.getBaseMetaTileEntity().getWorld()
+ .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()),
"muchsteam");
achievement = true;
}
@@ -172,8 +146,10 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
if (totalFlow == (GT_Utility.safeInt((long) realOptFlow))) {
tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L);
} else {
- float efficiency =
- getOverflowEfficiency(totalFlow, (GT_Utility.safeInt((long) realOptFlow)), overflowMultiplier);
+ float efficiency = getOverflowEfficiency(
+ totalFlow,
+ (GT_Utility.safeInt((long) realOptFlow)),
+ overflowMultiplier);
tEU *= efficiency;
tEU = Math.max(1, GT_Utility.safeInt((long) tEU * (long) aBaseEff / 20000L));
}
@@ -199,9 +175,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);
}
@@ -249,8 +224,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg
looseFit ^= true;
GT_Utility.sendChatToPlayer(
aPlayer,
- looseFit
- ? GT_Utility.trans("500", "Fitting: Loose - More Flow")
+ 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 466e741fed..aec44c664d 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
@@ -11,10 +11,18 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
@@ -32,44 +40,37 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_StructureUtility;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
-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);
@@ -87,59 +88,26 @@ public class GT_MetaTileEntity_MultiFurnace
@Override
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")
- .addCasingInfo("Heat Proof Machine Casing", 8)
- .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");
+ 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").addCasingInfo("Heat Proof Machine Casing", 8)
+ .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) {
- 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()
- };
- 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()
- };
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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() };
+ 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() };
}
@Override
@@ -240,61 +208,87 @@ public class GT_MetaTileEntity_MultiFurnace
int tY = aBaseMetaTileEntity.getYCoord();
int tZ = aBaseMetaTileEntity.getZCoord() + zDir;
int tUsedMeta;
- for (int xPos = tX - 1; xPos <= tX + 1; xPos++)
- for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) {
- 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
- .getWorld()
- .setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3);
- }
+ for (int xPos = tX - 1; xPos <= tX + 1; xPos++) for (int zPos = tZ - 1; zPos <= tZ + 1; zPos++) {
+ 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.getWorld()
+ .setBlock(xPos, tY + 1, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3);
+ }
}
@Override
public String[] getInfoData() {
int mPollutionReduction = 0;
- for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches)
- if (isValidMetaTileEntity(tHatch))
- mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction);
+ for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) if (isValidMetaTileEntity(tHatch))
+ mPollutionReduction = Math.max(tHatch.calculatePollutionReduction(100), mPollutionReduction);
long storedEnergy = 0;
long maxEnergy = 0;
- for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) {
- storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
- maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity();
- }
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) if (isValidMetaTileEntity(tHatch)) {
+ storedEnergy += tHatch.getBaseMetaTileEntity().getStoredEU();
+ maxEnergy += tHatch.getBaseMetaTileEntity().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
@@ -306,8 +300,7 @@ public class GT_MetaTileEntity_MultiFurnace
if (aTileEntity == null) return false;
IMetaTileEntity tMTE = aTileEntity.getMetaTileEntity();
if (tMTE == null) return false;
- return tMTE instanceof GT_MetaTileEntity_Hatch_Energy
- || tMTE instanceof GT_MetaTileEntity_Hatch_InputBus
+ 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;
}
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 0694434137..ddb8e302e4 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
@@ -10,12 +10,23 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
+import java.util.ArrayList;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures.BlockIcons;
@@ -29,24 +40,16 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Casings8;
-import java.util.ArrayList;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-public class GT_MetaTileEntity_NanoForge
- extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_NanoForge>
- implements ISurvivalConstructable {
+public class GT_MetaTileEntity_NanoForge extends
+ 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 "," "," "},
@@ -134,17 +137,15 @@ public class GT_MetaTileEntity_NanoForge
{" 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;
private boolean mSeparate = false;
@@ -178,43 +179,21 @@ public class GT_MetaTileEntity_NanoForge
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ boolean aActive, boolean aRedstone) {
if (aSide == aFacing) {
- if (aActive)
- return new ITexture[] {
+ 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()
- };
+ 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
@@ -253,8 +232,8 @@ public class GT_MetaTileEntity_NanoForge
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;
@@ -266,7 +245,11 @@ public class GT_MetaTileEntity_NanoForge
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;
@@ -300,21 +283,18 @@ public class GT_MetaTileEntity_NanoForge
mSpecialTier = 1;
}
- if (aStack.isItemEqual(Materials.Neutronium.getNanite(1))
- && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1)
+ if (aStack.isItemEqual(Materials.Neutronium.getNanite(1)) && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1)
&& checkPiece(STRUCTURE_PIECE_TIER2, -7, 14, 4)) {
mSpecialTier = 2;
}
- if (aStack.isItemEqual(Materials.TranscendentMetal.getNanite(1))
- && checkPiece(STRUCTURE_PIECE_MAIN, 4, 37, 1)
+ 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)) {
mSpecialTier = 3;
}
- if (mMaintenanceHatches.size() != 1
- || mInputBusses.isEmpty()
+ if (mMaintenanceHatches.size() != 1 || mInputBusses.isEmpty()
|| mOutputBusses.isEmpty()
|| mInputHatches.isEmpty()) {
return false;
@@ -370,40 +350,32 @@ public class GT_MetaTileEntity_NanoForge
mSpecialTier = aNBT.getByte("mSpecialTier");
}
- /** Get possible alignments of this controller
+ /**
+ * Get possible alignments of this controller
*
* @return List of alignments that are possible or denied
*/
@Override
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();
+ return IAlignmentLimits.Builder.allowAll().deny(ForgeDirection.DOWN).deny(ForgeDirection.UP)
+ .deny(Rotation.UPSIDE_DOWN).deny(Rotation.CLOCKWISE).deny(Rotation.COUNTER_CLOCKWISE).build();
}
@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")
+ 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("controller slot controls the tier.").addInfo("--------------------------------------------")
.addInfo("Requires a Carbon Nanite to use tier 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)
+ .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)
@@ -423,21 +395,50 @@ public class GT_MetaTileEntity_NanoForge
.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
+ + "-"
+ + 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");
+ .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;
}
@@ -445,6 +446,7 @@ public class GT_MetaTileEntity_NanoForge
public final void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
mSeparate = !mSeparate;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
}
}
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 3f64dd2e2a..becb1fcf47 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
@@ -10,10 +10,18 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_OIL_CRACKER_G
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
import static gregtech.api.util.GT_StructureUtility.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_HatchElement;
import gregtech.api.enums.HeatingCoilLevel;
@@ -28,69 +36,58 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_OilCracker>
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(
+ 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(
+ .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)
+ .addElement(
+ 'm',
+ buildHatchAdder(
+ GT_MetaTileEntity_OilCracker.class)
.atLeast(
- GT_HatchElement.InputHatch.withAdder(
+ 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();
+ .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
@@ -109,68 +106,39 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult
@Override
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")
+ 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")
+ .addInfo("Place the appropriate circuit in the controller").addSeparator()
+ .beginStructureBlock(5, 3, 3, true).addController("Front center")
.addCasingInfo("Clean Stainless Steel Machine Casing", 18)
.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)
+ .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)
+ .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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {casingTexturePages[0][CASING_INDEX]};
+ return new ITexture[] { casingTexturePages[0][CASING_INDEX] };
}
@Override
@@ -185,13 +153,12 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult
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],
- tFluidInputs,
- mInventory[1]);
+ GT_Recipe tRecipe = getRecipeMap().findRecipe(
+ getBaseMetaTileEntity(),
+ false,
+ gregtech.api.enums.GT_Values.V[tTier],
+ tFluidInputs,
+ mInventory[1]);
if (tRecipe == null) return false;
@@ -211,7 +178,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult
if (this.mEUt > 0) this.mEUt = (-this.mEUt);
- this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
return true;
}
return false;
@@ -303,8 +270,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult
mInputOnSide = -1;
mOutputOnSide = -1;
replaceDeprecatedCoils(aBaseMetaTileEntity);
- return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0)
- && mInputOnSide != -1
+ return checkPiece(STRUCTURE_PIECE_MAIN, 2, 1, 0) && mInputOnSide != -1
&& mOutputOnSide != -1
&& mCasingAmount >= 18
&& mMaintenanceHatches.size() == 1
@@ -351,8 +317,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_EnhancedMult
if (tUsedMeta > 14) continue;
if (aBaseMetaTileEntity.getBlock(xPos, yPos, zPos) != GregTech_API.sBlockCasings1) continue;
- aBaseMetaTileEntity
- .getWorld()
+ aBaseMetaTileEntity.getWorld()
.setBlock(xPos, yPos, zPos, GregTech_API.sBlockCasings5, tUsedMeta - 12, 3);
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
index 610c21e89b..1e37dcbac9 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill1.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OilDrill1 extends GT_MetaTileEntity_OilDrillBase {
+
public GT_MetaTileEntity_OilDrill1(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
index 31fc763da7..10a64a6b1d 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill2.java
@@ -9,6 +9,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_OilDrill2 extends GT_MetaTileEntity_OilDrillBase {
+
public GT_MetaTileEntity_OilDrill2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
index 303502e1ce..bcbe42d794 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill3.java
@@ -9,6 +9,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_OilDrill3 extends GT_MetaTileEntity_OilDrillBase {
+
public GT_MetaTileEntity_OilDrill3(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
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 72741573fd..dc56ffcb3f 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
@@ -10,18 +10,10 @@ import static gregtech.api.enums.Textures.BlockIcons.getCasingTextureForId;
import static gregtech.common.GT_UndergroundOil.undergroundOil;
import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation;
-import com.google.common.collect.ImmutableList;
-import gregtech.api.interfaces.IHatchElement;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.objects.GT_ChunkManager;
-import gregtech.api.render.TextureFactory;
-import gregtech.api.util.GT_Log;
-import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import gregtech.api.util.GT_Utility;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -33,7 +25,19 @@ import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
+import com.google.common.collect.ImmutableList;
+
+import gregtech.api.interfaces.IHatchElement;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_ChunkManager;
+import gregtech.api.render.TextureFactory;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_Utility;
+
public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_DrillerBase {
+
private final ArrayList<Chunk> mOilFieldChunks = new ArrayList<>();
private int mOilId = 0;
private int mOilFlow = 0;
@@ -49,41 +53,17 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {getCasingTextureForId(casingTextureIndex)};
+ return new ITexture[] { getCasingTextureForId(casingTextureIndex) };
}
@Override
@@ -110,20 +90,15 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
.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
+ .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")
+ .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)
+ .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");
+ .addOutputHatch("Any base casing", 1).toolTipFinisher("Gregtech");
return tt;
}
@@ -147,7 +122,9 @@ 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"
+ StatCollector.translateToLocal("GT5U.machines.workareaset") + " "
+ + chunkRangeConfig
+ + "x"
+ chunkRangeConfig
+ StatCollector.translateToLocal("GT5U.machines.chunks")); // TODO Add translation support
}
@@ -170,10 +147,8 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
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);
+ (workState == STATE_AT_BOTTOM ? (64 * (chunkRangeConfig * chunkRangeConfig)) >> (getMinTier() - 1)
+ : 120) >> tier);
}
protected float computeSpeed() {
@@ -181,8 +156,8 @@ 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) {
+ protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
switch (tryLowerPipeState(true)) {
case 0:
workState = STATE_DOWNWARD;
@@ -202,7 +177,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
float speed = computeSpeed();
FluidStack tFluid = pumpOil(speed);
if (tFluid != null && tFluid.amount > getTotalConfigValue()) {
- this.mOutputFluids = new FluidStack[] {tFluid};
+ this.mOutputFluids = new FluidStack[] { tFluid };
return true;
}
}
@@ -225,21 +200,22 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
tOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0);
if (mOilFieldChunks.isEmpty()) {
- Chunk tChunk = getBaseMetaTileEntity()
- .getWorld()
- .getChunkFromBlockCoords(
- getBaseMetaTileEntity().getXCoord(),
- getBaseMetaTileEntity().getZCoord());
+ Chunk tChunk = getBaseMetaTileEntity().getWorld()
+ .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.
+ int xChunk = Math.floorDiv(tChunk.xPosition, range) * range; // Java was written by idiots. For negative
+ // values, / returns rounded towards zero.
// Fucking morons.
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);
+ GT_Log.out.println(
+ "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++) {
@@ -249,8 +225,7 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(xChunk + i, zChunk + j);
tFluid = undergroundOilReadInformation(tChunk);
if (debugDriller) {
- GT_Log.out.println(
- " Fluid in chunk = " + tFluid.getFluid().getID());
+ GT_Log.out.println(" Fluid in chunk = " + tFluid.getFluid().getID());
}
if (tOil.isFluidEqual(tFluid) && tFluid.amount > 0) {
mOilFieldChunks.add(tChunk);
@@ -280,8 +255,10 @@ public abstract class GT_MetaTileEntity_OilDrillBase extends GT_MetaTileEntity_D
for (Chunk tChunk : mOilFieldChunks) {
tFluid = undergroundOil(tChunk, speed);
if (debugDriller) {
- GT_Log.out.println(" chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos + " chunkZ = "
- + tChunk.getChunkCoordIntPair().chunkZPos);
+ GT_Log.out.println(
+ " chunkX = " + tChunk.getChunkCoordIntPair().chunkXPos
+ + " chunkZ = "
+ + tChunk.getChunkCoordIntPair().chunkZPos);
if (tFluid != null) {
GT_Log.out.println(" Fluid pumped = " + tFluid.amount);
} else {
@@ -300,18 +277,26 @@ 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"));
+ 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"));
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 6fa7c00f0f..e54fcbbd28 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
@@ -2,15 +2,17 @@ package gregtech.common.tileentities.machines.multi;
import static gregtech.api.enums.GT_Values.VN;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDrillBase {
+
public GT_MetaTileEntity_OilDrillInfinite(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -24,20 +26,15 @@ public class GT_MetaTileEntity_OilDrillInfinite extends GT_MetaTileEntity_OilDri
String casings = getCasingBlockItem().get(0).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")
+ 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)
+ .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");
+ .addOutputHatch("Any base casing", 1).toolTipFinisher("Gregtech");
return tt;
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
index 859f826320..50edf8928a 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant1.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant1 extends GT_MetaTileEntity_OreDrillingPlantBase {
+
public GT_MetaTileEntity_OreDrillingPlant1(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
mTier = 1;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
index e178bdab83..6a80c96d26 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant2.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant2 extends GT_MetaTileEntity_OreDrillingPlantBase {
+
public GT_MetaTileEntity_OreDrillingPlant2(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
mTier = 2;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
index b8ac96a8a7..2bb25b2254 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant3.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant3 extends GT_MetaTileEntity_OreDrillingPlantBase {
+
public GT_MetaTileEntity_OreDrillingPlant3(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
mTier = 3;
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
index e4a3da16ac..7ba26b9500 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlant4.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
public class GT_MetaTileEntity_OreDrillingPlant4 extends GT_MetaTileEntity_OreDrillingPlantBase {
+
public GT_MetaTileEntity_OreDrillingPlant4(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
mTier = 4;
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 80b3660eb3..1f5bdf690e 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
@@ -5,24 +5,12 @@ import static gregtech.api.enums.GT_HatchElement.Energy;
import static gregtech.api.enums.GT_HatchElement.Maintenance;
import static gregtech.api.enums.GT_Values.VN;
-import com.google.common.collect.ImmutableList;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IHatchElement;
-import gregtech.api.objects.GT_ChunkManager;
-import gregtech.api.objects.ItemData;
-import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.blocks.GT_Block_Ores_Abstract;
-import gregtech.common.blocks.GT_TileEntity_Ores;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -34,7 +22,23 @@ import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.ChunkPosition;
import net.minecraftforge.fluids.FluidStack;
+import com.google.common.collect.ImmutableList;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IHatchElement;
+import gregtech.api.objects.GT_ChunkManager;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.blocks.GT_Block_Ores_Abstract;
+import gregtech.common.blocks.GT_TileEntity_Ores;
+
public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTileEntity_DrillerBase {
+
private final ArrayList<ChunkPosition> oreBlockPositions = new ArrayList<>();
protected int mTier = 1;
private int chunkRadiusConfig = getRadiusInChunks();
@@ -82,21 +86,23 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
}
GT_Utility.sendChatToPlayer(
aPlayer,
- StatCollector.translateToLocal("GT5U.machines.workareaset") + " " + (chunkRadiusConfig << 4) + " "
+ 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) {
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
replaceWithCobblestone = !replaceWithCobblestone;
GT_Utility.sendChatToPlayer(aPlayer, "Replace with cobblestone " + replaceWithCobblestone);
return true;
}
@Override
- protected boolean workingDownward(
- ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) {
+ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
if (yHead != oldYHead) oreBlockPositions.clear();
if (mWorkChunkNeedsReload && mChunkLoadingEnabled) { // ask to load machine itself
@@ -152,12 +158,10 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
Collection<ItemStack> oreBlockDrops = getBlockDrops(oreBlock, x, y, z);
ItemStack cobble = GT_Utility.getCobbleForOre(oreBlock, metaData);
if (replaceWithCobblestone) {
- getBaseMetaTileEntity()
- .getWorld()
+ getBaseMetaTileEntity().getWorld()
.setBlock(x, y, z, Block.getBlockFromItem(cobble.getItem()), cobble.getItemDamage(), 3);
} else {
- getBaseMetaTileEntity()
- .getWorld()
+ getBaseMetaTileEntity().getWorld()
.setBlockToAir(oreBlockPos.chunkPosX, oreBlockPos.chunkPosY, oreBlockPos.chunkPosZ);
}
mOutputItems = getOutputByDrops(oreBlockDrops);
@@ -166,8 +170,8 @@ 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) {
+ protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
if (!mChunkLoadingEnabled)
return super.workingAtBottom(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead);
@@ -198,15 +202,16 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
// use corner closest to the drill as mining area center
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);
+ mCurrentChunk = new ChunkCoordIntPair(
+ 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) {
+ protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe,
+ int yHead, int oldYHead) {
if (!mChunkLoadingEnabled || oreBlockPositions.isEmpty())
return super.workingUpward(aStack, xDrill, yDrill, zDrill, xPipe, zPipe, yHead, oldYHead);
boolean result = processOreList();
@@ -244,15 +249,14 @@ 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()
+ return !mMaintenanceHatches.isEmpty() && !mInputHatches.isEmpty()
&& !mOutputBusses.isEmpty()
&& !mEnergyHatches.isEmpty();
}
@@ -268,9 +272,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
this.mEfficiencyIncrease = 10000;
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);
+ this.mMaxProgresstime = ((workState == STATE_DOWNWARD || workState == STATE_AT_BOTTOM) ? getBaseProgressTime()
+ : 80) / (1 << tier);
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
}
@@ -282,8 +285,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;
@@ -300,16 +303,14 @@ 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;
+ 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;
}
private ItemStack multiplyStackSize(ItemStack itemStack) {
@@ -355,9 +356,8 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
for (int z = startZ; z < (startZ + 16); ++z) tryAddOreBlockToMineList(x, yHead, z);
} else {
int radius = chunkRadiusConfig << 4;
- for (int xOff = -radius; xOff <= radius; xOff++)
- for (int zOff = -radius; zOff <= radius; zOff++)
- tryAddOreBlockToMineList(xDrill + xOff, yHead, zDrill + zOff);
+ for (int xOff = -radius; xOff <= radius; xOff++) for (int zOff = -radius; zOff <= radius; zOff++)
+ tryAddOreBlockToMineList(xDrill + xOff, yHead, zDrill + zOff);
}
}
@@ -390,18 +390,14 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile
.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")
+ .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)
+ .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)
+ .addInputHatch("Drilling Fluid, any base casing", 1).addOutputBus("Any base casing", 1)
.toolTipFinisher("Gregtech");
return tt;
}
@@ -410,11 +406,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 06969bb55b..fb16756d40 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
@@ -10,6 +10,18 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofFrame;
+import java.util.ArrayList;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.alignment.enumerable.Flip;
@@ -30,6 +42,7 @@ import com.gtnewhorizons.modularui.common.widget.DynamicPositionedRow;
import com.gtnewhorizons.modularui.common.widget.MultiChildWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -53,21 +66,11 @@ import gregtech.api.util.GT_ParallelHelper;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Block_Casings8;
-import java.util.ArrayList;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
@SuppressWarnings("SpellCheckingInspection")
-public class GT_MetaTileEntity_PCBFactory
- extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_PCBFactory>
- implements ISurvivalConstructable {
+public class GT_MetaTileEntity_PCBFactory extends
+ GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GT_MetaTileEntity_PCBFactory> implements ISurvivalConstructable {
+
private static final String tier1 = "tier1";
private static final String tier2 = "tier2";
private static final String tier3 = "tier3";
@@ -78,9 +81,8 @@ public class GT_MetaTileEntity_PCBFactory
private float mRoughnessMultiplier = 1;
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};
+ private int[] mBioOffsets = new int[] { -5, -1 }, mOCTier1Offsets = 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;
@@ -90,10 +92,12 @@ public class GT_MetaTileEntity_PCBFactory
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"},
@@ -101,9 +105,11 @@ public class GT_MetaTileEntity_PCBFactory
{"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"," "},
@@ -112,9 +118,11 @@ public class GT_MetaTileEntity_PCBFactory
{"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 "," "," "," "},
@@ -138,9 +146,11 @@ public class GT_MetaTileEntity_PCBFactory
{" "," 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"},
@@ -149,9 +159,12 @@ public class GT_MetaTileEntity_PCBFactory
{"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"},
@@ -163,9 +176,11 @@ public class GT_MetaTileEntity_PCBFactory
{"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"},
@@ -177,61 +192,50 @@ public class GT_MetaTileEntity_PCBFactory
{"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("IC2", "blockAlloyGlass", 0, true),
- ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true),
- ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks2", 0, true),
- // warded glass
- ofBlockUnlocalizedName("Thaumcraft", "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("IC2", "blockAlloyGlass", 0, true),
+ ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks", 0, true),
+ ofBlockUnlocalizedName("bartworks", "BW_GlasBlocks2", 0, true),
+ // warded glass
+ ofBlockUnlocalizedName("Thaumcraft", "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) {
@@ -247,20 +251,19 @@ public class GT_MetaTileEntity_PCBFactory
if (mBioUpgrade) {
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);
+ getStructureDefinition().buildOrHints(
+ 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]);
}
@@ -290,25 +293,32 @@ public class GT_MetaTileEntity_PCBFactory
if (mBioUpgrade) {
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);
+ getStructureDefinition().survivalBuild(
+ 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);
+ bioUpgrade,
+ stackSize,
+ mBioOffsets[0],
+ 6,
+ mBioOffsets[1],
+ elementBudget,
+ env,
+ false,
+ true);
}
}
@@ -354,52 +364,26 @@ public class GT_MetaTileEntity_PCBFactory
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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)
+ 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(),
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW)
- .extFacing()
- .glow()
- .build()
- };
+ 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(
- 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))
- };
+ return new ITexture[] { BlockIcons.getCasingTextureForId(
+ mSetTier < 3 ? ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(11)
+ : ((GT_Block_Casings8) GregTech_API.sBlockCasings8).getTextureIndex(13)) };
}
@Override
@@ -434,19 +418,18 @@ public class GT_MetaTileEntity_PCBFactory
if (mBioUpgrade) {
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)) {
+ if (!getStructureDefinition().check(
+ this,
+ bioUpgrade,
+ tTile.getWorld(),
+ transformFacing(getExtendedFacing()),
+ tTile.getXCoord(),
+ tTile.getYCoord(),
+ tTile.getZCoord(),
+ mBioOffsets[1],
+ 6,
+ mBioOffsets[0],
+ !mMachine)) {
return false;
}
} else {
@@ -479,8 +462,7 @@ public class GT_MetaTileEntity_PCBFactory
getBaseMetaTileEntity().sendBlockEvent(GregTechTileClientEvents.CHANGE_CUSTOM_DATA, getUpdateData());
- if (mMaintenanceHatches.size() != 1
- || mOutputBusses.isEmpty()
+ if (mMaintenanceHatches.size() != 1 || mOutputBusses.isEmpty()
|| mInputBusses.isEmpty()
|| mInputHatches.isEmpty()) {
return false;
@@ -521,8 +503,8 @@ public class GT_MetaTileEntity_PCBFactory
return false;
}
- private boolean processRecipe(
- ItemStack aStack, ItemStack[] aItemInputs, FluidStack[] aFluidInputs, GT_Recipe.GT_Recipe_Map aMap) {
+ private boolean processRecipe(ItemStack aStack, ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
+ GT_Recipe.GT_Recipe_Map aMap) {
mOutputItems = null;
mOutputFluids = null;
if (aItemInputs == null || aFluidInputs == null) {
@@ -533,8 +515,8 @@ public class GT_MetaTileEntity_PCBFactory
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;
@@ -562,20 +544,14 @@ public class GT_MetaTileEntity_PCBFactory
}
boolean recipeAllowed = (((recipeBitMap & mTier1BitMap) == mTier1BitMap && (mTier >= 1))
- || ((recipeBitMap & mTier2BitMap) == mTier2BitMap && (mTier >= 2))
- || ((recipeBitMap & mTier3BitMap) == mTier3BitMap && (mTier >= 3)))
+ || ((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();
+ GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs)
+ .setFluidInputs(aFluidInputs).setMaxParallel(aMaxParallel).setAvailableEUt(getMaxInputEu())
+ .setEUtModifier(aExtraPower).enableConsumption().build();
mCurrentParallel = helper.getCurrentParallel();
if (mCurrentParallel > 0) {
@@ -585,13 +561,9 @@ public class GT_MetaTileEntity_PCBFactory
this.mMaxProgresstime = (int) Math.ceil(tRecipe.mDuration * Math.pow(mRoughnessMultiplier, 2));
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));
+ GT_OverclockCalculator calc = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt)
+ .setDuration(tRecipe.mDuration).setEUt(voltage).setAmperage(amps)
+ .setEUtDiscount(aExtraPower).setSpeedBoost((float) Math.pow(mRoughnessMultiplier, 2));
if (mOCTier2) {
calc.enablePerfectOC();
}
@@ -755,8 +727,7 @@ public class GT_MetaTileEntity_PCBFactory
break;
}
} else if (curRotation == Rotation.CLOCKWISE || curRotation == Rotation.COUNTER_CLOCKWISE) {
- newFlip = curRotation == Rotation.CLOCKWISE
- ? curFlip == Flip.NONE ? Flip.NONE : Flip.HORIZONTAL
+ newFlip = curRotation == Rotation.CLOCKWISE ? curFlip == Flip.NONE ? Flip.NONE : Flip.HORIZONTAL
: curFlip != Flip.NONE ? Flip.NONE : Flip.HORIZONTAL;
newDirection = curRotation == Rotation.CLOCKWISE ? ForgeDirection.UP : ForgeDirection.DOWN;
} else {
@@ -806,8 +777,8 @@ public class GT_MetaTileEntity_PCBFactory
}
@Override
- protected void calculateOverclockedNessMultiInternal(
- long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) {
+ protected void calculateOverclockedNessMultiInternal(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
+ boolean perfectOC) {
int hatches = Math.max(getExoticEnergyHatches().size(), 1);
long zMaxInputVoltage = maxInputVoltage;
long zTime = aDuration;
@@ -853,7 +824,8 @@ public class GT_MetaTileEntity_PCBFactory
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
mSeparate = !mSeparate;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
}
@Override
@@ -877,42 +849,73 @@ public class GT_MetaTileEntity_PCBFactory
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
- + Float.toString(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
+ + Float.toString(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.")
+ 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.")
@@ -925,46 +928,74 @@ public class GT_MetaTileEntity_PCBFactory
.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()
+ .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(
+ "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 + "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.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 + "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 + "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.BLUE + "Liquid Cooling Tower (Tier "
+ + EnumChatFormatting.DARK_PURPLE
+ + 1
+ + EnumChatFormatting.BLUE
+ + "):")
.addStructureInfo(
EnumChatFormatting.GOLD + "40" + EnumChatFormatting.GRAY + " Damascus Steel Frame Box")
.addStructureInfo(
@@ -973,13 +1004,21 @@ public class GT_MetaTileEntity_PCBFactory
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 + "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 + "41"
+ + EnumChatFormatting.GRAY
+ + " Reinforced Photolithography Framework Casing")
.addStructureInfo(
EnumChatFormatting.GOLD + "8" + EnumChatFormatting.GRAY + " Superconducting Coil Block")
.addStructureInfo(
@@ -1069,100 +1108,85 @@ public class GT_MetaTileEntity_PCBFactory
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
super.addUIWidgets(builder, buildContext);
buildContext.addSyncedWindow(10, this::createConfigurationWindow);
- builder.widget(new ButtonWidget()
- .setOnClick((clickData, widget) -> {
- if (!widget.isClient()) widget.getContext().openSyncedWindow(10);
- })
- .setSize(18, 18)
- .setBackground(GT_UITextures.BUTTON_STANDARD)
- .setBackground(GT_UITextures.OVERLAY_BUTTON_CYCLIC)
- .addTooltip("Configuration Menu")
+ builder.widget(
+ new ButtonWidget().setOnClick(
+ (clickData, widget) -> { if (!widget.isClient()) widget.getContext().openSyncedWindow(10); })
+ .setSize(18, 18).setBackground(GT_UITextures.BUTTON_STANDARD)
+ .setBackground(GT_UITextures.OVERLAY_BUTTON_CYCLIC).addTooltip("Configuration Menu")
.setPos(151, 24))
- .widget(new TextWidget(new Text("Tier"))
- .setTextAlignment(Alignment.Center)
- .setScale(0.91f)
- .setSize(20, 16)
- .setPos(152, 46))
- .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(151, 61));
+ .widget(
+ new TextWidget(new Text("Tier")).setTextAlignment(Alignment.Center).setScale(0.91f)
+ .setSize(20, 16).setPos(152, 46))
+ .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(151, 61));
}
protected ModularWindow createConfigurationWindow(final EntityPlayer player) {
ModularWindow.Builder builder = ModularWindow.builder(200, 160);
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))
+ 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 -> {
+ .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"));
+ 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 -> {
+ }).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(
@@ -1173,22 +1197,20 @@ public class GT_MetaTileEntity_PCBFactory
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 -> {
+ }).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(
@@ -1199,128 +1221,100 @@ public class GT_MetaTileEntity_PCBFactory
player,
GT_Utility.trans("342", "Tier 2 cooling enabled"));
}
- })
- .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE)
- .setSize(90, 18)
+ }).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(
- "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 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 60f168e05d..c231c6e935 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
@@ -8,10 +8,22 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofCoil;
import static java.lang.Math.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.Materials;
@@ -26,15 +38,6 @@ import gregtech.api.util.GT_ExoticEnergyInputHelper;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.ChunkCoordIntPair;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMultiFurnace<GT_MetaTileEntity_PlasmaForge>
implements ISurvivalConstructable {
@@ -44,12 +47,9 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul
private static final double maximum_discount = 0.5d;
// 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),
- };
+ private static final FluidStack[] valid_fuels = { Materials.ExcitedDTEC.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);
@@ -72,865 +72,402 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul
@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 ",
- }
- };
+ { " ", " 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;
@@ -939,31 +476,19 @@ 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) {
@@ -988,42 +513,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(
+ "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)
+ .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(
+ 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
+ + "-"
+ + 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");
+ .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;
}
@@ -1034,33 +604,16 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- return new ITexture[] {
- casingTexturePages[0][DIM_BRIDGE_CASING],
- TextureFactory.builder().addIcon(OVERLAY_DTPF_OFF).extFacing().build()
- };
+ 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() };
+ return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING],
+ TextureFactory.builder().addIcon(OVERLAY_DTPF_OFF).extFacing().build() };
}
- return new ITexture[] {casingTexturePages[0][DIM_BRIDGE_CASING]};
+ return new ITexture[] { casingTexturePages[0][DIM_BRIDGE_CASING] };
}
@Override
@@ -1101,8 +654,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;
@@ -1114,8 +667,7 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul
GT_Recipe tRecipe_1 = tRecipe_0.copy();
// Break out to the outermost for loop when fuel found and discounted. Only 1 fuel per recipe is intended.
- outside:
- for (int i = 0; i < tRecipe_0.mFluidInputs.length; i++) {
+ outside: for (int i = 0; i < tRecipe_0.mFluidInputs.length; i++) {
for (FluidStack fuel : valid_fuels) {
if (tRecipe_1.mFluidInputs[i].isFluidEqual(fuel)) {
// If running for max_efficiency_time_in_ticks then discount is at maximum.
@@ -1257,37 +809,63 @@ public class GT_MetaTileEntity_PlasmaForge extends GT_MetaTileEntity_AbstractMul
}
}
- 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 + "%",
- "-----------------------------------------"
- };
+ 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
+ + "%",
+ "-----------------------------------------" };
}
public List<GT_MetaTileEntity_Hatch> getExoticAndNormalEnergyHatchList() {
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 40754c14c5..67afa63df8 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
@@ -3,6 +3,13 @@ package gregtech.common.tileentities.machines.multi;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
import com.gtnewhorizon.structurelib.StructureLibAPI;
import com.gtnewhorizon.structurelib.alignment.IAlignment;
import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits;
@@ -15,6 +22,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
@@ -34,37 +42,28 @@ import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
import gregtech.common.GT_Pollution;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEntity
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<IStructureDefinition<GT_MetaTileEntity_PrimitiveBlastFurnace>>() {
- @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();
- }
- };
+ private static final ClassValue<IStructureDefinition<GT_MetaTileEntity_PrimitiveBlastFurnace>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GT_MetaTileEntity_PrimitiveBlastFurnace>>() {
+
+ @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();
+ }
+ };
public int mMaxProgresstime = 0;
private volatile boolean mUpdated;
@@ -197,8 +196,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
@Override
public ExtendedFacing getExtendedFacing() {
- return ExtendedFacing.of(
- ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()));
+ return ExtendedFacing.of(ForgeDirection.getOrientation(getBaseMetaTileEntity().getFrontFacing()));
}
@Override
@@ -212,20 +210,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);
+ return STRUCTURE_DEFINITION.get(this.getClass()).check(
+ this,
+ "main",
+ getBaseMetaTileEntity().getWorld(),
+ getExtendedFacing(),
+ getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord(),
+ 1,
+ 2,
+ 0,
+ !mMachine);
}
protected abstract Block getCasingBlock();
@@ -243,15 +239,13 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
final int lavaZ = aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1);
if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) {
- new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setMotion(0D, 0.3D, 0D)
+ 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();
+ .setWorld(getBaseMetaTileEntity().getWorld()).run();
}
if (aBaseMetaTileEntity.isServerSide()) {
if (mUpdated) {
@@ -270,8 +264,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
this.mProgresstime = 0;
this.mMaxProgresstime = 0;
GT_Mod.achievements.issueAchievement(
- aBaseMetaTileEntity
- .getWorld()
+ aBaseMetaTileEntity.getWorld()
.getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()),
"steel");
}
@@ -281,7 +274,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));
@@ -318,11 +312,9 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
}
/**
- * Draws random flames and smoke particles in front of Primitive Blast
- * Furnace when active
+ * Draws random flames and smoke particles in front of Primitive Blast Furnace when active
*
- * @param aBaseMetaTileEntity The entity that will handle the
- * {@link Block#randomDisplayTick}
+ * @param aBaseMetaTileEntity The entity that will handle the {@link Block#randomDisplayTick}
*/
@SideOnly(Side.CLIENT)
@Override
@@ -356,10 +348,8 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
z = oZ + offset;
}
- ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
- .setMotion(0D, 0D, 0D)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld());
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(0D, 0D, 0D)
+ .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.SMOKE).run();
particleEventBuilder.setIdentifier(ParticleFX.FLAME).run();
}
@@ -397,7 +387,7 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
return true;
}
return ((this.mInventory[absoluteSlot].stackSize + outputStack.stackSize
- <= this.mInventory[absoluteSlot].getMaxStackSize())
+ <= this.mInventory[absoluteSlot].getMaxStackSize())
&& (GT_Utility.areStacksEqual(this.mInventory[absoluteSlot], outputStack)));
}
@@ -459,23 +449,21 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
@Override
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);
+ return STRUCTURE_DEFINITION.get(getClass()).survivalBuild(
+ this,
+ stackSize,
+ "main",
+ getBaseMetaTileEntity().getWorld(),
+ getExtendedFacing(),
+ getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord(),
+ 1,
+ 2,
+ 0,
+ elementBudget,
+ env,
+ false);
}
@Override
@@ -485,21 +473,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);
+ STRUCTURE_DEFINITION.get(getClass()).buildOrHints(
+ this,
+ stackSize,
+ "main",
+ getBaseMetaTileEntity().getWorld(),
+ getExtendedFacing(),
+ getBaseMetaTileEntity().getXCoord(),
+ getBaseMetaTileEntity().getYCoord(),
+ getBaseMetaTileEntity().getZCoord(),
+ 1,
+ 2,
+ 0,
+ hintsOnly);
}
@Override
@@ -509,45 +495,40 @@ public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace extends MetaTileEn
@Override
public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) {
- 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(
+ 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(103, 24))
- .widget(new SlotWidget(inventoryHandler, 5)
- .setAccess(true, false)
- .setBackground(
+ GT_UITextures.OVERLAY_SLOT_DUST_STEAM.get(getSteamVariant())).setPos(33, 33))
+ .widget(
+ new SlotWidget(inventoryHandler, 2).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));
+ 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 f36ba2853b..a53288d50c 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
@@ -12,8 +12,22 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_AR
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PROCESSING_ARRAY_GLOW;
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraftforge.fluids.FluidStack;
+
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
+
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -33,17 +47,6 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Single_Recipe_Check_Processing_Array;
import gregtech.api.util.GT_Utility;
import gregtech.common.blocks.GT_Item_Machines;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Stream;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_ProcessingArray
extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_ProcessingArray> {
@@ -75,25 +78,17 @@ public class GT_MetaTileEntity_ProcessingArray
@Override
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")
+ 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")
- .addCasingInfo("Robust Tungstensteel Machine Casing", 14)
- .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("Use it if you hate GT++, or want even more speed later on").addSeparator()
+ .beginStructureBlock(3, 3, 3, true).addController("Front center")
+ .addCasingInfo("Robust Tungstensteel Machine Casing", 14).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;
}
@@ -104,65 +99,28 @@ public class GT_MetaTileEntity_ProcessingArray
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.casingTexturePages[0][48]};
+ return new ITexture[] { Textures.BlockIcons.casingTexturePages[0][48] };
}
// TODO: Expand so it also does the non recipe map recipes
/*
- public void remoteRecipeCheck() {
- if (mInventory[1] == null) return;
- String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", "");
- if (tmp.startsWith("replicator")) {
-
- } else if (tmp.startsWith("brewery")) {
-
- } else if (tmp.startsWith("packer")) {
-
- } else if (tmp.startsWith("printer")) {
-
- } else if (tmp.startsWith("disassembler")) {
-
- } else if (tmp.startsWith("massfab")) {
-
- } else if (tmp.startsWith("scanner")) {
-
- }
- }
- */
+ * public void remoteRecipeCheck() { if (mInventory[1] == null) return; String tmp =
+ * mInventory[1].getUnlocalizedName().replaceAll("gt.blockmachines.basicmachine.", ""); if
+ * (tmp.startsWith("replicator")) { } else if (tmp.startsWith("brewery")) { } else if (tmp.startsWith("packer")) { }
+ * else if (tmp.startsWith("printer")) { } else if (tmp.startsWith("disassembler")) { } else if
+ * (tmp.startsWith("massfab")) { } else if (tmp.startsWith("scanner")) { } }
+ */
// Gets the recipe map for the given machine through its unlocalized name
@Override
@@ -233,23 +191,29 @@ public class GT_MetaTileEntity_ProcessingArray
}
public boolean processLockedRecipe() {
- GT_Single_Recipe_Check_Processing_Array tSingleRecipeCheck =
- (GT_Single_Recipe_Check_Processing_Array) mSingleRecipeCheck;
+ GT_Single_Recipe_Check_Processing_Array tSingleRecipeCheck = (GT_Single_Recipe_Check_Processing_Array) mSingleRecipeCheck;
int machines = mInventory[1].stackSize << mMult;
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
+ if (GT_Mod.gregtechproxy.mLowGravProcessing && tRecipe.mSpecialValue == -100
&& !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId))
return false;
@@ -270,11 +234,8 @@ public class GT_MetaTileEntity_ProcessingArray
break;
} 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();
+ mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter(tInputs, tFluids).setRecipe(tRecipe)
+ .setRecipeAmperage(map.mAmperage).build();
recipeLocked = true;
}
}
@@ -304,7 +265,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;
@@ -322,8 +287,7 @@ public class GT_MetaTileEntity_ProcessingArray
}
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();
+ if (aRecipe.getFluidOutput(i) != null) tFOut[i] = aRecipe.getFluidOutput(i).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++) {
@@ -341,10 +305,8 @@ public class GT_MetaTileEntity_ProcessingArray
oNumber++;
}
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)
+ this.mOutputItems = Arrays.stream(tOut).filter(Objects::nonNull)
+ .flatMap(GT_MetaTileEntity_ProcessingArray::splitOversizedStack).filter(is -> is.stackSize > 0)
.toArray(ItemStack[]::new);
this.mOutputFluids = tFOut;
updateSlots();
@@ -420,13 +382,14 @@ public class GT_MetaTileEntity_ProcessingArray
} else {
mSeparate = !mSeparate;
GT_Utility.sendChatToPlayer(
- aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
+ aPlayer,
+ StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparate);
}
}
@Override
- public boolean onWireCutterRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
if (aPlayer.isSneaking()) {
mUseMultiparallelMode = !mUseMultiparallelMode;
if (mUseMultiparallelMode) {
@@ -460,8 +423,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
@@ -487,41 +450,71 @@ public class GT_MetaTileEntity_ProcessingArray
}
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() {
@@ -543,8 +536,8 @@ public class GT_MetaTileEntity_ProcessingArray
return true;
}
- protected void ProcessingArrayCalculateOverclock(
- long aEUt, int aDuration, int mAmperage, long maxInputVoltage, boolean perfectOC) {
+ protected void ProcessingArrayCalculateOverclock(long aEUt, int aDuration, int mAmperage, long maxInputVoltage,
+ boolean perfectOC) {
byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage));
if (mTier == 0) {
// Long time calculation
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 5212dc9195..8e3f07df48 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
@@ -13,11 +13,16 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN
import static gregtech.api.util.GT_StructureUtility.buildHatchAdder;
import static gregtech.api.util.GT_StructureUtility.ofCoil;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
@@ -33,21 +38,16 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Single_Recipe_Check;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-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
// GT_CopiedBlockTexture(Block.getBlockFromItem(ItemList.Casing_ULV.get(1).getItem()), 6, 0,
// Dyes.MACHINE_METAL.mRGBa);
private static final int CASING_INDEX = 1090;
- private static final IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> STRUCTURE_DEFINITION =
- createStructureDefinition();
+ private static final IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> STRUCTURE_DEFINITION = createStructureDefinition();
private static IStructureDefinition<GT_MetaTileEntity_PyrolyseOven> createStructureDefinition() {
IStructureElement<GT_MetaTileEntity_PyrolyseOven> tCasingElement = Loader.isModLoaded(MOD_ID_DC)
@@ -55,12 +55,13 @@ public class GT_MetaTileEntity_PyrolyseOven
: 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"},
- }))
+ .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',
@@ -70,18 +71,13 @@ public class GT_MetaTileEntity_PyrolyseOven
.addElement(
'b',
buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class)
- .atLeast(OutputBus, OutputHatch, Energy, Maintenance)
- .casingIndex(CASING_INDEX)
- .dot(1)
+ .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(
+ buildHatchAdder(GT_MetaTileEntity_PyrolyseOven.class).atLeast(InputBus, InputHatch, Muffler)
+ .casingIndex(CASING_INDEX).dot(1).buildAndChain(
onElementPass(GT_MetaTileEntity_PyrolyseOven::onCasingAdded, tCasingElement)))
.build();
}
@@ -99,65 +95,33 @@ public class GT_MetaTileEntity_PyrolyseOven
@Override
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:")
+ 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%, Fe50CW: 200%, etc.")
- .addInfo("EU/t is not affected by Coil tier")
- .addPollutionAmount(getPollutionPerSecond(null))
- .addSeparator()
- .beginStructureBlock(5, 4, 5, true)
- .addController("Front center")
+ .addInfo("EU/t is not affected by Coil tier").addPollutionAmount(getPollutionPerSecond(null))
+ .addSeparator().beginStructureBlock(5, 4, 5, true).addController("Front center")
.addCasingInfo("Pyrolyse Oven Casing", 60)
.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");
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
- 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()
- };
+ 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() };
+ 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() };
}
- return new ITexture[] {Textures.BlockIcons.casingTexturePages[8][66]};
+ return new ITexture[] { Textures.BlockIcons.casingTexturePages[8][66] };
}
@Override
@@ -191,13 +155,16 @@ public class GT_MetaTileEntity_PyrolyseOven
}
tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(
- getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ 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();
+ mSingleRecipeCheck = tSingleRecipeCheckBuilder.setAfter().setRecipe(tRecipe).build();
}
}
@@ -209,8 +176,8 @@ public class GT_MetaTileEntity_PyrolyseOven
if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false;
if (this.mEUt > 0) this.mEUt = (-this.mEUt);
this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + coilHeat.getTier()), 1);
- if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)};
- if (tRecipe.mFluidOutputs.length > 0) this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ if (tRecipe.mOutputs.length > 0) this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
+ if (tRecipe.mFluidOutputs.length > 0) this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
updateSlots();
return true;
}
@@ -237,8 +204,7 @@ public class GT_MetaTileEntity_PyrolyseOven
coilHeat = HeatingCoilLevel.None;
mCasingAmount = 0;
replaceDeprecatedCoils(aBaseMetaTileEntity);
- return checkPiece("main", 2, 3, 0)
- && mCasingAmount >= 60
+ return checkPiece("main", 2, 3, 0) && mCasingAmount >= 60
&& mMaintenanceHatches.size() == 1
&& !mMufflerHatches.isEmpty();
}
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 f942123109..681a4dfd63 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
@@ -6,8 +6,12 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZE
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_GLOW;
import static gregtech.api.enums.Textures.BlockIcons.casingTexturePages;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import com.gtnewhorizon.structurelib.structure.IStructureElement;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
+
import gregtech.api.GregTech_API;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -17,11 +21,10 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_VacuumFreezer
extends GT_MetaTileEntity_CubicMultiBlockBase<GT_MetaTileEntity_VacuumFreezer> {
+
public GT_MetaTileEntity_VacuumFreezer(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
}
@@ -38,62 +41,33 @@ public class GT_MetaTileEntity_VacuumFreezer
@Override
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")
- .addCasingInfo("Frost Proof Machine Casing", 16)
- .addEnergyHatch("Any casing", 1)
- .addMaintenanceHatch("Any casing", 1)
- .addInputHatch("Any casing", 1)
- .addOutputHatch("Any casing", 1)
- .addInputBus("Any casing", 1)
- .addOutputBus("Any casing", 1)
+ 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").addCasingInfo("Frost Proof Machine Casing", 16)
+ .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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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()
- };
+ 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() };
} 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()
- };
+ 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() };
}
} else {
- rTexture = new ITexture[] {casingTexturePages[0][17]};
+ rTexture = new ITexture[] { casingTexturePages[0][17] };
}
return rTexture;
}
@@ -115,9 +89,12 @@ 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);
@@ -130,8 +107,8 @@ public class GT_MetaTileEntity_VacuumFreezer
this.mEUt = (-this.mEUt);
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[] {tRecipe.getOutput(0)};
- this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)};
+ this.mOutputItems = new ItemStack[] { tRecipe.getOutput(0) };
+ this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) };
updateSlots();
return true;
}
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 09aae61527..757b3ea72d 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
@@ -12,16 +12,19 @@ import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.ITEM_I
import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.ITEM_OUT;
import static gregtech.api.multitileentity.multiblock.base.MultiBlockPart.NOTHING;
+import net.minecraft.block.Block;
+
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.util.Vec3Impl;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.multitileentity.multiblock.base.MultiBlock_Stackable;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
-import net.minecraft.block.Block;
public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macerator> {
+
private IStructureDefinition<MultiBlock_Macerator> STRUCTURE_DEFINITION = null;
@Override
@@ -33,23 +36,25 @@ 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[][] {
- {" A~A ", "AAAAA", "AAAAA", "AAAAA", " AAA "},
- }))
+ .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[][] { { " A~A ", "AAAAA", "AAAAA", "AAAAA", " AAA " }, }))
.addElement('A', ofChain(addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), ENERGY_IN)))
.addElement(
'B',
- ofChain(addMultiTileCasing(
- getCasingRegistryID(), getCasingMeta(), FLUID_IN | ITEM_IN | FLUID_OUT | ITEM_OUT)))
+ ofChain(
+ addMultiTileCasing(
+ getCasingRegistryID(),
+ getCasingMeta(),
+ FLUID_IN | ITEM_IN | FLUID_OUT | ITEM_OUT)))
.addElement('C', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING))
- .addElement('D', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING))
- .build();
+ .addElement('D', addMultiTileCasing(getCasingRegistryID(), getCasingMeta(), NOTHING)).build();
}
return STRUCTURE_DEFINITION;
}
@@ -72,12 +77,9 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera
@Override
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()
+ tt.addMachineType("Macerator").addInfo("Controller for the Macerator").addSeparator()
.beginVariableStructureBlock(7, 9, 2 + getMinStacks(), 2 + getMaxStacks(), 7, 9, true)
- .addController("Bottom Front Center")
- .addCasingInfo("Test Casing", 60)
+ .addController("Bottom Front Center").addCasingInfo("Test Casing", 60)
.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")
@@ -124,22 +126,15 @@ public class MultiBlock_Macerator extends MultiBlock_Stackable<MultiBlock_Macera
// TODO: MTE(Texture)
if (mFacing == aSide) {
return new ITexture[] {
- // Base Texture
- MACHINE_CASINGS[1][0],
- // Active
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE)
- .extFacing()
- .build(),
- // Active Glow
- TextureFactory.builder()
- .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW)
- .extFacing()
- .glow()
- .build()
- };
+ // Base Texture
+ MACHINE_CASINGS[1][0],
+ // Active
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(),
+ // Active Glow
+ TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing()
+ .glow().build() };
}
// Base Texture
- return new ITexture[] {MACHINE_CASINGS[1][0]};
+ return new ITexture[] { MACHINE_CASINGS[1][0] };
}
}
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 3aefd2d16f..4f9677eda6 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_AlloySmelter_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_AlloySmelter_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, false);
}
@@ -54,97 +55,57 @@ 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 9926c8a5e7..ca08d647a1 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_AlloySmelter_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_AlloySmelter_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Combination Smelter", 2, 1, true);
}
@@ -54,97 +55,57 @@ 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 5706345c3b..3f7eed2c99 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_Compressor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_Compressor_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Compressing Items", 1, 1, false);
}
@@ -49,97 +50,56 @@ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR),
+ 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 693f5abdbc..3f6e318284 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_Compressor_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_Compressor_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Compressing Items", 1, 1, true);
}
@@ -49,97 +50,56 @@ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_COMPRESSOR),
+ 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 7fa8358974..d9597663da 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_Extractor_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_Extractor_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, false);
}
@@ -49,97 +50,55 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR),
+ 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 c18a7e8a51..f90e0044bd 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
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
public class GT_MetaTileEntity_Extractor_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_Extractor_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Extracting your first Rubber", 1, 1, true);
}
@@ -49,97 +50,55 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_EXTRACTOR),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_EXTRACTOR),
+ 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 9709207ab3..3f25499dd8 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
@@ -3,6 +3,9 @@ package gregtech.common.tileentities.machines.steam;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.block.Block;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.ParticleFX;
@@ -15,10 +18,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
-import net.minecraft.block.Block;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_ForgeHammer_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, false);
}
@@ -56,103 +58,58 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER),
+ 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()
- };
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER),
+ 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()
- };
+ 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() };
}
@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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER),
+ 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()
- };
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0],
+ TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER),
+ TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build() };
}
/**
- * Handles {@link Block#randomDisplayTick}.
- * Draws Random Sparkles at main face.
+ * Handles {@link Block#randomDisplayTick}. Draws Random Sparkles at main face.
*
* @param aBaseMetaTileEntity The entity that will handle the {@see Block#randomDisplayTick}
*/
@@ -165,8 +122,7 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi
final byte mainFacing = (byte) this.mMainFacing;
- if (mainFacing > 1
- && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
+ if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
final double oX = aBaseMetaTileEntity.getXCoord();
@@ -202,10 +158,8 @@ public class GT_MetaTileEntity_ForgeHammer_Bronze extends GT_MetaTileEntity_Basi
mZ = .05D;
}
- ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
- .setMotion(mX, 0, mZ)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld());
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ)
+ .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.LAVA).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 d34cf2efb9..acfd8e6b28 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
@@ -3,6 +3,9 @@ package gregtech.common.tileentities.machines.steam;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.block.Block;
+import net.minecraftforge.common.util.ForgeDirection;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.ParticleFX;
@@ -15,10 +18,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
-import net.minecraft.block.Block;
-import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_ForgeHammer_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Forge Hammer", 1, 1, true);
}
@@ -56,103 +58,58 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_HAMMER),
+ 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()
- };
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_HAMMER),
+ 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()
- };
+ 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() };
}
@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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_HAMMER),
+ 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()
- };
+ return new ITexture[] { super.getBottomFacingInactive(aColor)[0],
+ TextureFactory.of(OVERLAY_BOTTOM_STEAM_HAMMER),
+ TextureFactory.builder().addIcon(OVERLAY_BOTTOM_STEAM_HAMMER_GLOW).glow().build() };
}
/**
- * Handles {@link Block#randomDisplayTick}.
- * Draws Random Sparkles at main face.
+ * Handles {@link Block#randomDisplayTick}. Draws Random Sparkles at main face.
*
* @param aBaseMetaTileEntity The entity that will handle the {@see Block#randomDisplayTick}
*/
@@ -165,8 +122,7 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic
final byte mainFacing = (byte) this.mMainFacing;
- if (mainFacing > 1
- && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
+ if (mainFacing > 1 && aBaseMetaTileEntity.getCoverIDAtSide(mainFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(mainFacing)) {
final double oX = aBaseMetaTileEntity.getXCoord();
@@ -202,10 +158,8 @@ public class GT_MetaTileEntity_ForgeHammer_Steel extends GT_MetaTileEntity_Basic
mZ = .05D;
}
- ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder())
- .setMotion(mX, 0, mZ)
- .setPosition(x, y, z)
- .setWorld(getBaseMetaTileEntity().getWorld());
+ ParticleEventBuilder particleEventBuilder = (new ParticleEventBuilder()).setMotion(mX, 0, mZ)
+ .setPosition(x, y, z).setWorld(getBaseMetaTileEntity().getWorld());
particleEventBuilder.setIdentifier(ParticleFX.LAVA).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 15d971a0fb..e102d797e8 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
@@ -2,6 +2,8 @@ package gregtech.common.tileentities.machines.steam;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,9 +13,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_Furnace_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, false);
}
@@ -52,8 +54,8 @@ public class GT_MetaTileEntity_Furnace_Bronze extends GT_MetaTileEntity_BasicMac
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null;
}
@@ -73,98 +75,55 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE),
+ 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()
- };
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE),
+ 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())
- };
+ 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()) };
}
}
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 85142dbd98..8d0414103e 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
@@ -2,6 +2,8 @@ package gregtech.common.tileentities.machines.steam;
import static gregtech.api.enums.Textures.BlockIcons.*;
+import net.minecraft.item.ItemStack;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -11,9 +13,9 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_Furnace_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Smelting things with compressed Steam", 1, 1, true);
}
@@ -52,8 +54,8 @@ public class GT_MetaTileEntity_Furnace_Steel extends GT_MetaTileEntity_BasicMach
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& GT_ModHandler.getSmeltingOutput(GT_Utility.copyAmount(64L, aStack), false, null) != null;
}
@@ -73,97 +75,54 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_FURNACE),
+ 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()
- };
+ return new ITexture[] { super.getFrontFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_FRONT_STEAM_FURNACE),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_FURNACE),
+ 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 e06a179fa7..def8af9fe3 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
@@ -4,6 +4,10 @@ import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
@@ -15,11 +19,9 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicMachine_Bronze {
+
public GT_MetaTileEntity_Macerator_Bronze(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, false);
}
@@ -48,15 +50,12 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM
&& aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
- new ParticleEventBuilder()
- .setMotion(0.0D, 0.0D, 0.0D)
- .setIdentifier(ParticleFX.SMOKE)
+ 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();
+ .setWorld(getBaseMetaTileEntity().getWorld()).run();
}
}
}
@@ -77,7 +76,7 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0);
calculateOverclockedNess(tRecipe);
@@ -85,8 +84,8 @@ public class GT_MetaTileEntity_Macerator_Bronze extends GT_MetaTileEntity_BasicM
}
@Override
- protected boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack));
}
@@ -106,97 +105,55 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR),
+ 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 13270b9a83..81027ca069 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
@@ -4,6 +4,10 @@ import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.ParticleFX;
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
@@ -15,11 +19,9 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.WorldSpawnedEventBuilder;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMachine_Steel {
+
public GT_MetaTileEntity_Macerator_Steel(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, "Macerating your Ores", 1, 1, true);
}
@@ -48,15 +50,13 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa
&& aBaseMetaTileEntity.getCoverIDAtSide(topFacing) == 0
&& !aBaseMetaTileEntity.getOpacityAtSide(topFacing)) {
- new WorldSpawnedEventBuilder.ParticleEventBuilder()
- .setMotion(0.0D, 0.0D, 0.0D)
+ 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();
+ .setWorld(getBaseMetaTileEntity().getWorld()).run();
}
}
}
@@ -77,7 +77,7 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
if (tRecipe.getOutput(0) != null) mOutputItems[0] = tRecipe.getOutput(0);
calculateOverclockedNess(tRecipe);
@@ -85,8 +85,8 @@ public class GT_MetaTileEntity_Macerator_Steel extends GT_MetaTileEntity_BasicMa
}
@Override
- public boolean allowPutStackValidated(
- IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide,
+ ItemStack aStack) {
return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack)
&& GT_Recipe_Map.sMaceratorRecipes.containsInput(GT_Utility.copyAmount(64L, aStack));
}
@@ -106,97 +106,55 @@ 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()
- };
+ return new ITexture[] { super.getSideFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_SIDE_STEAM_MACERATOR),
+ 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()
- };
+ return new ITexture[] { super.getTopFacingInactive(aColor)[0], TextureFactory.of(OVERLAY_TOP_STEAM_MACERATOR),
+ 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 8ef639e89e..c40e05090b 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
@@ -4,11 +4,29 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCHEST_GLOW;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.Constants;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import cpw.mods.fml.common.Optional;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
@@ -21,36 +39,25 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi
import gregtech.api.objects.AE2DigitalChestHandler;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.Constants;
@Optional.Interface(iface = "appeng.api.storage.IMEMonitor", modid = "appliedenergistics2", striprefs = true)
public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEntity_TieredMachineBlock
implements appeng.api.storage.IMEMonitor<appeng.api.storage.data.IAEItemStack>, IAddUIWidgets {
+
protected boolean mVoidOverflow = false;
protected boolean mDisableFilter;
- private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners =
- null;
+ private Map<appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>, Object> listeners = null;
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",
- });
+ 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", });
}
protected static int commonSizeCompute(int tier) {
@@ -84,24 +91,21 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
super(aName, aTier, 3, aDescription, aTextures);
}
- public GT_MetaTileEntity_DigitalChestBase(
- String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_DigitalChestBase(String aName, int aTier, String[] aDescription,
+ ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
}
@Optional.Method(modid = "appliedenergistics2")
public static void registerAEIntegration() {
- appeng.api.AEApi.instance()
- .registries()
- .externalStorage()
+ appeng.api.AEApi.instance().registries().externalStorage()
.addExternalStorageInterface(new AE2DigitalChestHandler());
}
@Optional.Method(modid = "appliedenergistics2")
@Override
public void addListener(
- appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack>
- imeMonitorHandlerReceiver,
+ appeng.api.storage.IMEMonitorHandlerReceiver<appeng.api.storage.data.IAEItemStack> imeMonitorHandlerReceiver,
Object o) {
if (listeners == null) listeners = new HashMap<>();
listeners.put(imeMonitorHandlerReceiver, o);
@@ -110,8 +114,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Optional.Method(modid = "appliedenergistics2")
@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);
}
@@ -203,15 +206,12 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Override
@Optional.Method(modid = "appliedenergistics2")
- 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) {
+ 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 ItemStack inputStack = input.getItemStack();
if (inputStack == null) return null;
if (getBaseMetaTileEntity() == null) return input;
- if (mode != appeng.api.config.Actionable.SIMULATE)
- getBaseMetaTileEntity().markDirty();
+ if (mode != appeng.api.config.Actionable.SIMULATE) getBaseMetaTileEntity().markDirty();
ItemStack storedStack = getItemStack();
if (storedStack != null) {
if (GT_Utility.areStacksEqual(storedStack, inputStack)) {
@@ -244,14 +244,11 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Override
@Optional.Method(modid = "appliedenergistics2")
- 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) {
+ 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) {
if (request.isSameType(getItemStack())) {
if (getBaseMetaTileEntity() == null) return null;
- if (mode != appeng.api.config.Actionable.SIMULATE)
- getBaseMetaTileEntity().markDirty();
+ if (mode != appeng.api.config.Actionable.SIMULATE) getBaseMetaTileEntity().markDirty();
if (request.getStackSize() >= getItemCount()) {
appeng.util.item.AEItemStack result = appeng.util.item.AEItemStack.create(getItemStack());
result.setStackSize(getItemCount());
@@ -278,21 +275,19 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
GT_Utility.sendChatToPlayer(
aPlayer,
StatCollector.translateToLocal(
- mVoidOverflow
- ? "GT5U.machines.digitalchest.voidoverflow.enabled"
+ 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) {
+ public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY,
+ 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"
+ mDisableFilter ? "GT5U.machines.digitalchest.inputfilter.disabled"
: "GT5U.machines.digitalchest.inputfilter.enabled"));
return true;
}
@@ -312,8 +307,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
ItemStack stack = getItemStack();
int savedCount = count;
- if ((mInventory[0] != null)
- && ((count < getMaxItemCount()) || mVoidOverflow)
+ if ((mInventory[0] != null) && ((count < getMaxItemCount()) || mVoidOverflow)
&& GT_Utility.areStacksEqual(mInventory[0], stack)) {
count += mInventory[0].stackSize;
if (count <= getMaxItemCount()) {
@@ -331,13 +325,12 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
mInventory[1] = stack.copy();
mInventory[1].stackSize = Math.min(stack.getMaxStackSize(), count);
count -= mInventory[1].stackSize;
- } else if ((count > 0)
- && GT_Utility.areStacksEqual(mInventory[1], stack)
+ } 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;
- }
+ 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();
@@ -379,8 +372,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Override
public int getProgresstime() {
- return getItemCount()
- + (mInventory[0] == null ? 0 : mInventory[0].stackSize)
+ return getItemCount() + (mInventory[0] == null ? 0 : mInventory[0].stackSize)
+ (mInventory[1] == null ? 0 : mInventory[1].stackSize);
}
@@ -398,21 +390,23 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
public String[] getInfoData() {
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
- };
+ 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 };
}
- 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
- };
+ 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 };
}
@Override
@@ -442,8 +436,8 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Optional.Method(modid = "appliedenergistics2")
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;
@@ -488,39 +482,30 @@ 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) {
- 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()
- };
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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() };
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
+ 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());
+ currenttip.add(
+ "Item Type: " + ItemStack.loadItemStackFromNBT(tag.getCompoundTag("itemType")).getDisplayName());
} else {
currenttip.add("Chest Empty");
}
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
ItemStack is = getItemStack();
if (GT_Utility.isStackInvalid(is)) return;
@@ -538,29 +523,27 @@ 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));
+ 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));
}
}
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 278e4b3d15..15171ae747 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
@@ -3,6 +3,25 @@ package gregtech.common.tileentities.storage;
import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
+import java.util.List;
+
+import mcp.mobius.waila.api.IWailaConfigHandler;
+import mcp.mobius.waila.api.IWailaDataAccessor;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils;
@@ -10,6 +29,7 @@ import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.IFluidAccess;
@@ -21,35 +41,26 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget;
-import java.util.List;
-import mcp.mobius.waila.api.IWailaConfigHandler;
-import mcp.mobius.waila.api.IWailaDataAccessor;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.StatCollector;
-import net.minecraft.world.World;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidTankInfo;
-import net.minecraftforge.fluids.IFluidHandler;
public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntity_BasicTank
implements IFluidLockable, IAddUIWidgets {
+
public boolean mOutputFluid = false, mVoidFluidPart = false, mVoidFluidFull = false, mLockFluid = false;
protected String lockedFluidName = null;
public boolean mAllowInputFromOutputSide = false;
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"),
- });
+ 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"), });
}
protected static int commonSizeCompute(int tier) {
@@ -133,9 +144,7 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return !mLockFluid
- || lockedFluidName == null
- || lockedFluidName.equals(aFluid.getFluid().getName());
+ return !mLockFluid || lockedFluidName == null || lockedFluidName.equals(aFluid.getFluid().getName());
}
@Override
@@ -222,23 +231,15 @@ 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) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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_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()
- };
+ return new ITexture[] { MACHINE_CASINGS[mTier][aColorIndex + 1], TextureFactory.of(OVERLAY_QTANK),
+ TextureFactory.builder().addIcon(OVERLAY_QTANK_GLOW).glow().build() };
}
@Override
@@ -252,7 +253,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"));
}
}
@@ -314,8 +316,8 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit
getOutputSlot(),
GT_Utility.getContainerForFilledItem(mInventory[getInputSlot()], true),
1)) {
- getFillableStack().amount +=
- Math.min(tFluid.amount, getRealCapacity() - getFillableStack().amount);
+ getFillableStack().amount += Math
+ .min(tFluid.amount, getRealCapacity() - getFillableStack().amount);
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
@@ -325,8 +327,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);
@@ -339,11 +341,11 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null
- || aFluid.getFluid().getID() <= 0
+ if (aFluid == null || aFluid.getFluid().getID() <= 0
|| aFluid.amount <= 0
|| !canTankBeFilled()
- || !isFluidInputAllowed(aFluid)) return 0;
+ || !isFluidInputAllowed(aFluid))
+ return 0;
if (getFillableStack() != null && !getFillableStack().isFluidEqual(aFluid)) {
return 0;
}
@@ -373,12 +375,13 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit
FluidStack tDrained = drain(commonSizeCompute(mTier) / 100, false);
if (tDrained != null) {
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()),
+ tDrained,
+ false);
+ if (tFilledAmount > 0) tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ drain(tFilledAmount, true),
+ true);
}
}
}
@@ -441,28 +444,28 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit
@Override
public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
- return new FluidTankInfo[] {getInfo()};
+ return new FluidTankInfo[] { getInfo() };
}
@Override
- public void getWailaBody(
- ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
+ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor,
+ 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");
}
}
@Override
- public void getWailaNBTData(
- EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y, int z) {
+ public void getWailaNBTData(EntityPlayerMP player, TileEntity tile, NBTTagCompound tag, World world, int x, int y,
+ int z) {
super.getWailaNBTData(player, tile, tag, world, x, y, z);
FluidStack fluid = getFluid();
if (fluid != null) tag.setTag("mFluid", fluid.writeToNBT(new NBTTagCompound()));
@@ -476,141 +479,117 @@ 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)
+ 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)
+ .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)
+ .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)
+ .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)
+ .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));
+ .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 b4d5345391..3d81076bc9 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
@@ -5,6 +5,10 @@ import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_LOCKER;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -13,11 +17,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlock {
+
public byte mType = 0;
public GT_MetaTileEntity_Locker(int aID, String aName, String aNameRegional, int aTier) {
@@ -44,30 +46,22 @@ public class GT_MetaTileEntity_Locker extends GT_MetaTileEntity_TieredMachineBlo
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[3][17][];
for (byte i = -1; i < 16; i = (byte) (i + 1)) {
- ITexture[] tmp0 = {MACHINE_CASINGS[this.mTier][(i + 1)]};
+ ITexture[] tmp0 = { MACHINE_CASINGS[this.mTier][(i + 1)] };
rTextures[0][(i + 1)] = tmp0;
- ITexture[] tmp1 = {MACHINE_CASINGS[this.mTier][(i + 1)], OVERLAYS_ENERGY_IN[this.mTier]};
+ ITexture[] tmp1 = { MACHINE_CASINGS[this.mTier][(i + 1)], OVERLAYS_ENERGY_IN[this.mTier] };
rTextures[1][(i + 1)] = tmp1;
- ITexture[] tmp2 = {MACHINE_CASINGS[this.mTier][(i + 1)], TextureFactory.of(OVERLAY_LOCKER)};
+ ITexture[] tmp2 = { MACHINE_CASINGS[this.mTier][(i + 1)], TextureFactory.of(OVERLAY_LOCKER) };
rTextures[2][(i + 1)] = tmp2;
}
return rTextures;
}
@Override
- public ITexture[] getTexture(
- IGregTechTileEntity aBaseMetaTileEntity,
- byte aSide,
- byte aFacing,
- byte aColorIndex,
- boolean aActive,
- boolean aRedstone) {
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
+ 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)]
- };
+ return new ITexture[] { this.mTextures[2][(aColorIndex + 1)][0], this.mTextures[2][(aColorIndex + 1)][1],
+ LOCKERS[Math.abs(this.mType % LOCKERS.length)] };
}
return this.mTextures[0][(aColorIndex + 1)];
}
@@ -182,8 +176,8 @@ 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) {
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX,
+ 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_QuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
index 18d54215a1..7b00a9746c 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_QuantumChest.java
@@ -1,14 +1,16 @@
package gregtech.common.tileentities.storage;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.MetaTileEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+
public class GT_MetaTileEntity_QuantumChest extends GT_MetaTileEntity_DigitalChestBase {
+
public int mItemCount = 0;
public ItemStack mItemStack = null;
NBTTagList mInvData = null;
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 886dd676e7..d6a936c745 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
@@ -1,12 +1,14 @@
package gregtech.common.tileentities.storage;
+import net.minecraft.util.EnumChatFormatting;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GT_Utility;
-import net.minecraft.util.EnumChatFormatting;
public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_DigitalTankBase {
+
public GT_MetaTileEntity_QuantumTank(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
}
@@ -28,22 +30,26 @@ public class GT_MetaTileEntity_QuantumTank extends GT_MetaTileEntity_DigitalTank
public String[] getInfoData() {
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
- };
+ 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 };
}
- 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
- };
+ 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 };
}
}
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 3b7fb8e849..5dac66e49a 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
@@ -1,12 +1,14 @@
package gregtech.common.tileentities.storage;
+import net.minecraft.util.EnumChatFormatting;
+
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.GT_Utility;
-import net.minecraft.util.EnumChatFormatting;
public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_DigitalTankBase {
+
public GT_MetaTileEntity_SuperTank(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier);
}
@@ -28,21 +30,25 @@ public class GT_MetaTileEntity_SuperTank extends GT_MetaTileEntity_DigitalTankBa
public String[] getInfoData() {
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
- };
+ 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 };
}
- 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
- };
+ 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 };
}
}