diff options
Diffstat (limited to 'src')
10 files changed, 173 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index d8c1d38498..91efec62fb 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -154,7 +154,9 @@ public class GTplusplus implements ActionListener { "Refines molten chemicals into nuclear fuels."); CORE.configSwitches.enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", "gregtech", true, "Large scale sifting."); - + CORE.configSwitches.enableMachine_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", + "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources."); + // Options RF2EU_Battery.rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 32ca2ec023..3a242ea10b 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -212,6 +212,7 @@ public final class ModItems { public static itemDehydratorCoilWire itemDehydratorCoilWire; public static itemDehydratorCoil itemDehydratorCoil; + public static Item itemLavaFilter; public static Item itemAirFilter; public static Item itemCoalCoke; @@ -219,6 +220,7 @@ public final class ModItems { + public static final void init(){ //Default item used when recipes fail, handy for debugging. @@ -569,6 +571,7 @@ public final class ModItems { itemDehydratorCoil = new itemDehydratorCoil(); itemAirFilter = new ItemAirFilter(); + itemLavaFilter = new ItemLavaFilter(); //Chemistry CoalTar.run(); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemLavaFilter.java b/src/Java/gtPlusPlus/core/item/general/ItemLavaFilter.java new file mode 100644 index 0000000000..07fe4748b0 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/general/ItemLavaFilter.java @@ -0,0 +1,122 @@ +package gtPlusPlus.core.item.general; + +import java.util.List; + +import gregtech.api.enums.ItemList; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; + +public class ItemLavaFilter extends CoreItem { + + public IIcon[] mIcon = new IIcon[1]; + + public ItemLavaFilter() { + super("itemLavaFilter", AddToCreativeTab.tabMachines, 1, 100, "Lava Filter", EnumRarity.common, + EnumChatFormatting.BLACK, false, null); + setGregtechItemList(); + } + + private final boolean setGregtechItemList() { + ItemList.Component_LavaFilter.set(this); + return ItemList.Component_LavaFilter.get(1) != null ? true : false; + } + + @Override + public void registerIcons(IIconRegister reg) { + this.mIcon[0] = reg.registerIcon(CORE.MODID + ":" + "itemLavaFilter"); + } + + @Override + public IIcon getIconFromDamage(int meta) { + return this.mIcon[0]; + } + + @Override + public String getItemStackDisplayName(ItemStack tItem) { + return "Lava Filter"; + } + + private static boolean createNBT(ItemStack rStack){ + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + tagNBT.setLong("Damage", 0); + tagMain.setTag("LavaFilter", tagNBT); + rStack.setTagCompound(tagMain); + return true; + } + + public static final long getFilterDamage(final ItemStack aStack) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("LavaFilter"); + if (aNBT != null) { + return aNBT.getLong("Damage"); + } + } + else { + createNBT(aStack); + } + return 0L; + } + + public static final boolean setFilterDamage(final ItemStack aStack, final long aDamage) { + NBTTagCompound aNBT = aStack.getTagCompound(); + if (aNBT != null) { + aNBT = aNBT.getCompoundTag("LavaFilter"); + if (aNBT != null) { + aNBT.setLong("Damage", aDamage); + return true; + } + } + return false; + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) { + if (stack.getTagCompound() == null){ + createNBT(stack); + } + double currentDamage = getFilterDamage(stack); + double durabilitypercent = currentDamage / 100; + return durabilitypercent; + } + + @SuppressWarnings("unchecked") + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { + list.add(EnumChatFormatting.GRAY+"Filters Lava within a Thermal Boiler."); + EnumChatFormatting durability = EnumChatFormatting.GRAY; + if (100-getFilterDamage(stack) > 80){ + durability = EnumChatFormatting.GRAY; + } + else if (100-getFilterDamage(stack) > 60){ + durability = EnumChatFormatting.GREEN; + } + else if (100-getFilterDamage(stack) > 40){ + durability = EnumChatFormatting.YELLOW; + } + else if (100-getFilterDamage(stack) > 20){ + durability = EnumChatFormatting.GOLD; + } + else if (100-getFilterDamage(stack) > 0){ + durability = EnumChatFormatting.RED; + } + list.add(durability+""+(100-getFilterDamage(stack))+EnumChatFormatting.GRAY+" / "+100); + super.addInformation(stack, player, list, bool); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return true; + } + + +} diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index ffe8ef6a43..6e4ee627a1 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -146,6 +146,7 @@ public class CORE { public static boolean enableMultiblock_NuclearFuelRefinery = true; public static boolean enableMultiblock_TreeFarmer = true; public static boolean enableMultiblock_IndustrialSifter = true; + public static boolean enableMachine_ThermalBoiler = true; //Visuals public static boolean enableTreeFarmerParticles = true; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index de6feb8950..e3604e2f7d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -71,7 +71,11 @@ public class RECIPES_Machines { //Tesseracts public static ItemStack RECIPE_TesseractGenerator; public static ItemStack RECIPE_TesseractTerminal; - + //Thermal Boiler + public static ItemStack RECIPE_ThermalBoilerController; + public static ItemStack RECIPE_ThermalBoilerCasing; + + //Buffer Cores public static ItemStack RECIPE_BufferCore_ULV = ItemUtils.getItemStack("miscutils:item.itemBufferCore1", 1); public static ItemStack RECIPE_BufferCore_LV = ItemUtils.getItemStack("miscutils:item.itemBufferCore2", 1); @@ -777,6 +781,30 @@ public class RECIPES_Machines { "plateCarbon", "plateCarbon", "plateCarbon", ItemUtils.simpleMetaStack(ModItems.itemAirFilter, 0, 1)); } + + if (CORE.configSwitches.enableMachine_ThermalBoiler){ + RECIPE_ThermalBoilerController = GregtechItemList.GT4_Thermal_Boiler.get(1); + RECIPE_ThermalBoilerCasing = GregtechItemList.Casing_ThermalContainment.get(4); + ItemStack centrifugeHV = ItemList.Machine_HV_Centrifuge.get(1); + + RecipeUtils.addShapedGregtechRecipe( + "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator", + "gearTitanium", "circuitElite", "gearTitanium", + "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator", + RECIPE_ThermalBoilerController); + + RecipeUtils.addShapedGregtechRecipe( + "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator", + "gearTungstenSteel", "circuitElite", "gearTungstenSteel", + "craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator", + RECIPE_ThermalBoilerController); + + RecipeUtils.addShapedGregtechRecipe( + "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel", + "circuitAdvanced", CI.machineHull_HV, "circuitAdvanced", + "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel", + RECIPE_ThermalBoilerCasing); + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index cb8c0732cd..7462451c91 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -167,7 +167,10 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Cyclotron_Coil, Casing_Cyclotron_External, - Casing_PlaceHolder11, + //Thermal Boiler + Casing_ThermalContainment, + + Casing_PlaceHolder12, Casing_PlaceHolder13, Casing_PlaceHolder14, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index a7d7b922ee..62398931b9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -6,7 +6,6 @@ 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.CasingTextureHandler2; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -31,7 +30,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Incoloy Casing"); //81 GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Placeholder Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Placeholder Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Placeholder Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Placeholder Casing "); @@ -47,7 +46,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_PlaceHolder8.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_PlaceHolder11.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_PlaceHolder12.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_PlaceHolder13.set(new ItemStack(this, 1, 13)); GregtechItemList.Casing_PlaceHolder14.set(new ItemStack(this, 1, 14)); 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 3d8b98fd7f..e3ccfeadec 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -44,7 +44,7 @@ public class CasingTextureHandler2 { return TexturesGtBlock.Casing_Material_HastelloyX.getIcon(); //Multitank Exterior Casing case 11: - return TexturesGtBlock._PlaceHolder.getIcon(); + return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); //Reactor Casing I case 12: return TexturesGtBlock._PlaceHolder.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java index 9f261178b5..c93837f85c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GT4Entity_ThermalBoiler.java @@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import java.util.Collection; -import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -10,6 +9,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; +import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import net.minecraft.entity.player.EntityPlayer; @@ -129,14 +129,13 @@ extends GT_MetaTileEntity_MultiBlockBase "Converts Heat into Steam", "Size: 3x3x3 (Hollow)", "Controller (front middle)", - "1x Input Hatch (Centre of back)", - "2x Output Hatch (Centre of sides)", + "1x Output Hatch (Centre of back)", + "2x Input Hatch (Centre of sides)", "1x Maintenance Hatch (Centre of top)", - "20x Blast Smelter Heat Containment Coils", + "Thermal Containment Casings for the rest", CORE.GT_Tooltip}; } - @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { @@ -151,9 +150,9 @@ extends GT_MetaTileEntity_MultiBlockBase byte tSide = getBaseMetaTileEntity().getBackFacing(); if (getBaseMetaTileEntity().getAirAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 1)) { - int META = 0; + int META = 11; int CASING = TAE.GTPP_INDEX(1); - if (((getBaseMetaTileEntity().getBlockAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != META)) && + if (((getBaseMetaTileEntity().getBlockAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != ModBlocks.blockCasings2Misc) || (getBaseMetaTileEntity().getMetaIDAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2) != META)) && (!addToMachineList(getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(getBaseMetaTileEntity().getBackFacing(), 2), CASING))) { Utils.LOG_INFO("false 1"); return false; @@ -165,7 +164,7 @@ extends GT_MetaTileEntity_MultiBlockBase for (byte k = 0; k < 3; k = (byte)(k + 1)) { if (((i == 0) || (j == 0)) && (k == 1)) { - if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == GregTech_API.sBlockCasings1) + if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == ModBlocks.blockCasings2Misc) { if (getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == META) {} } @@ -174,7 +173,7 @@ extends GT_MetaTileEntity_MultiBlockBase return false; } } - else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == GregTech_API.sBlockCasings1) + else if (getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == ModBlocks.blockCasings2Misc) { if (getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide < 4 ? i : -k), tY + j, tZ + (tSide < 4 ? -k : tSide == 3 ? k : i)) == META) {} } diff --git a/src/resources/assets/miscutils/textures/items/itemLavaFilter.png b/src/resources/assets/miscutils/textures/items/itemLavaFilter.png Binary files differnew file mode 100644 index 0000000000..92a06a3a9a --- /dev/null +++ b/src/resources/assets/miscutils/textures/items/itemLavaFilter.png |