diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common')
2 files changed, 428 insertions, 0 deletions
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 |