diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod')
8 files changed, 632 insertions, 5 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index a53401707b..10175d414d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -345,10 +345,19 @@ public enum GregtechItemList implements GregtechItemContainer { Industrial_Mixer, - Hatch_Input_Cryotheum, Hatch_Input_Pyrotheum, + Hatch_Input_Cryotheum, + Hatch_Input_Pyrotheum, + Hatch_Input_Naquadah, Cover_Overflow_ULV, Cover_Overflow_LV, Cover_Overflow_MV, Cover_Overflow_HV, Cover_Overflow_EV, Cover_Overflow_IV, + //Naq Reactor + Casing_Naq_Reactor_A, + Casing_Naq_Reactor_B, + Casing_Naq_Reactor_C, + Controller_Naq_Reactor, + + ; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java new file mode 100644 index 0000000000..9878df799d --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java @@ -0,0 +1,152 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + +public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_Input { + + public final FluidStack[] mFluidsToUse = new FluidStack[3]; + public final int mFluidCapacity; + + public GT_MetaTileEntity_Hatch_Naquadah(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional, 6); + mFluidCapacity = 32000; + initHatch(); + } + + public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String aDescription, + final ITexture[][][] aTextures) { + super(aName, 6, aDescription, aTextures); + mFluidCapacity = 32000; + initHatch(); + } + + public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription, + final ITexture[][][] aTextures) { + super(aName, 6, aDescription, aTextures); + mFluidCapacity = 32000; + initHatch(); + } + + private void initHatch() { + if (mFluidsToUse[0] == null) { + mFluidsToUse[0] = Materials.Naquadah.getMolten(1); + } + if (mFluidsToUse[1] == null) { + mFluidsToUse[1] = Materials.NaquadahEnriched.getMolten(1); + } + if (mFluidsToUse[2] == null) { + mFluidsToUse[2] = Materials.Naquadria.getMolten(1); + } + } + + public ITexture[] getTexturesActive(final ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT_ACTIVE) }; + } + + public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_FRONT) }; + } + + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) { + for (FluidStack f : mFluidsToUse) { + if (f != null) { + if (GT_Utility.getFluidForFilledItem(aStack, true).getFluid() == f.getFluid()) { + return true; + } + } + } + } + return false; + } + + public boolean isFluidInputAllowed(final FluidStack aFluid) { + for (FluidStack f : mFluidsToUse) { + if (f != null) { + if (aFluid.getFluid() == f.getFluid()) { + return true; + } + } + } + return false; + } + + public int getCapacity() { + return this.mFluidCapacity; + } + + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescriptionArray, this.mTextures); + } + + @Override + public String[] getDescription() { + if (aDescCache[0] == null || aDescCache[0].contains(".name") || aDescCache[0].contains("fluid.")) { + aDescCache[0] = formatFluidString(this.mFluidsToUse[0]); + } + if (aDescCache[1] == null || aDescCache[1].contains(".name") || aDescCache[1].contains("fluid.")) { + aDescCache[1] = formatFluidString(this.mFluidsToUse[1]); + } + if (aDescCache[2] == null || aDescCache[2].contains(".name") || aDescCache[2].contains("fluid.")) { + aDescCache[2] = formatFluidString(this.mFluidsToUse[2]); + } + String aNaq = aDescCache[0]; + String aEnrNaq = aDescCache[1]; + String aNaquad = aDescCache[2]; + String[] s2 = new String[]{ + "Fluid Input for Multiblocks", + "Capacity: " + getCapacity()+"L", + "Accepted Fluid: " + aNaq, + "Accepted Fluid: " + aEnrNaq, + "Accepted Fluid: " + aNaquad + }; + return s2; + } + + private static String[] aDescCache = new String[3]; + private String formatFluidString(FluidStack f) { + FluidStack mLockedStack = f; + Integer mLockedTemp = 0;; + String mTempMod = ""+EnumChatFormatting.RESET; + mLockedTemp = mLockedStack.getFluid().getTemperature(); + if (mLockedTemp != null) { + if (mLockedTemp <= -3000) { + mTempMod = ""+EnumChatFormatting.DARK_PURPLE; + } + else if (mLockedTemp >= -2999 && mLockedTemp <= -500) { + mTempMod = ""+EnumChatFormatting.DARK_BLUE; + } + else if (mLockedTemp >= -499 && mLockedTemp <= -50) { + mTempMod = ""+EnumChatFormatting.BLUE; + } + else if (mLockedTemp >= 30 && mLockedTemp <= 300) { + mTempMod = ""+EnumChatFormatting.AQUA; + } + else if (mLockedTemp >= 301 && mLockedTemp <= 800) { + mTempMod = ""+EnumChatFormatting.YELLOW; + } + else if (mLockedTemp >= 801 && mLockedTemp <= 1500) { + mTempMod = ""+EnumChatFormatting.GOLD; + } + else if (mLockedTemp >= 1501) { + mTempMod = ""+EnumChatFormatting.RED; + } + } + return mTempMod + mLockedStack.getLocalizedName(); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java index 64c98feff0..c664936a0b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java @@ -61,9 +61,9 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H return this.mFluidCapacity; } - private FluidStack mLockedStack = null; - private Integer mLockedTemp = null; - private String mTempMod = null; + protected FluidStack mLockedStack = null; + protected Integer mLockedTemp = null; + protected String mTempMod = null; @Override public String[] getDescription() { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java new file mode 100644 index 0000000000..30bee6a84c --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -0,0 +1,129 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; + + +public class GregtechMetaCasingBlocks4 +extends GregtechMetaCasingBlocksAbstract { + + public GregtechMetaCasingBlocks4() { + super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.4", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Naquadah Reactor Piping"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Reactor Containment"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", " "); + GregtechItemList.Casing_Naq_Reactor_A.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Naq_Reactor_B.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Naq_Reactor_C.set(new ItemStack(this, 1, 2)); + /*GregtechItemList.Casing_Refinery_Internal.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_Vanadium_Redox.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_Power_SubStation.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_Cyclotron_Coil.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14)); + GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15));*/ + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + //Centrifuge + case 0: + return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A.getIcon(); + //Coke Oven Frame + case 1: + return TexturesGtBlock.TEXTURE_TECH_C.getIcon(); + //Coke Oven Casing Tier 1 + case 2: + return TexturesGtBlock.TEXTURE_METAL_PANEL_E.getIcon(); + //Coke Oven Casing Tier 2 + case 3: + return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon(); + //Material Press Casings + case 4: + return TexturesGtBlock.Casing_Material_Grisium.getIcon(); + //Sifter Structural + case 5: + return TexturesGtBlock.Casing_Machine_Metal_Panel_A.getIcon(); + //Sifter Sieve + case 6: + return TexturesGtBlock.Casing_Machine_Metal_Grate_A.getIcon(); + + //Vanadium Radox Battery + case 7: + return TexturesGtBlock.Casing_Redox_1.getIcon(); + //Power Sub-Station Casing + case 8: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon(); + //Cyclotron Coil + case 9: + return TexturesGtBlock.Overlay_Machine_Cyber_A.getIcon(); + //Cyclotron External Casing + case 10: + return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + //Multitank Exterior Casing + case 11: + return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); + //Reactor Casing I + case 12: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + //Reactor Casing II + case 13: + if (aSide <2) { + return TexturesGtBlock.TEXTURE_TECH_A.getIcon(); + } + else { + return TexturesGtBlock.TEXTURE_TECH_B.getIcon(); + } + case 14: + return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 15: + if (aSide <2) { + if (aSide == 1) { + return TexturesGtBlock.Casing_Machine_Podzol.getIcon(); + } + return TexturesGtBlock.Casing_Machine_Acacia_Log.getIcon(); + } + else { + return TexturesGtBlock.Casing_Machine_Farm_Manager.getIcon(); + } + default: + return TexturesGtBlock.Overlay_UU_Matter.getIcon(); + + } + } + return TexturesGtBlock._PlaceHolder.getIcon(); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java new file mode 100644 index 0000000000..a6b4d48333 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java @@ -0,0 +1,299 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures.BlockIcons; +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_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import java.util.ArrayList; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + +public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { + + public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>(); + + public GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMTE_LargeNaqReactor(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMTE_LargeNaqReactor(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Assembly Line", + "Size: 3x(5-16)x4, variable length", + "Bottom: Steel Machine Casing(or Maintenance or Input Hatch),", + "Input Bus (Last Output Bus), Steel Machine Casing", + "Middle: Reinforced Glass, Assembly Line, Reinforced Glass", + "UpMiddle: Grate Machine Casing,", + " Assembler Machine Casing,", + " Grate Machine Casing (or Controller or Data Access Hatch)", + "Top: Steel Casing(or Energy Hatch)", + "Up to 16 repeating slices, last is Output Bus", + "Optional 1x Data Access Hatch next to the Controller"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + return aSide == aFacing + ? new ITexture[]{BlockIcons.CASING_BLOCKS[16], + new GT_RenderedTexture(aActive + ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active + : TexturesGtBlock.Overlay_Machine_Controller_Default)} + : new ITexture[]{BlockIcons.CASING_BLOCKS[16]}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), + "AssemblyLine.png"); + } + + public GT_Recipe_Map getRecipeMap() { + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(ItemStack aStack) { + return false; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, + aZ); + } + + } + + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + int r; + int i; + IGregTechTileEntity tTileEntity; + if (xDir != 0) { + for (r = 0; r <= 16; ++r) { + i = r * xDir; + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, 0, i); + if (i != 0 + && (aBaseMetaTileEntity.getBlockOffset(0, 0, i) != GregTech_API.sBlockCasings3 + || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 10) + && r == 1 && !this.addNaquadahHatchToMachineInput(tTileEntity, 16)) { + return false; + } + + if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) { + return false; + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) + && !this.addInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) { + return false; + } + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 1, i); + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) { + return false; + } + } + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, 0, i) != GregTech_API.sBlockCasings2 + || aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i) != 9)) { + return false; + } + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != GregTech_API.sBlockCasings2 + || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 5)) { + return false; + } + + if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, 0, i) != GregTech_API.sBlockCasings3 + || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, 0, i) != 10) { + return false; + } + + if (!aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i).getUnlocalizedName() + .equals("blockAlloyGlass")) { + return false; + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) + && !this.addInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) { + return false; + } + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i); + if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) { + return r > 0 && this.mEnergyHatches.size() > 0; + } + } + } else { + for (r = 0; r <= 16; ++r) { + i = r * -zDir; + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, 0); + if (i != 0 + && (aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != GregTech_API.sBlockCasings3 + || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 10) + && r == 1 && !this.addNaquadahHatchToMachineInput(tTileEntity, 16)) { + return false; + } + + if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) { + return false; + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) + && !this.addInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) { + return false; + } + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 1, zDir); + if (!this.addEnergyInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) { + return false; + } + } + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, 0, zDir) != GregTech_API.sBlockCasings2 + || aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir) != 9)) { + return false; + } + + if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != GregTech_API.sBlockCasings2 + || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 5)) { + return false; + } + + if (aBaseMetaTileEntity.getBlockOffset(i, 0, zDir * 2) != GregTech_API.sBlockCasings3 + || aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir * 2) != 10) { + return false; + } + + if (!aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2).getUnlocalizedName() + .equals("blockAlloyGlass")) { + return false; + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2); + if (!this.addMaintenanceToMachineList(tTileEntity, 16) + && !this.addInputToMachineList(tTileEntity, 16)) { + if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != GregTech_API.sBlockCasings2) { + return false; + } + + if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) { + return false; + } + } + + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir); + if (!this.addInputToMachineList(tTileEntity, 16) && this.addOutputToMachineList(tTileEntity, 16)) { + return r > 0 && this.mEnergyHatches.size() > 0; + } + } + } + + return false; + } + + public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) aMetaTileEntity); + } else { + return false; + } + } + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 133; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + + @Override + public String getMachineType() { + return "Reactor"; + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index 2cf8994a0d..375b63e584 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -8,6 +8,7 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4; public class Gregtech_Blocks { @@ -22,6 +23,7 @@ public class Gregtech_Blocks { ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks(); ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2(); ModBlocks.blockCasings3Misc = new GregtechMetaCasingBlocks3(); + ModBlocks.blockCasings4Misc = new GregtechMetaCasingBlocks4(); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 6ad5ff2866..0573ba2c20 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -7,6 +7,7 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; public class GregtechCustomHatches { @@ -37,7 +38,14 @@ public class GregtechCustomHatches { 968, // ID "hatch.pyrotheum.input.tier.00", // unlocal name "Pyrotheum Heating Vent" //Local name - ).getStackForm(1L)); + ).getStackForm(1L)); + + GregtechItemList.Hatch_Input_Naquadah.set( + new GT_MetaTileEntity_Hatch_Naquadah( + 969, // ID + "hatch.naquadah.input.tier.00", // unlocal name + "Naquadah Reactor Input hatch" //Local name + ).getStackForm(1L)); RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[6], ALLOY.MARAGING250.getGear(1), CI.component_Plate[6], @@ -51,6 +59,12 @@ public class GregtechCustomHatches { CI.component_Plate[6], ItemList.Hatch_Input_IV.get(1), CI.component_Plate[6], GregtechItemList.Hatch_Input_Pyrotheum.get(1L, new Object[0])); + RecipeUtils.addShapedGregtechRecipe( + CI.component_Plate[8], ALLOY.HG1223.getGear(1), CI.component_Plate[9], + CI.getTieredCircuitOreDictName(7), GregtechItemList.Casing_Naq_Reactor_A.get(1), CI.getTieredCircuitOreDictName(7), + CI.component_Plate[9], ItemList.Hatch_Input_ZPM.get(1), CI.component_Plate[8], + GregtechItemList.Hatch_Input_Naquadah.get(1L, new Object[0])); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java new file mode 100644 index 0000000000..484737471e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_LargeNaqReactor; + +public class GregtechNaqReactor { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Futuristic Naquadah Reactor {LNR]."); + run1(); + } + + } + + private static void run1() { + // LFTR + GregtechItemList.Controller_Naq_Reactor.set(new GregtechMTE_LargeNaqReactor(991, "lnr.controller.single", "Large Naquadah Reactor").getStackForm(1L)); + + } +} |