diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-12-27 20:32:34 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-12-27 20:32:34 +1000 |
commit | d8917c9359495b52aa744c747b4689ca8b94ea79 (patch) | |
tree | 60283c393466f4f7659f50acf6eaebf833007fb8 /src/Java/gtPlusPlus/xmod | |
parent | 2e4001d320d022a2640267330769d713f79f3c61 (diff) | |
download | GT5-Unofficial-d8917c9359495b52aa744c747b4689ca8b94ea79.tar.gz GT5-Unofficial-d8917c9359495b52aa744c747b4689ca8b94ea79.tar.bz2 GT5-Unofficial-d8917c9359495b52aa744c747b4689ca8b94ea79.zip |
+ Added the Fission Fuel Processing Plant.
+ Added a config option for the FFPP.
+ Added new textures for the new casings.
- Removed obsolete tooltips on casing blocks.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
7 files changed, 297 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 53fd7b3a3f..a8c5095590 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -133,14 +133,17 @@ public enum GregtechItemList implements GregtechItemContainer { //Casings Tier 2 [17-32] Casing_StructuralGlass, - Casing_PlaceHolder1, Casing_PlaceHolder2, Casing_PlaceHolder3, + Casing_Refinery_External, Casing_Refinery_Structural, Casing_Refinery_Internal, Casing_PlaceHolder4, Casing_PlaceHolder5, Casing_PlaceHolder6, Casing_PlaceHolder7, Casing_PlaceHolder8, Casing_PlaceHolder9, Casing_PlaceHolder10, Casing_PlaceHolder11, Casing_PlaceHolder12, Casing_PlaceHolder13, Casing_PlaceHolder14, Casing_PlaceHolder15, //LFTR - ThoriumReactor, + ThoriumReactor, + + //Nuclear Fuel Processor + Industrial_FuelRefinery, ; public static final GregtechItemList[] diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 7bc98b91ec..4f5744e5ec 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -21,10 +21,10 @@ extends GregtechMetaCasingBlocksAbstract { for (byte i = 0; i < 16; i = (byte) (i + 1)) { Textures.BlockIcons.CASING_BLOCKS[GTID + i] = new GT_CopiedBlockTexture(this, 6, i); } - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Strctural Glass Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Placeholder Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Placeholder Casing"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Placeholder Casing"); //60 + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Structural Glass Casing"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); //60 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Placeholder Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Placeholder Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Incoloy Casing"); @@ -38,9 +38,9 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Placeholder Casing "); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Placeholder Casing "); GregtechItemList.Casing_StructuralGlass.set(new ItemStack(this, 1, 0)); - GregtechItemList.Casing_PlaceHolder1.set(new ItemStack(this, 1, 1)); - GregtechItemList.Casing_PlaceHolder2.set(new ItemStack(this, 1, 2)); - GregtechItemList.Casing_PlaceHolder3.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_Refinery_Internal.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_PlaceHolder4.set(new ItemStack(this, 1, 4)); GregtechItemList.Casing_PlaceHolder5.set(new ItemStack(this, 1, 5)); GregtechItemList.Casing_PlaceHolder6.set(new ItemStack(this, 1, 6)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java index ca0dee0692..6387d52c21 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -41,16 +41,16 @@ extends ItemBlock { super.addInformation(aStack, aPlayer, aList, aF3_H); switch (getDamage(aStack)) { case 0: - aList.add(this.mCasing_Centrifuge); + //aList.add(this.mCasing_Centrifuge); break; case 1: - aList.add(this.mCasing_CokeOven); + //aList.add(this.mCasing_CokeOven); break; case 2: - aList.add(this.mCasing_CokeCoil1); + //aList.add(this.mCasing_CokeCoil1); break; case 3: - aList.add(this.mCasing_CokeCoil2); + //aList.add(this.mCasing_CokeCoil2); break; default: break; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java index bd2edd22fa..aa4a4f603e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -12,13 +12,13 @@ public class CasingTextureHandler2 { return TexturesGtBlock.Casing_Machine_Dimensional_Adv.getIcon(); //Coke Oven Frame case 1: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.Casing_Material_HastelloyX.getIcon(); //Coke Oven Casing Tier 1 case 2: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.Casing_Material_HastelloyN.getIcon(); //Coke Oven Casing Tier 2 case 3: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon(); //Material Press Casings case 4: return TexturesGtBlock._PlaceHolder.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index b0a327934a..e9ffb7ad74 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -103,6 +103,14 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide; + + private static final CustomIcon Internal_Casing_HastelloyX = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); + public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX; + private static final CustomIcon Internal_Casing_HastelloyN = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); + public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN; + private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); + public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS; + //Material Machine/Firebox Casings private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java new file mode 100644 index 0000000000..cf843f0886 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java @@ -0,0 +1,242 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; + +import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2.GTID; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; + +import java.util.ArrayList; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBlockBase { + + private boolean completedCycle = false; + + public GregtechMetaTileEntity_Refinery(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_Refinery(String aName) { + super(aName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Fuel Processing Unit", + "Size(WxHxD): 3x9x3", "Controller (Front middle at bottom)", + "3x2x3 Base platform of Hastelloy-X", + "1x3x1 Incoloy-DS Fluid Containment Block pillar (Center of base)", + "1x3x1 Hastelloy-N Sealant Blocks (Each Incoloy-DS Fluid Containment side and on top)", + "2x Input Hatch (One of base platform)", + "2x Output Hatch (One of base platform)", + "1x Output Bus (One of base platform)", + "1x Maintenance Hatch (One of base platform)", + "1x Energy Hatch (One of base platform)"}; + } + + 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[GTID+2], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+2]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LFTR.png"); + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + if (mInventory[1] == null || (mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && mInventory[1].stackSize < mInventory[1].getMaxStackSize())) { + ArrayList<ItemStack> tItems = getStoredInputs(); + for (ItemStack tStack : tItems) { + if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + if (tStack.stackSize < 2) { + tStack = null; + } else { + tStack.stackSize--; + } + + } + if (mInventory[1] == null) { + mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L); + } else { + mInventory[1].stackSize++; + } + } + } + FluidStack tFluid = null;//GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); + if (tFluid == null) { + return false; + } + if (getYOfPumpHead() > 0 && getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) { + if (completedCycle) { + moveOneDown(); + } + tFluid = null; + if (mEnergyHatches.size() > 0 && mEnergyHatches.get(0).getEUVar() > (512 + getMaxInputVoltage() * 4)) + completedCycle = true; + } else if (tFluid.amount < 5000) { + stopMachine(); + return false; + } else { + tFluid.amount = tFluid.amount / 5000; + } + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + int tEU = 24; + int tDuration = 160; + if (tEU <= 16) { + this.mEUt = (tEU * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (tDuration / (1 << tTier - 1)); + } else { + this.mEUt = tEU; + this.mMaxProgresstime = tDuration; + 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[]{tFluid}; + return true; + } + + private boolean moveOneDown() { + if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1) + || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { + return false; + } + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int yHead = getYOfPumpHead(); + if (yHead < 1) { + return false; + } + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) { + return false; + } + if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { + return false; + } + if (yHead != getBaseMetaTileEntity().getYCoord()) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); + } + getBaseMetaTileEntity().decrStackSize(1, 1); + return true; + } + + private int getYOfPumpHead() { + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + int y = getBaseMetaTileEntity().getYCoord() - 1; + while (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { + y--; + } + if (y == getBaseMetaTileEntity().getYCoord() - 1) { + if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { + return y + 1; + } + } else if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility + .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L)) && this.mInventory[1] != null && this.mInventory[1].stackSize > 0 && GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) { + getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, y, getBaseMetaTileEntity().getZCoord() + zDir, + GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); + getBaseMetaTileEntity().decrStackSize(0, 1); + } + return y; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j); + if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16)) && (!addOutputToMachineList(tTileEntity, 16)) && (!addEnergyInputToMachineList(tTileEntity, 16))) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j) != 0) { + return false; + } + } + } + } + } + for (int y = 2; y < 6; y++) { + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != GregTech_API.sBlockCasings2) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != GregTech_API.sBlockMachines) { + return false; + } + if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != GregTech_API.sBlockMachines) { + return false; + } + } + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public int getAmountOfOutputs() { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Refinery(this.mName); + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java new file mode 100644 index 0000000000..4fed90007d --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java @@ -0,0 +1,28 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntity_Refinery; + +public class GregtechIndustrialFuelRefinery +{ + + + + public static void run() + { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech){ + Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Fuel Processing and Refinery Multiblock."); + if (CORE.configSwitches.enableMultiblock_NuclearFuelRefinery) run1(); + } + + } + + private static void run1() + { + //Industrial Maceration Stack Multiblock + GregtechItemList.Industrial_FuelRefinery.set(new GregtechMetaTileEntity_Refinery(835, "industrialrefinery.controller.tier.single", "Fission Fuel Processing Plant").getStackForm(1L)); + + } +}
\ No newline at end of file |