aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authordraknyte1 <draknyte1@hotmail.com>2016-11-04 15:23:26 +1000
committerdraknyte1 <draknyte1@hotmail.com>2016-11-04 15:23:26 +1000
commit0669f5eb9d5029a8b94ec552171b0837605f7747 (patch)
tree6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
parent3654052fb63a571c5eaca7f20714b87c17f7e966 (diff)
downloadGT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz
GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2
GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java329
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java434
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java351
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java476
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java347
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java346
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java284
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java327
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java289
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java778
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java528
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java602
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java274
13 files changed, 2919 insertions, 2446 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
index 898fab830f..f478be73d6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
@@ -25,172 +25,97 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase {
- public static int sUUAperUUM = 1;
- public static int sUUASpeedBonus = 4;
- public static int sDurationMultiplier = 3215;
- public static boolean sRequiresUUA = false;
- private int recipeCounter = 0;
- private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
- //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+ public static int sUUAperUUM = 1;
+ public static int sUUASpeedBonus = 4;
+ public static int sDurationMultiplier = 3215;
+ public static boolean sRequiresUUA = false;
+ private static Block IC2Glass = Block.getBlockFromItem(ItemUtils.getItem("IC2:blockAlloyGlass"));
+ // public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+ private int recipeCounter = 0;
- public GregtechMTE_NuclearReactor(int aID, String aName, String aNameRegional) {
+ public GregtechMTE_NuclearReactor(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
}
- public GregtechMTE_NuclearReactor(String aName) {
+ public GregtechMTE_NuclearReactor(final String aName) {
super(aName);
}
@Override
- public String[] getDescription() {
- return new String[]{
- "Controller Block for the Nuclear Reactor",
- "Produces heat from Radioactive beta decay.",
- "Size(WxHxD): 5x4x5, Controller (Bottom center)",
- "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
- "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
- "1x Input Hatch (Any bottom layer casing)",
- "1x Output Hatch (Any bottom layer casing)",
- "1x Maintenance Hatch (Any bottom layer casing)",
- "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
- "1x Energy Hatch (Any bottom layer casing)",
- "24x IC2 Reinforced Glass for the walls",
- "Matter Fabricator Casings for the edges & top (40 at least!)",
- CORE.GT_Tooltip};
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66],
- new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)};
- }
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[66]};
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MatterFabricator.png");
- }
-
- @Override
- public void onConfigLoad(GT_Config aConfig) {
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
- if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
- tFluidList.remove(j--);
- } else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0, tFluidList.size());
- if (tFluids.length > 0) {
- for(int i = 0;i<tFluids.length;i++){
- GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[]{tFluids[i]}, new ItemStack[]{});
- if (tRecipe != null) {
- if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) {
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = ((tRecipe.mDuration/**sDurationMultiplier*/) / (1 << tTier - 1));
- } else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = (tRecipe.mDuration/**sDurationMultiplier*/);
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
- this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)};
- this.mOutputFluids = tRecipe.mFluidOutputs.clone();
- ArrayUtils.reverse(mOutputFluids);
- recipeCounter++;
- updateSlots();
- //Utils.LOG_INFO("Recipes Finished: "+recipeCounter);
- return true;
- }
- }
- else {
- Utils.LOG_INFO("Invalid Recipe");
- }
- }
- }
- return false;
- }
-
- @Override
- public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
+ public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
for (int i = -3; i < 4; i++) {
for (int j = -3; j < 4; j++) {
for (int h = 0; h < 4; h++) {
- IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ h, zDir + j);
- if ((i != -3 && i != 3) && (j != -3 && j != 3)) {// Reactor Floor/Roof inner 7x7
- if (h == 0 || h == 4) {// Reactor Floor & Roof (Inner 7x7) + muffler x4
- if ((!addMufflerToMachineList(tTileEntity, 66))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ if (i != -3 && i != 3 && j != -3 && j != 3) {// Reactor
+ // Floor/Roof
+ // inner 7x7
+ if (h == 0 || h == 4) {// Reactor Floor & Roof (Inner
+ // 7x7) + muffler x4
+ if (!this.addMufflerToMachineList(tTileEntity, 66)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
}
- } else {// Inside 6 layers, mostly air
- if ((i != -1 && i != 1) && (j != -1 && j != 1)) {// Reactor Floor/Roof inner 5x5
+ }
+ else {// Inside 6 layers, mostly air
+ if (i != -1 && i != 1 && j != -1 && j != 1) {// Reactor
+ // Floor/Roof
+ // inner
+ // 5x5
if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) {
Utils.LOG_INFO("Make sure the inner 3x3 of the Multiblock is Air.");
return false;
}
}
- else { //carbon moderation rods are at 1,1 & -1,-1 & 1,-1 & -1,1
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ else { // carbon moderation rods are at 1,1 & -1,-1
+ // & 1,-1 & -1,1
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the top layers inner 3x3.");
return false;
}
- }
+ }
}
} // End Inner Workings
else {// Reactor Exterior
if (h == 1) {
- if ((i == -3 || i == 3) && (j == -3 || j == 3)){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
+ if ((i == -3 || i == 3) && (j == -3 || j == 3)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the corners in the second layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the second layer.");
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the corners in the second layer.");
return false;
}
}
- else if ((i != -3 || i != 3) && (j != -3 || j != 3)){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ else if ((i != -3 || i != 3) && (j != -3 || j != 3)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
return false;
}
@@ -201,19 +126,23 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
}
if (h == 2) {
- if ((i == -3 || i == 3) && (j == -3 || j == 3)){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
+ if ((i == -3 || i == 3) && (j == -3 || j == 3)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the corners in the third layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the corners in the third layer.");
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the corners in the third layer.");
return false;
}
}
- else if ((i != -3 || i != 3) && (j != -3 || j != 3)){
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ else if ((i != -3 || i != 3) && (j != -3 || j != 3)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
Utils.LOG_INFO("Glass Casings Missing from somewhere in the second layer.");
return false;
}
@@ -224,12 +153,15 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
}
if (h == 3) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h,
+ zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the edges on the top layer.");
return false;
}
if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 12) {
- Utils.LOG_INFO("Matter Fabricator Casings Missing from one of the edges on the top layer.");
+ Utils.LOG_INFO(
+ "Matter Fabricator Casings Missing from one of the edges on the top layer.");
return false;
}
}
@@ -244,38 +176,143 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase
}
@Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
+ public boolean checkRecipe(final ItemStack aStack) {
+ final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ }
+ else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+
+ final long tVoltage = this.getMaxInputVoltage();
+ final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tFluidList.size()]), 0,
+ tFluidList.size());
+ if (tFluids.length > 0) {
+ for (int i = 0; i < tFluids.length; i++) {
+ final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes.findRecipe(
+ this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], new FluidStack[] {
+ tFluids[i]
+ }, new ItemStack[] {});
+ if (tRecipe != null) {
+ if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[] {})) {
+ this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
+ this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
+ }
+ else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = -this.mEUt;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputItems = new ItemStack[] {
+ tRecipe.getOutput(0)
+ };
+ this.mOutputFluids = tRecipe.mFluidOutputs.clone();
+ ArrayUtils.reverse(this.mOutputFluids);
+ this.recipeCounter++;
+ this.updateSlots();
+ // Utils.LOG_INFO("Recipes Finished: "+recipeCounter);
+ return true;
+ }
+ }
+ else {
+ Utils.LOG_INFO("Invalid Recipe");
+ }
+ }
+ }
+ return false;
}
@Override
- public int getMaxEfficiency(ItemStack aStack) {
- return 10000;
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
}
@Override
- public int getPollutionPerTick(ItemStack aStack) {
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
+ final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png");
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
return 0;
}
@Override
- public int getDamageToComponent(ItemStack aStack) {
+ public String[] getDescription() {
+ return new String[] {
+ "Controller Block for the Nuclear Reactor", "Produces heat from Radioactive beta decay.",
+ "Size(WxHxD): 5x4x5, Controller (Bottom center)",
+ "3x1x3 Matter Generation Coils (Inside bottom 5x1x5 layer)",
+ "9x Matter Generation Coils (Centered 3x1x3 area in Bottom layer)",
+ "1x Input Hatch (Any bottom layer casing)", "1x Output Hatch (Any bottom layer casing)",
+ "1x Maintenance Hatch (Any bottom layer casing)", "1x Muffler Hatch (Centered 3x1x3 area in Top layer)",
+ "1x Energy Hatch (Any bottom layer casing)", "24x IC2 Reinforced Glass for the walls",
+ "Matter Fabricator Casings for the edges & top (40 at least!)", CORE.GT_Tooltip
+ };
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
return 0;
}
@Override
- public int getAmountOfOutputs() {
- return 1;
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
+ final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[] {
+ Textures.BlockIcons.CASING_BLOCKS[66],
+ new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER_ACTIVE
+ : Textures.BlockIcons.OVERLAY_FRONT_LARGE_BOILER)
+ };
+ }
+ return new ITexture[] {
+ Textures.BlockIcons.CASING_BLOCKS[66]
+ };
}
@Override
- public boolean explodesOnComponentBreak(ItemStack aStack) {
- return false;
+ public boolean isCorrectMachinePart(final ItemStack aStack) {
+ return true;
}
@Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
return new GregtechMTE_NuclearReactor(this.mName);
}
+ @Override
+ public void onConfigLoad(final GT_Config aConfig) {
+ }
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
index 811e049a8b..2d9512ce2f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -18,212 +18,234 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
-public class GregtechMetaTileEntity_AlloyBlastSmelter
- extends GT_MetaTileEntity_MultiBlockBase {
- private int mHeatingCapacity = 0;
-
- public GregtechMetaTileEntity_AlloyBlastSmelter(int aID, String aName, String aNameRegional) {
- super(aID, aName, aNameRegional);
- }
-
- public GregtechMetaTileEntity_AlloyBlastSmelter(String aName) {
- super(aName);
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GregtechMetaTileEntity_AlloyBlastSmelter(this.mName);
- }
-
- @Override
+public class GregtechMetaTileEntity_AlloyBlastSmelter extends GT_MetaTileEntity_MultiBlockBase {
+ private int mHeatingCapacity = 0;
+
+ public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntity_AlloyBlastSmelter(final String aName) {
+ super(aName);
+ }
+
+ @Override
+ public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) {
+ final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ // this.mHeatingCapacity = 0;
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) {
+ return false;
+ }
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) {
+ return false;
+ }
+ this.addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir), 72);
+
+ final byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
+
+ this.mHeatingCapacity = 20000;
+
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (i != 0 || j != 0) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j) != 14) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j) != 14) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j) != 15) {
+ return false;
+ }
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+ if (xDir + i != 0 || zDir + j != 0) {
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i,
+ 0, zDir + j);
+ if (!this.addMaintenanceToMachineList(tTileEntity, 72)
+ && !this.addInputToMachineList(tTileEntity, 72)
+ && !this.addOutputToMachineList(tTileEntity, 72)
+ && !this.addEnergyInputToMachineList(tTileEntity, 72)) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != ModBlocks.blockCasingsMisc) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 15) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ this.mHeatingCapacity += 100 * (GT_Utility.getTier(this.getMaxInputVoltage()) - 2);
+ return true;
+ }
+
+ @Override
+ public boolean checkRecipe(final ItemStack aStack) {
+ final ArrayList<ItemStack> tInputList = this.getStoredInputs();
+ for (int i = 0; i < tInputList.size() - 1; i++) {
+ for (int j = i + 1; j < tInputList.size(); j++) {
+ if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) {
+ if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) {
+ tInputList.remove(j--);
+ }
+ else {
+ tInputList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
+
+ final ArrayList<FluidStack> tFluidList = this.getStoredFluids();
+ for (int i = 0; i < tFluidList.size() - 1; i++) {
+ for (int j = i + 1; j < tFluidList.size(); j++) {
+ if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) {
+ if (tFluidList.get(i).amount >= tFluidList.get(j).amount) {
+ tFluidList.remove(j--);
+ }
+ else {
+ tFluidList.remove(i--);
+ break;
+ }
+ }
+ }
+ }
+ final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
+ if (tInputList.size() > 1) {
+ final long tVoltage = this.getMaxInputVoltage();
+ final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+ final GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(
+ this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
+ if (tRecipe != null && this.mHeatingCapacity >= tRecipe.mSpecialValue
+ && tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
+ Utils.LOG_WARNING("Found some Valid Inputs.");
+ this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000;
+ this.mEfficiencyIncrease = 10000;
+ if (tRecipe.mEUt <= 16) {
+ this.mEUt = tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1);
+ this.mMaxProgresstime = tRecipe.mDuration / (1 << tTier - 1);
+ }
+ else {
+ this.mEUt = tRecipe.mEUt;
+ this.mMaxProgresstime = tRecipe.mDuration;
+ while (this.mEUt <= gregtech.api.enums.GT_Values.V[tTier - 1]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+ }
+ if (this.mEUt > 0) {
+ this.mEUt = -this.mEUt;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mOutputFluids = new FluidStack[] {
+ tRecipe.getFluidOutput(0)
+ };
+ this.updateSlots();
+ return true;
+ }
+ }
+ Utils.LOG_WARNING("Failed to find some Valid Inputs.");
+ return false;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
+ final IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ "ElectricBlastFurnace.png");
+ }
+
+ @Override
+ public int getDamageToComponent(final ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
public String[] getDescription() {
- return new String[]{
- "Controller Block for the Alloy Blast Smelter", //Outputs 144mb fluid for every inputStack.stackSize; Time to use those hot metals.
- "Size: 3x3x4 (Hollow)",
- "Controller (front middle at bottom)",
- "16x Blast Smelter Heat Containment Coils (two middle Layers, hollow)",
- "1x Input bus (one of bottom)",
- "1x Output Hatch (one of bottom)",
- "1x Energy Hatch (one of bottom)",
- "1x Maintenance Hatch (one of bottom)",
- "1x Muffler Hatch (top middle)",
- "Blast Smelter Casings for the rest"};
- }
-
- @Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- if (aSide == aFacing) {
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)};
- }
- return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[72]};
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png");
- }
-
- @Override
+ return new String[] {
+ "Controller Block for the Alloy Blast Smelter", // Outputs 144mb
+ // fluid for
+ // every
+ // inputStack.stackSize;
+ // Time to use
+ // those hot
+ // metals.
+ "Size: 3x3x4 (Hollow)", "Controller (front middle at bottom)",
+ "16x Blast Smelter Heat Containment Coils (two middle Layers, hollow)", "1x Input bus (one of bottom)",
+ "1x Output Hatch (one of bottom)", "1x Energy Hatch (one of bottom)",
+ "1x Maintenance Hatch (one of bottom)", "1x Muffler Hatch (top middle)",
+ "Blast Smelter Casings for the rest"
+ };
+ }
+
+ @Override
+ public int getMaxEfficiency(final ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(final ItemStack aStack) {
+ return 10;
+ }
+
+ @Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- return Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes;
- }
-
- @Override
- public boolean isCorrectMachinePart(ItemStack aStack) {
- return true;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
- }
-
- @Override
- public boolean checkRecipe(ItemStack aStack) {
- ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
- if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
- if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
- tInputList.remove(j--);
- } else {
- tInputList.remove(i--);
- break;
- }
- }
- }
- }
- ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
-
- ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
- if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
- if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
- tFluidList.remove(j--);
- } else {
- tFluidList.remove(i--);
- break;
- }
- }
- }
- }
- FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1);
- if (tInputList.size() > 1) {
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
- GT_Recipe tRecipe = Recipe_GT.Gregtech_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs);
- if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) {
- Utils.LOG_WARNING("Found some Valid Inputs.");
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
- if (tRecipe.mEUt <= 16) {
- this.mEUt = (tRecipe.mEUt * (1 << tTier - 1) * (1 << tTier - 1));
- this.mMaxProgresstime = (tRecipe.mDuration / (1 << tTier - 1));
- } else {
- this.mEUt = tRecipe.mEUt;
- this.mMaxProgresstime = tRecipe.mDuration;
- while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) {
- this.mEUt *= 4;
- this.mMaxProgresstime /= 2;
- }
- }
- if (this.mEUt > 0