aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/tileentities/boilers
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/boilers
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/boilers')
-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
6 files changed, 317 insertions, 359 deletions
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) },
+ tex