diff options
Diffstat (limited to 'src/main/java/gregtech/common')
10 files changed, 295 insertions, 296 deletions
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 db9e13ad83..b16986fffd 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 @@ -23,14 +23,15 @@ 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 20 Pollution per second"}, new ITexture[0]); + "An early way to get Steam Power", + "Produces 120L of Steam per second", + "Causes 20 Pollution per second"}); } public GT_MetaTileEntity_Boiler_Bronze(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } + public GT_MetaTileEntity_Boiler_Bronze(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -146,8 +147,8 @@ public class GT_MetaTileEntity_Boiler_Bronze this.mProcessingEnergy -= 1; this.mTemperature += 1; } - if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){ - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); + if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) { + GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } 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 8e044c7c2a..3e5afedba2 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 @@ -23,9 +23,9 @@ public class GT_MetaTileEntity_Boiler_Lava extends GT_MetaTileEntity_Boiler {
public GT_MetaTileEntity_Boiler_Lava(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, new String[]{
- "A Boiler running off Lava",
- "Produces 600L of Steam per second",
- "Causes 20 Pollution per second"}, new ITexture[0]);
+ "A Boiler running off Lava",
+ "Produces 600L of Steam per second",
+ "Causes 20 Pollution per second"});
}
public GT_MetaTileEntity_Boiler_Lava(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -126,8 +126,8 @@ public class GT_MetaTileEntity_Boiler_Lava this.mTemperature += 1;
}
- if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
+ if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) {
+ GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
}
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
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 1edfaca5a0..e8b4ed1e8f 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 @@ -19,17 +19,16 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler {
public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional, new String[]{
- "Steam Power by the Sun",
- "Produces 120L of Steam per second",
- "Calcifies over time, reducing Steam output to 40L/s",
- "Break and replace to decalcify"},
- new ITexture[0]);
+ "Steam Power by the Sun",
+ "Produces 120L of Steam per second",
+ "Calcifies over time, reducing Steam output to 40L/s",
+ "Break and replace to decalcify"});
}
public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
-
+
public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
}
@@ -68,9 +67,9 @@ public class GT_MetaTileEntity_Boiler_Solar public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
}
-
+
private int mRunTime = 0;
-
+
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
@@ -118,8 +117,8 @@ public class GT_MetaTileEntity_Boiler_Solar this.mFluid.amount -= 1;
mRunTime += 1;
int tOutput = 150;
- if(mRunTime > 10000){
- tOutput = Math.max(50, 150 - ((mRunTime-10000)/100));
+ if (mRunTime > 10000) {
+ tOutput = Math.max(50, 150 - ((mRunTime - 10000) / 100));
}
if (this.mSteam == null) {
this.mSteam = GT_ModHandler.getSteam(tOutput);
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 1e82f7efab..5d7ec97401 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 @@ -23,9 +23,9 @@ public class GT_MetaTileEntity_Boiler_Steel extends GT_MetaTileEntity_Boiler {
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 20 Pollution per second"}, new ITexture[0]);
+ "Faster than the Bronze Boiler",
+ "Produces 300L of Steam per second",
+ "Causes 20 Pollution per second"});
}
public GT_MetaTileEntity_Boiler_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -152,8 +152,8 @@ public class GT_MetaTileEntity_Boiler_Steel this.mProcessingEnergy -= 2;
this.mTemperature += 1;
}
- if(this.mProcessingEnergy>0 && (aTick % 20L == 0L)){
- GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
+ if (this.mProcessingEnergy > 0 && (aTick % 20L == 0L)) {
+ GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 20);
}
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
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 7b1487b3c3..503a1f7efb 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 @@ -18,15 +18,14 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_DieselGenerator
extends GT_MetaTileEntity_BasicGenerator {
- public static final int BASE_POLLUTION = 2;
-
+ public static final int BASE_POLLUTION = 2;
+
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) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"},
- new ITexture[0]);
+ "Requires liquid Fuel",
+ "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"});
onConfigLoad();
}
@@ -34,7 +33,7 @@ public class GT_MetaTileEntity_DieselGenerator super(aName, aTier, aDescription, aTextures);
onConfigLoad();
}
-
+
public GT_MetaTileEntity_DieselGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad();
@@ -65,7 +64,7 @@ public class GT_MetaTileEntity_DieselGenerator }
public int getFuelValue(ItemStack aStack) {
- if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
+ if (GT_Utility.isStackInvalid(aStack) || getRecipes() == null) return 0;
int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack));
if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) {
rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3);
@@ -113,8 +112,8 @@ public class GT_MetaTileEntity_DieselGenerator return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE)};
}
- @Override
- public int getPollution() {
- return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1));
- }
+ @Override
+ public int getPollution() {
+ return (int) (GT_MetaTileEntity_DieselGenerator.BASE_POLLUTION * Math.pow(2, mTier - 1));
+ }
}
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 14f1eb2643..293669094b 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 @@ -13,15 +13,15 @@ import gregtech.api.util.GT_Recipe; public class GT_MetaTileEntity_GasTurbine
extends GT_MetaTileEntity_BasicGenerator {
- public static final int BASE_POLLUTION = 1;
-
+ public static final int BASE_POLLUTION = 1;
+
public int mEfficiency;
-
+
public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, new String[]{
- "Requires flammable Gasses",
- "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"});
+ "Requires flammable Gasses",
+ "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"});
onConfigLoad();
}
@@ -29,7 +29,7 @@ public class GT_MetaTileEntity_GasTurbine super(aName, aTier, aDescription, aTextures);
onConfigLoad();
}
-
+
public GT_MetaTileEntity_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aDescription, aTextures);
onConfigLoad();
@@ -100,8 +100,8 @@ public class GT_MetaTileEntity_GasTurbine return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE)};
}
- @Override
- public int getPollution() {
- return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1));
- }
+ @Override
+ public int getPollution() {
+ return (int) (GT_MetaTileEntity_GasTurbine.BASE_POLLUTION * Math.pow(2, mTier - 1));
+ }
}
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 8850f824be..e63fbe0579 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 @@ -18,8 +18,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener public GT_MetaTileEntity_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, new String[]{
- "Converts Steam into EU",
- "Base rate: 2L of Steam -> 1 EU"}, new ITexture[0]);
+ "Converts Steam into EU",
+ "Base rate: 2L of Steam -> 1 EU"});
onConfigLoad();
}
@@ -47,12 +47,12 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener @Override
public String[] getDescription() {
- String[] desc = new String[mDescriptionArray.length + 2];
- System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
- desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%";
- desc[mDescriptionArray.length + 1] = String.format("Consumes up to %sL of Steam per second",
- (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, mTier)) / (600 / getEfficiency())));
- return desc;
+ String[] desc = new String[mDescriptionArray.length + 2];
+ System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
+ desc[mDescriptionArray.length] = "Fuel Efficiency: " + (600 / getEfficiency()) + "%";
+ desc[mDescriptionArray.length + 1] = String.format("Consumes up to %sL of Steam per second",
+ (int) (4000 * (8 * Math.pow(4, mTier) + Math.pow(2, mTier)) / (600 / getEfficiency())));
+ return desc;
}
public int getCapacity() {
@@ -68,8 +68,8 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener }
public int getFuelValue(FluidStack aLiquid) {
- if(aLiquid==null)return 0;
- String fluidName = aLiquid.getFluid().getUnlocalizedName(aLiquid);
+ if (aLiquid == null) return 0;
+ String fluidName = aLiquid.getFluid().getUnlocalizedName(aLiquid);
return GT_ModHandler.isSteam(aLiquid) || fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name") ? 3 : 0;
}
@@ -119,18 +119,18 @@ public class GT_MetaTileEntity_SteamTurbine extends GT_MetaTileEntity_BasicGener return new ITexture[]{super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE)};
}
- @Override
- public int getPollution() {
- return 0;
- }
-
+ @Override
+ public int getPollution() {
+ return 0;
+ }
+
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- if(aFluid.getFluid().getUnlocalizedName(aFluid).equals("ic2.fluidSuperheatedSteam")){
- aFluid.amount=0;
- aFluid = null;
- return false;
- }
+ if (aFluid.getFluid().getUnlocalizedName(aFluid).equals("ic2.fluidSuperheatedSteam")) {
+ aFluid.amount = 0;
+ aFluid = null;
+ return false;
+ }
return super.isFluidInputAllowed(aFluid);
}
}
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 484195a2cd..015670cb02 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 @@ -16,188 +16,184 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBase { - private int mHeatingCapacity = 0; - - public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GT_MetaTileEntity_Cleanroom(String aName) { - super(aName); - } - - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Cleanroom(this.mName); - } - - public String[] getDescription() { - return new String[] { - "Controller Block for the Cleanroom", - "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", - "Controller (Top center), Walls Plascrete", - "Top besides contoller and corners filter casings", - "1 Reinforced Door", - "1x Energy Hatch, 1x Maintainance Hatch", - "up to 10 Machine Hull to transfer Items & Energy inside"}; - } - - public boolean checkRecipe(ItemStack aStack) { - this.mEfficiencyIncrease = 100; - this.mMaxProgresstime = 100; - this.mEUt = -4; - return true; - } - - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int x = 1; - int z = 1; - int y = 1; - int mDoorCount = 0; - int mHullCount = 0; - int mPlascreteCount = 0; - boolean doorState = false; - mUpdate = 100; - for (int i = 1; i < 8; i++) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { - x = i; - z = i; - break; - } else { - return false; - } - } - } - for (int i = -1; i > -16; i--) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - y = i + 1; - break; - } - } - if (y > -2) { - return false; - } - for (int dX = -x; dX <= x; dX++) { - for (int dZ = -z; dZ <= z; dZ++) { - for (int dY = 0; dY >= y; dY--) { - if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (y == 0) { - if (dX == -x || dX == x || dZ == -z || dZ == z) { - if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { - return false; - } - } else if (dX == 0 && dZ == 0) { - } else { - if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { - return false; - } - } - } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { - mPlascreteCount++; - } else { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { - if (tBlock instanceof ic2.core.block.BlockIC2Door) { - if ((tMeta & 8) == 0) { - doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); - } - mDoorCount++; - } else { - if (tTileEntity == null) { - { - return false; - } - } - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { - mHullCount++; - } else { - return false; - } - } - } - } - } else { - - } - } - } - } - if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { - return false; - } - 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--) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); - if (tTileEntity != null) { - IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) { - ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this; - } - } - } - } - } - - if (doorState) { - mEfficiency = Math.max(0, mEfficiency - 200); - } - - return true; - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == 0 || aSide == 1) { - return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE), - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM) }; - - } - return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE) }; - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); - } - - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; - } - - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - public int getAmountOfOutputs() { - return 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } -}
\ No newline at end of file + private int mHeatingCapacity = 0; + + public GT_MetaTileEntity_Cleanroom(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_Cleanroom(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Cleanroom(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Cleanroom", + "Min(WxHxD): 3x3x3 (Hollow), Max(WxHxD): 15x15x15 (Hollow)", + "Controller (Top center), Walls Plascrete", + "Top besides contoller and corners filter casings", + "1 Reinforced Door", + "1x Energy Hatch, 1x Maintainance Hatch", + "up to 10 Machine Hull to transfer Items & Energy inside"}; + } + + public boolean checkRecipe(ItemStack aStack) { + this.mEfficiencyIncrease = 100; + this.mMaxProgresstime = 100; + this.mEUt = -4; + return true; + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int x = 1; + int z = 1; + int y = 1; + int mDoorCount = 0; + int mHullCount = 0; + int mPlascreteCount = 0; + boolean doorState = false; + mUpdate = 100; + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { + x = i; + z = i; + break; + } else { + return false; + } + } + } + for (int i = -1; i > -16; i--) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + y = i + 1; + break; + } + } + if (y > -2) { + return false; + } + for (int dX = -x; dX <= x; dX++) { + for (int dZ = -z; dZ <= z; dZ++) { + for (int dY = 0; dY >= y; dY--) { + if (dX == -x || dX == x || dY == -y || dY == y || dZ == -z || dZ == z) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); + if (y == 0) { + if (dX == -x || dX == x || dZ == -z || dZ == z) { + if (tBlock != GregTech_API.sBlockReinforced || tMeta != 2) { + return false; + } + } else if (dX == 0 && dZ == 0) { + } else { + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + return false; + } + } + } else if (tBlock == GregTech_API.sBlockReinforced && tMeta == 2) { + mPlascreteCount++; + } else { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if ((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))) { + if (tBlock instanceof ic2.core.block.BlockIC2Door) { + if ((tMeta & 8) == 0) { + doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); + } + mDoorCount++; + } else { + if (tTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_BasicHull) { + mHullCount++; + } else { + return false; + } + } + } + } + } + } + } + } + if (mMaintenanceHatches.size() != 1 || mEnergyHatches.size() != 1 || mDoorCount != 2 || mHullCount > 10) { + return false; + } + 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--) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); + if (tTileEntity != null) { + IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); + if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe) { + ((GT_MetaTileEntity_BasicMachine_GT_Recipe) aMetaTileEntity).mCleanroom = this; + } + } + } + } + } + + if (doorState) { + mEfficiency = Math.max(0, mEfficiency - 200); + } + + return true; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == 0 || aSide == 1) { + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE), + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM)}; + + } + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiblockDisplay.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public int getAmountOfOutputs() { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } +} 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 d720c688d8..04922c0a03 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 @@ -38,7 +38,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler public String[] getDescription() {
return new String[]{
"Controller Block for the Large Boiler",
- "Produces "+(getEUt()*40)*(runtimeBoost(20)/20f)+"L of Steam with 1 Coal at "+getEUt()* 40+"L/s",
+ "Produces " + (getEUt() * 40) * (runtimeBoost(20) / 20f) + "L of Steam with 1 Coal at " + getEUt() * 40 + "L/s",
"A programmed circuit in the main block throttles the boiler (-1000L/s per config)",
"Size(WxHxD): 3x5x3, Controller (Front middle in Fireboxes)",
"3x1x3 of Fire Boxes (Bottom layer, Min 3)",
@@ -94,27 +94,27 @@ public abstract class GT_MetaTileEntity_LargeBoiler }
public boolean checkRecipe(ItemStack aStack) {
- //Do we have an integrated circuit with a valid configuration?
- if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
+ //Do we have an integrated circuit with a valid configuration?
+ if (mInventory[1] != null && mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) {
int circuit_config = mInventory[1].getItemDamage();
if (circuit_config >= 1 && circuit_config <= 25) {
// If so, overwrite the current config
- this.integratedCircuitConfig = circuit_config;
- }
+ this.integratedCircuitConfig = circuit_config;
+ }
} else {
- //If not, set the config to zero
- this.integratedCircuitConfig = 0;
+ //If not, set the config to zero
+ this.integratedCircuitConfig = 0;
}
-
- this.mSuperEfficencyIncrease=0;
+
+ this.mSuperEfficencyIncrease = 0;
for (GT_Recipe tRecipe : GT_Recipe.GT_Recipe_Map.sDieselFuels.mRecipeList) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tRecipe.getRepresentativeInput(0), true);
- if ((tFluid != null) && (tRecipe.mSpecialValue > 1)) {
+ if (tFluid != null && tRecipe.mSpecialValue > 1) {
tFluid.amount = 1000;
if (depleteInput(tFluid)) {
this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2));
this.mEUt = adjustEUtForConfig(getEUt());
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease() * 4);
+ this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4;
return true;
}
}
@@ -126,7 +126,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler if (depleteInput(tFluid)) {
this.mMaxProgresstime = adjustBurnTimeForConfig(Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)));
this.mEUt = adjustEUtForConfig(getEUt());
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease();
return true;
}
}
@@ -134,17 +134,20 @@ public abstract class GT_MetaTileEntity_LargeBoiler ArrayList<ItemStack> tInputList = getStoredInputs();
if (!tInputList.isEmpty()) {
for (ItemStack tInput : tInputList) {
- if ((GT_Utility.getFluidForFilledItem(tInput, true) == null) && ((this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0)) {
- this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80;
- this.mMaxProgresstime += this.excessFuel / 80;
- this.excessFuel %= 80;
- this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime));
- this.mEUt = adjustEUtForConfig(getEUt());
- this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease());
+ if (GT_Utility.getFluidForFilledItem(tInput, true) == null && (this.mMaxProgresstime = GT_ModHandler.getFuelValue(tInput) / 80) > 0) {
+ this.excessFuel += GT_ModHandler.getFuelValue(tInput) % 80;
+ this.mMaxProgresstime += this.excessFuel / 80;
+ this.excessFuel %= 80;
+ this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime));
+ this.mEUt = adjustEUtForConfig(getEUt());
+ this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease();
this.mOutputItems = new ItemStack[]{GT_Utility.getContainerItem(tInput, true)};
tInput.stackSize -= 1;
updateSlots();
- if(this.mEfficiencyIncrease>5000){ this.mEfficiencyIncrease=0;this.mSuperEfficencyIncrease=20;}
+ if (this.mEfficiencyIncrease > 5000) {
+ this.mEfficiencyIncrease = 0;
+ this.mSuperEfficencyIncrease = 20;
+ }
return true;
}
}
@@ -158,7 +161,8 @@ public abstract class GT_MetaTileEntity_LargeBoiler public boolean onRunningTick(ItemStack aStack) {
if (this.mEUt > 0) {
- if(this.mSuperEfficencyIncrease>0)this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease);
+ if (this.mSuperEfficencyIncrease > 0)
+ this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease);
int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L);
if (tGeneratedEU > 0) {
long amount = (tGeneratedEU + 160) / 160;
@@ -190,7 +194,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler int tFireboxAmount = 0;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
- if ((i != 0) || (j != 0)) {
+ if (i != 0 || j != 0) {
for (int k = 1; k <= 4; k++) {
if (!addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, k, zDir + j), getCasingTextureIndex())) {
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, k, zDir + j) != getCasingBlock()) {
@@ -225,9 +229,9 @@ public abstract class GT_MetaTileEntity_LargeBoiler }
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
- if ((xDir + i != 0) || (zDir + j != 0)) {
+ if (xDir + i != 0 || zDir + j != 0) {
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
- if ((!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addInputToMachineList(tTileEntity, getFireboxTextureIndex())) && (!addMufflerToMachineList(tTileEntity, getFireboxTextureIndex()))) {
+ if (!addMaintenanceToMachineList(tTileEntity, getFireboxTextureIndex()) && !addInputToMachineList(tTileEntity, getFireboxTextureIndex()) && !addMufflerToMachineList(tTileEntity, getFireboxTextureIndex())) {
if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != getFireboxBlock()) {
return false;
}
@@ -239,7 +243,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler }
}
}
- return (tCasingAmount >= 24) && (tFireboxAmount >= 3);
+ return tCasingAmount >= 24 && tFireboxAmount >= 3;
}
public int getMaxEfficiency(ItemStack aStack) {
@@ -247,7 +251,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler }
public int getPollutionPerTick(ItemStack aStack) {
- int adjustedEUOutput = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
+ int adjustedEUOutput = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
return Math.max(1, 12 * adjustedEUOutput / getEUt());
}
@@ -258,21 +262,21 @@ public abstract class GT_MetaTileEntity_LargeBoiler public boolean explodesOnComponentBreak(ItemStack aStack) {
return false;
}
-
- private int adjustEUtForConfig(int rawEUt){
- int adjustedSteamOutput = rawEUt - 25 * integratedCircuitConfig;
- return Math.max(adjustedSteamOutput, 25);
+
+ private int adjustEUtForConfig(int rawEUt) {
+ int adjustedSteamOutput = rawEUt - 25 * integratedCircuitConfig;
+ return Math.max(adjustedSteamOutput, 25);
}
-
- private int adjustBurnTimeForConfig(int rawBurnTime){
- if(mEfficiency < 10000){
- return rawBurnTime;
- }
- int adjustedEUt = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
- int adjustedBurnTime = rawBurnTime * getEUt() / adjustedEUt;
- this.excessProjectedEU += (getEUt() * rawBurnTime) - (adjustedEUt * adjustedBurnTime);
- adjustedBurnTime += this.excessProjectedEU / adjustedEUt;
- this.excessProjectedEU %= adjustedEUt;
- return adjustedBurnTime;
+
+ private int adjustBurnTimeForConfig(int rawBurnTime) {
+ if (mEfficiency < 10000) {
+ return rawBurnTime;
+ }
+ int adjustedEUt = Math.max(25, getEUt() - 25 * integratedCircuitConfig);
+ int adjustedBurnTime = rawBurnTime * getEUt() / adjustedEUt;
+ this.excessProjectedEU += getEUt() * rawBurnTime - adjustedEUt * adjustedBurnTime;
+ adjustedBurnTime += this.excessProjectedEU / adjustedEUt;
+ this.excessProjectedEU %= adjustedEUt;
+ return adjustedBurnTime;
}
}
\ No newline at end of file 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 ba3b41adf5..22e9a23843 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 @@ -30,10 +30,10 @@ public class GT_MetaTileEntity_Locker }
public String[] getDescription() {
- String[] desc = new String[mDescriptionArray.length + 1];
- System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
- desc[mDescriptionArray.length] = "Click with Screwdriver to change Style";
- return desc;
+ String[] desc = new String[mDescriptionArray.length + 1];
+ System.arraycopy(mDescriptionArray, 0, desc, 0, mDescriptionArray.length);
+ desc[mDescriptionArray.length] = "Click with Screwdriver to change Style";
+ return desc;
}
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
|