diff options
author | Alkalus <Draknyte1@hotmail.com> | 2020-05-31 20:10:14 +0100 |
---|---|---|
committer | Alkalus <Draknyte1@hotmail.com> | 2020-05-31 20:10:14 +0100 |
commit | cf125cd1dff982663ec687cd0e2c06662df355a5 (patch) | |
tree | 749323be011a7fd58aaa6c80c8a8ce351746dab7 /src | |
parent | ee9e7f7fa07b547a0d9591392712ef4d3580a3d1 (diff) | |
download | GT5-Unofficial-cf125cd1dff982663ec687cd0e2c06662df355a5.tar.gz GT5-Unofficial-cf125cd1dff982663ec687cd0e2c06662df355a5.tar.bz2 GT5-Unofficial-cf125cd1dff982663ec687cd0e2c06662df355a5.zip |
+ Added recipes for Laurenium and Botmium casings.
- Removed VFCs ability to handle flasks with fluid in them.
- Disabled Thaumic Tinkerer Hazmat additions.
- Disabled Item Overflow Covers.
% Made Green Rocket Fuel more expensive.
% Made Purple Rocket Fuel use less copper, give more output.
$ Fixed unloacl name of GT++ Super Chests, to prevent GT's Language Manager re-using the Localised String.
$ Fixed handling of large recipes in GT_NEI_multiCentriElectroFreezer.
$ Fixed Automation of Pollution Scrubbers.
Diffstat (limited to 'src')
8 files changed, 242 insertions, 120 deletions
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index c91efd4ec8..86088fe8c6 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -100,7 +100,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 16), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 12), ItemUtils.getSimpleStack(GenericChem.mOrangeCatalyst, 0), }, new FluidStack[] { @@ -397,14 +397,14 @@ public class RocketFuels extends ItemPackage { CI.getNumberedCircuit(3), }, new FluidStack[] { - FluidUtils.getFluidStack(Monomethylhydrazine, 1000), + FluidUtils.getFluidStack(Monomethylhydrazine, 2000), FluidUtils.getFluidStack("nitricacid", 1000), }, new ItemStack[] { }, new FluidStack[] { - FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 3000), + FluidUtils.getFluidStack(Monomethylhydrazine_Plus_Nitric_Acid, 2000), }, 20 * 45, @@ -425,12 +425,12 @@ public class RocketFuels extends ItemPackage { }, new FluidStack[] { - FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 4000), + FluidUtils.getFluidStack(Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide, 5000), }, 20 * 60, 480, - 5); + 6); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 817683cb1e..af694fa07d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -338,6 +338,54 @@ public class RECIPES_GREGTECH { 2); } + int aLaureniumTier = ALLOY.LAURENIUM.vTier; + // Adding Recipes for Casings + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(12), + CI.getTieredMachineCasing(aLaureniumTier), + CI.getPlate(aLaureniumTier-1, 8), + CI.getGear(aLaureniumTier, 2), + CI.getBolt(aLaureniumTier-3, 16) + }, + new FluidStack[] { + CI.getTieredFluid(aLaureniumTier, 2 * 144), + CI.getAlternativeTieredFluid(aLaureniumTier-1, 4 * 144) + }, + new ItemStack[] { + GregtechItemList.Casing_Machine_Custom_3.get(1) + }, + new FluidStack[] { + + }, + 20 * 20, + MaterialUtils.getVoltageForTier(aLaureniumTier-2), + 5); + + int aBotmiumTier = ALLOY.BOTMIUM.vTier; + // Adding Recipes for Casings + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(12), + CI.getTieredMachineCasing(aBotmiumTier), + CI.getPlate(aBotmiumTier-1, 8), + CI.getGear(aBotmiumTier, 2), + CI.getBolt(aBotmiumTier-3, 16) + }, + new FluidStack[] { + CI.getTieredFluid(aBotmiumTier, 2 * 144), + CI.getAlternativeTieredFluid(aBotmiumTier-1, 4 * 144) + }, + new ItemStack[] { + GregtechItemList.Casing_Machine_Custom_4.get(1) + }, + new FluidStack[] { + + }, + 20 * 20, + MaterialUtils.getVoltageForTier(aBotmiumTier-2), + 6); + } private static void fluidheaterRecipes() { diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java index 6ced7ac7f7..e20a538ea7 100644 --- a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java +++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java @@ -117,7 +117,21 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide return false; } + boolean aAllowFluid = false; + boolean aHasFluid = false; + ItemStack[] aInputs = this.getInventory().getInventory().clone(); + + for (ItemStack aStack : aInputs) { + if (VolumetricFlaskHelper.getFlaskFluid(aStack) != null) { + aHasFluid = true; + } + } + + if (aHasFluid && !aAllowFluid) { + return false; + } + //Check if there is output in slot. Boolean hasOutput = false; if (aInputs[Container_VolumetricFlaskSetter.SLOT_OUTPUT] != null) { @@ -141,7 +155,8 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide boolean doAdd = false; ItemStack g = this.getStackInSlot(e); - FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g); + //FluidStack aInputFluidStack = VolumetricFlaskHelper.getFlaskFluid(g); + FluidStack aInputFluidStack = null; int aSize = 0; ItemStack aInputStack = null; int aTypeInSlot = getFlaskType(g); @@ -154,7 +169,8 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide // Existing Output else { ItemStack f = this.getStackInSlot(8); - FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f); + //FluidStack aFluidInCheckedSlot = VolumetricFlaskHelper.getFlaskFluid(f); + FluidStack aFluidInCheckedSlot = null; int aTypeInCheckedSlot = getFlaskType(f); // Check that the Circuit in the Output slot is not null and the same type as the circuit input. if (aTypeInCheckedSlot > 0 && (aTypeInSlot == aTypeInCheckedSlot) && f != null) { @@ -172,9 +188,9 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide // Check Circuit Type ItemStack aOutput; FluidStack aOutputFluid = null; - if (!VolumetricFlaskHelper.isFlaskEmpty(g)) { + /*if (!VolumetricFlaskHelper.isFlaskEmpty(g)) { aOutputFluid = aInputFluidStack.copy(); - } + }*/ if (aTypeInSlot == 1) { aOutput = VolumetricFlaskHelper.getVolumetricFlask(1); } @@ -195,7 +211,7 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide if (aOutputFluid.amount > aCapacity) { aOutputFluid.amount = aCapacity; } - VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid); + //VolumetricFlaskHelper.setFluid(aOutput, aOutputFluid); } this.setInventorySlotContents(e, aInputStack); this.setInventorySlotContents(Container_VolumetricFlaskSetter.SLOT_OUTPUT, aOutput); diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java index 137b05d85a..287820404a 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java @@ -208,6 +208,7 @@ public class HazmatUtils { } if (LoadedMods.isModLoaded("ThaumicTinkerer")) { + /* AutoMap<Item> aItems = new AutoMap<Item>(); Class aMainTT = ReflectionUtils.getClass("thaumic.tinkerer.common.ThaumicTinkerer"); Class aItemRegistryTT = ReflectionUtils.getClass("thaumic.tinkerer.common.registry.TTRegistry"); @@ -225,21 +226,23 @@ public class HazmatUtils { AutoMap<ItemStack> aItemMap = new AutoMap<ItemStack>(); int aIndex = 0; for (Item aItem : aItems) { - Item aItemObject = null; - if (aItem != null) { - aItemMap.add(ItemUtils.getSimpleStack(aItemObject)); - } - else { - Logger.INFO("[Hazmat] Could not get item "+aIndex+" from "+aItemRegistryTT.getName()); - } - aIndex++; + Item aItemObject = null; + if (aItem != null) { + aItemMap.add(ItemUtils.getSimpleStack(aItemObject)); + } + else { + Logger.INFO("[Hazmat] Could not get item "+aIndex+" from "+aItemRegistryTT.getName()); + } + aIndex++; } Logger.INFO("[Hazmat] Registering "+aItemMap.size()+" Thaumic Tinkerer Items as hazmat gear."); for (ItemStack aItem : aItemMap) { - addProtection(aItem); + addProtection(aItem); } Logger.INFO("[Hazmat] Registered Thaumic Tinkerer Items as hazmat gear."); - } + */ + Logger.INFO("[Hazmat] Did not register Thaumic Tinkerer Items as hazmat gear."); + } if (LoadedMods.isModLoaded("GraviSuite")) { AutoMap<Field> aItemFields = new AutoMap<Field>(); @@ -426,7 +429,7 @@ public class HazmatUtils { Logger.INFO("=========================================================="); return false; } - Logger.INFO("[Hazmat] Registering " + aVanStack.getDisplayName() + " for full Hazmat protection."); + Logger.INFO("[Hazmat] Registering " + ItemUtils.getItemName(aVanStack) + " for full Hazmat protection."); GT_ItemStack aStack = getGtStackFromVanilla(aVanStack); AutoMap<Boolean> aAdded = new AutoMap<Boolean>(); aAdded.put(addProtection_Frost(aStack)); diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java index 5850df8647..a8c77094cd 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java @@ -19,10 +19,9 @@ import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.nei.GTPP_NEI_DefaultHandler.CachedDefaultRecipe; -import gtPlusPlus.nei.GTPP_NEI_DefaultHandler.FixedPositionedStack; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.init.Blocks; @@ -51,6 +50,33 @@ extends TemplateRecipeHandler { GuiUsageRecipe.usagehandlers.add(this); } } + + public static void logRecipeError(GT_Recipe aRecipe) { + if (aRecipe == null) { + Logger.INFO("Tried to handle null recipe. :("); + } + else { + ItemStack[] aInputs = aRecipe.mInputs; + ItemStack[] aOutputs = aRecipe.mOutputs; + FluidStack[] aFluidInputs = aRecipe.mFluidInputs; + FluidStack[] aFluidOutputs = aRecipe.mFluidOutputs; + int aEU = aRecipe.mEUt; + int aTime = aRecipe.mDuration; + int aSpecialValue = aRecipe.mSpecialValue; + String aInputitems = ItemUtils.getArrayStackNames(aInputs); + String aOutputitems = ItemUtils.getArrayStackNames(aOutputs); + String aInputFluids = ItemUtils.getArrayStackNames(aFluidInputs); + String aOutputFluids = ItemUtils.getArrayStackNames(aFluidOutputs); + Logger.INFO("Logging Broken Recipe Details:"); + Logger.INFO("Input Items - "+aInputitems); + Logger.INFO("Output Items - "+aOutputitems); + Logger.INFO("Input Fluids - "+aInputFluids); + Logger.INFO("Output Fluids - "+aOutputFluids); + Logger.INFO("EU/t - "+aEU); + Logger.INFO("Duration - "+aTime); + Logger.INFO("Special Value - "+aSpecialValue); + } + } public List<GTPP_Recipe> getSortedRecipes() { List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); @@ -72,7 +98,11 @@ extends TemplateRecipeHandler { if (outputId.equals(getRecipeMapName())) { for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); + CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); + if (tNEIRecipe == null) { + continue; + } + this.arecipes.add(tNEIRecipe); } } } else { @@ -103,7 +133,10 @@ extends TemplateRecipeHandler { } for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); + if (tNEIRecipe == null) { + continue; + } for (ItemStack tStack : tResults) { if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { this.arecipes.add(tNEIRecipe); @@ -137,7 +170,10 @@ extends TemplateRecipeHandler { } for (GTPP_Recipe tRecipe : getSortedRecipes()) { if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); + CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); + if (tNEIRecipe == null) { + continue; + } for (ItemStack tStack : tInputs) { if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { this.arecipes.add(tNEIRecipe); @@ -386,6 +422,8 @@ extends TemplateRecipeHandler { mInputSlotMap.put(7, new Pair<Integer, Integer>(aSlotX_2, aSlotY_3)); mInputSlotMap.put(8, new Pair<Integer, Integer>(aSlotX_3, aSlotY_3)); mInputSlotMap.put(9, new Pair<Integer, Integer>(aSlotX_1, aSlotY_10)); + mInputSlotMap.put(10, new Pair<Integer, Integer>(aSlotX_2, aSlotY_10)); + mInputSlotMap.put(11, new Pair<Integer, Integer>(aSlotX_3, aSlotY_10)); aSlotX_1 = 102; aSlotX_2 = 120; aSlotX_3 = 138; @@ -399,6 +437,18 @@ extends TemplateRecipeHandler { mOutputSlotMap.put(7, new Pair<Integer, Integer>(aSlotX_2, aSlotY_3)); mOutputSlotMap.put(8, new Pair<Integer, Integer>(aSlotX_3, aSlotY_3)); mOutputSlotMap.put(9, new Pair<Integer, Integer>(aSlotX_1, aSlotY_10)); + mOutputSlotMap.put(10, new Pair<Integer, Integer>(aSlotX_2, aSlotY_10)); + mOutputSlotMap.put(11, new Pair<Integer, Integer>(aSlotX_3, aSlotY_10)); + } + + private CachedDefaultRecipe getCachedRecipe(GT_Recipe aRecipe) { + try { + return new CachedDefaultRecipe(aRecipe); + } + catch(Throwable e) { + logRecipeError(aRecipe); + } + return null; } public class CachedDefaultRecipe @@ -431,6 +481,9 @@ extends TemplateRecipeHandler { // Upto 9 Inputs Slots if (aInputItemsCount > 0) { + if (aInputItemsCount > 9) { + aInputItemsCount = 9; + } for (int i=0;i<aInputItemsCount;i++) { int x = mInputSlotMap.get(aSlotToCheck).getKey(); int y = mInputSlotMap.get(aSlotToCheck).getValue(); @@ -441,7 +494,10 @@ extends TemplateRecipeHandler { } aSlotToCheck = 0; // Upto 9 Output Slots - if (aOutputItemsCount > 0) { + if (aOutputItemsCount > 0) { + if (aOutputItemsCount > 9) { + aOutputItemsCount = 9; + } for (int i=0;i<aOutputItemsCount;i++) { int x = mOutputSlotMap.get(aSlotToCheck).getKey(); int y = mOutputSlotMap.get(aSlotToCheck).getValue(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index c2e88305ad..de16a247b0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -374,20 +374,21 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this")); + /* GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - + GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8)); GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64)); GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512)); GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096)); GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768)); GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144)); - + */ } private boolean registerComponents_ULV(){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 89997d7be8..eb01823151 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -45,7 +45,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi protected int SLOT_ROTOR = 4; protected int SLOT_FILTER = 5; protected static boolean mPollutionEnabled = true; - + protected boolean mSaveRotor = false; public GregtechMetaAtmosphericReconditioner(int aID, String aName, String aNameRegional, int aTier) { @@ -79,21 +79,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - + boolean highTier = this.mTier >= 7; - + String[] A = new String[]{ this.mDescription, highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", highTier ? "If these chunks are not loaded, they will be ignored" : "", - "Requires a turbine rotor and an Air Filter [T1/T2] to run.", - "The turbine rotor must be manually inserted/replaced", - "Can be configured with a soldering iron to change modes", - "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", - "High Efficiency: Removes full pollution, Turbine takes 100% dmg", - "Turbine Rotor will not break in LE mode", - "Insert an equal tier Conveyor Module to enable automation" - }; + "Requires a turbine rotor and an Air Filter [T1/T2] to run.", + "The turbine rotor must be manually inserted/replaced", + "Can be configured with a soldering iron to change modes", + "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", + "High Efficiency: Removes full pollution, Turbine takes 100% dmg", + "Turbine Rotor will not break in LE mode", + "Insert an equal tier Conveyor Module to enable automation" + }; if (!mPollutionEnabled) { String[] B = new String[] { "===============================================", @@ -178,10 +178,10 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi aBaseMetaTileEntity.setActive(false); this.sendSound((byte) -122); } - + //Only try once/sec. if (!isIdle && aTick % 20L == 0L){ - + //Check if machine can work. if ((aBaseMetaTileEntity.isAllowedToWork())){ @@ -197,13 +197,13 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi this.sendSound((byte) -122); } } - + //If Active. if (aBaseMetaTileEntity.isActive()){ //Do nothing if there is no pollution. if(this.mHasPollution && mCurrentPollution > 0){ - + //Only check every 30s. if (!isIdle && aTick % (20L * 30) == 0L){ mPollutionEnabled = PollutionUtils.mPollution(); @@ -212,9 +212,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity()); } } - - - + + + //Use a Turbine if(hasRotor(stackRotor) && hasAirFilter(stackFilter)){ @@ -240,7 +240,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi int mAirSides = getFreeSpaces(); int reduction = 0; - + //If no sides are free, how will you process the atmosphere? if (mAirSides > 0){ reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides); //Was originally *100 @@ -253,7 +253,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi Logger.WARNING("reduction[3]:"+reduction); mPollutionReduction = reduction; - + //Set a temp to remove variable to aleviate duplicate code. int toRemove = 0; @@ -296,21 +296,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } } //End of 1/sec action block. else { - + if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution && !isIdle && aBaseMetaTileEntity.isAllowedToWork()){ aBaseMetaTileEntity.setActive(true); } else if (isIdle || !this.mHasPollution || mCurrentPollution <= 0 || stackRotor == null || stackFilter == null || !hasRotor(stackRotor) || !hasAirFilter(stackFilter)){ aBaseMetaTileEntity.setActive(false); } - + } if (this.getBaseMetaTileEntity().isActive()) { if (MathUtils.randInt(0, 5) <= 2) { this.sendSound((byte) -120); } } - + } //End of is serverside block. } @@ -366,7 +366,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } return mCurrentChunkPollution; } - + public boolean hasRotor(ItemStack rotorStack){ if(rotorStack != null){ if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) { @@ -381,7 +381,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public boolean damageTurbineRotor(){ try{ - + boolean creativeRotor = false; ItemStack rotorStack = this.mInventory[SLOT_ROTOR]; if (rotorStack == null) { @@ -396,7 +396,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } } } - + if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) { long currentUse = ItemBasicScrubberTurbine.getFilterDamage(rotorStack); //Remove broken Filter @@ -415,15 +415,15 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return true; } } - + if(mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01 && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]).getSpeedMultiplier()>0 && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed>0 ) { - + long damageValue = (long) Math.floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); double fDam = Math.floor(Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); damageValue -= fDam; - + //Logger.WARNING("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]); Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]); @@ -437,14 +437,27 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi long rotorDurability = (rotorDurabilityMax - rotorDamage); Logger.WARNING("Rotor Damage: "+rotorDamage + " | Max Durability: "+rotorDurabilityMax+" | "+" Remaining Durability: "+rotorDurability); if (rotorDurability >= damageValue){ - - - if (!mSaveRotor){ - Logger.WARNING("Damaging Rotor."); - - if (!creativeRotor) + + + if (!mSaveRotor){ + Logger.WARNING("Damaging Rotor."); + + if (!creativeRotor) GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); + long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); + if (tempDur < rotorDurabilityMax){ + return true; + } + else { + rotorDurability = 0; + } + } + else { + Logger.WARNING("Damaging Rotor."); + if (rotorDurability > 1000){ + if (!creativeRotor) + GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue/2, 0, null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); if (tempDur < rotorDurabilityMax){ return true; @@ -452,23 +465,10 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi else { rotorDurability = 0; } - } - else { - Logger.WARNING("Damaging Rotor."); - if (rotorDurability > 1000){ - if (!creativeRotor) - GT_ModHandler.damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue/2, 0, null); - long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); - if (tempDur < rotorDurabilityMax){ - return true; - } - else { - rotorDurability = 0; - } - } - } - - + } + } + + } if (rotorDurability <= 0 && !mSaveRotor && !creativeRotor) { @@ -519,11 +519,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } public boolean removePollution(int toRemove){ - + if (this == null || this.getBaseMetaTileEntity() == null || this.getBaseMetaTileEntity().getWorld() == null) { return false; } - + if (this.mTier < 7) { int startPollution = getCurrentChunkPollution(); PollutionUtils.removePollution(this.getBaseMetaTileEntity(), toRemove); @@ -537,7 +537,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi Chunk aThisChunk = this.getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); int mainChunkX = aThisChunk.xPosition; int mainChunkZ = aThisChunk.zPosition; - + World aWorld = this.getBaseMetaTileEntity().getWorld(); int xPos = this.getBaseMetaTileEntity().getXCoord(); int zPos = this.getBaseMetaTileEntity().getZCoord(); @@ -561,21 +561,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi aSurrounding.put(c1); aSurrounding.put(c2); aSurrounding.put(c3); - + for (Chunk r : aSurrounding) { if (!r.isChunkLoaded) { continue; } - + int startPollution = getPollutionInChunk(r); if (startPollution == 0) { continue; } - + Logger.WARNING("Trying to remove pollution from chunk "+r.xPosition+", "+r.zPosition+" | "+startPollution); int after = 0; boolean isMainChunk = r.isAtLocation(mainChunkX, mainChunkZ); - + int removal = Math.max(0, !isMainChunk ? (toRemove/4) : toRemove); if (removePollution(r, removal)) { chunksWithRemoval++; @@ -592,7 +592,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return totalRemoved > 0 && chunksWithRemoval > 0; } } - + public boolean removePollution(Chunk aChunk, int toRemove){ int before = getCurrentChunkPollution(); PollutionUtils.removePollution(aChunk, toRemove); @@ -616,7 +616,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (filter == null) { return false; } - + boolean creativeRotor = false; ItemStack rotorStack = this.mInventory[SLOT_ROTOR]; if (rotorStack != null) { @@ -628,11 +628,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } } } - + if (creativeRotor) { return true; } - + if (filter.getItem() instanceof ItemAirFilter){ @@ -670,22 +670,20 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { - Logger.INFO("Trying to Insert into "+aIndex); if (aIndex == 5) { if (aStack.getItem() instanceof ItemAirFilter) { + Logger.INFO("Inserting Air Filter into "+aIndex); return true; } } - if (aIndex == 4 || aIndex == 6){ - if (aIndex == 4) { - if (this.mInventory[5] != null) { - Logger.INFO("Found conveyor, can automate turbines."); - if (aStack.getItem() instanceof ItemBasicScrubberTurbine) { - return true; - } - if (aStack.getItem() instanceof GT_MetaGenerated_Tool && aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 179){ - return true; - } + if (aIndex == 4) { + if (this.mInventory[6] != null) { + Logger.INFO("Found conveyor, can automate turbines. Inserting into "+aIndex); + if (aStack.getItem() instanceof ItemBasicScrubberTurbine) { + return true; + } + if (aStack.getItem() instanceof GT_MetaGenerated_Tool && aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 179){ + return true; } } } @@ -737,29 +735,29 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } int mAirSides = getFreeSpaces(); int reduction = 0; - + try { - long tVoltage = maxEUInput(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides); - reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1); - reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow); - - aTooltipSuper.put("Maximum pollution removed per second: "+reduction); + long tVoltage = maxEUInput(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + reduction += (((Math.max((tTier-2), 1)*2)*50)*mAirSides); + reduction = (MathUtils.safeInt((long)reduction*this.mBaseEff)/100000)*mAirSides*Math.max((tTier-2), 1); + reduction = MathUtils.safeInt(((long)reduction/100)*this.mOptimalAirFlow); + + aTooltipSuper.put("Maximum pollution removed per second: "+reduction); } catch (Throwable t) { aTooltipSuper.put("Maximum pollution removed per second: "+mPollutionReduction); } aTooltipSuper.put("Air Sides: "+mAirSides); - + String[] mBuiltOutput = new String[aTooltipSuper.size()]; int aIndex = 0; for (String i : aTooltipSuper) { mBuiltOutput[aIndex++] = i; } - - - + + + return mBuiltOutput; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java index dcf52a5008..5027e2d6e8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java @@ -22,11 +22,11 @@ public class GregtechSuperChests { aSuffix = " [Disabled]"; } - GregtechItemList.Super_Chest_LV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.01", "Super Chest I"+aSuffix, 1)).getStackForm(1L)); - GregtechItemList.Super_Chest_MV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.02", "Super Chest II"+aSuffix, 2)).getStackForm(1L)); - GregtechItemList.Super_Chest_HV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.03", "Super Chest III"+aSuffix, 3)).getStackForm(1L)); - GregtechItemList.Super_Chest_EV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.04", "Super Chest IV"+aSuffix, 4)).getStackForm(1L)); - GregtechItemList.Super_Chest_IV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.tier.05", "Super Chest V"+aSuffix, 5)).getStackForm(1L)); + GregtechItemList.Super_Chest_LV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.01", "Super Chest I"+aSuffix, 1)).getStackForm(1L)); + GregtechItemList.Super_Chest_MV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.02", "Super Chest II"+aSuffix, 2)).getStackForm(1L)); + GregtechItemList.Super_Chest_HV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.03", "Super Chest III"+aSuffix, 3)).getStackForm(1L)); + GregtechItemList.Super_Chest_EV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.04", "Super Chest IV"+aSuffix, 4)).getStackForm(1L)); + GregtechItemList.Super_Chest_IV.set((new GT_MetaTileEntity_TieredChest(mId++, "super.chest.gtpp.tier.05", "Super Chest V"+aSuffix, 5)).getStackForm(1L)); // Do not add Recipes for GTNH, hide them from NEI instead. if (CORE.GTNH) { |