From b9e2df8a29b3903b07c7a2ba187acc5f3f960ce8 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Mon, 16 Apr 2018 20:23:27 +1000 Subject: + Added the Advanced Cryogenic Freezer (Advanced Vacuum Freezer). - Removed some logging. --- .../common/blocks/GregtechMetaCasingBlocks3.java | 4 +- .../blocks/textures/CasingTextureHandler3.java | 4 +- .../common/blocks/textures/TexturesGtBlock.java | 1 + ...techMetaTileEntity_IndustrialVacuumFreezer.java | 149 +++++++++++++++++++++ 4 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 88e690f43d..c38d2ff6bf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -55,7 +55,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Placeholder"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Placeholder"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Placeholder"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Placeholder"); @@ -71,7 +71,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Vanadium_Redox_UV.set(new ItemStack(this, 1, 7)); GregtechItemList.Casing_Vanadium_Redox_MAX.set(new ItemStack(this, 1, 8)); GregtechItemList.Casing_AmazonWarehouse.set(new ItemStack(this, 1, 9)); - //GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_AdvancedVacuum.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)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java index f2ec97c42c..a8d363ca0c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; import net.minecraft.util.IIcon; +import gregtech.api.enums.Textures; + public class CasingTextureHandler3 { public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] @@ -38,7 +40,7 @@ public class CasingTextureHandler3 { //Amazon Warehouse Casing return TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon(); case 10: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon(); case 11: return TexturesGtBlock._PlaceHolder.getIcon(); case 12: 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 b3d751a58f..4a8f3131b9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -208,6 +208,7 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON"); + public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); //Overlays //Fan Textures diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java new file mode 100644 index 0000000000..f087f72265 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -0,0 +1,149 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidRegistry; + +import gregtech.api.enums.TAE; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; + +import net.minecraft.item.ItemStack; +import gregtech.api.util.GT_Recipe; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import net.minecraft.entity.player.InventoryPlayer; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; + +public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta_MultiBlockBase { + + public static int CASING_TEXTURE_ID; + public static String mCryoFuelName = "Gelid Cryotheum"; + public static String mCasingName = "Advanced Crygenic Casing"; + + public GregtechMetaTileEntity_IndustrialVacuumFreezer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); + mCryoFuelName = FluidUtils.getFluidStack("cryotheum", 1).getLocalizedName(); + mCasingName = GregtechItemList.Casing_AdvancedVacuum.get(1).getDisplayName(); + } + + public GregtechMetaTileEntity_IndustrialVacuumFreezer(final String aName) { + super(aName); + CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); + mCryoFuelName = FluidUtils.getFluidStack("cryotheum", 1).getLocalizedName(); + mCasingName = GregtechItemList.Casing_AdvancedVacuum.get(1).getDisplayName(); + } + + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return (IMetaTileEntity) new GregtechMetaTileEntity_IndustrialVacuumFreezer(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Advanced Cryogenic Freezer", + "Super cools hot ingots and cells", + "Processes four Vacuum Freezer Recipes at double speed", + "Consumes 1L of "+mCryoFuelName+"/t during operation", + "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", + "1x Input Bus (Any casing)", + "1x Output Bus (Any casing)", + "1x Input Hatch (Any casing)", + "1x Output Hatch (Any casing)", + "1x Maintenance Hatch (Any casing)", + "1x Energy Hatch (Any casing)", + mCasingName+"s for the rest (10 at least!)"}; + } + + 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[106], + new GT_RenderedTexture((IIconContainer) (aActive + ? Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE + : Textures.BlockIcons.OVERLAY_FRONT_VACUUM_FREEZER))}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[106]}; + } + + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, + final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), + "VacuumFreezer.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sVacuumRecipes; + } + + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; + } + + public boolean isFacingValid(final byte aFacing) { + return aFacing > 1; + } + + public boolean checkRecipe(final ItemStack aStack) { + return this.checkRecipeGeneric(4, 100, 200); + } + + public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + final int xDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetX; + final int zDir = ForgeDirection.getOrientation((int) aBaseMetaTileEntity.getBackFacing()).offsetZ; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { + return false; + } + int tAmount = 0; + for (int i = -1; i < 2; ++i) { + for (int j = -1; j < 2; ++j) { + for (int h = -1; h < 2; ++h) { + if (h != 0 || ((xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0))) { + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + if (!this.addMaintenanceToMachineList(tTileEntity, CASING_TEXTURE_ID) + && !this.addInputToMachineList(tTileEntity, CASING_TEXTURE_ID) + && !this.addOutputToMachineList(tTileEntity, CASING_TEXTURE_ID) + && !this.addEnergyInputToMachineList(tTileEntity, CASING_TEXTURE_ID)) { + if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, + zDir + j) != ModBlocks.blockCasings3Misc) { + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 10) { + return false; + } + ++tAmount; + } + } + } + } + } + return tAmount >= 10; + } + + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(final ItemStack aStack) { + return 400; + } + + public int getDamageToComponent(final ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public boolean hasSlotInGUI() { + return false; + } +} \ No newline at end of file -- cgit