aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-02-07 14:10:19 +0000
committerGitHub <noreply@github.com>2022-02-07 14:10:19 +0000
commitcabfbdb4dbe91553c23ba1baf60d25ae446d250f (patch)
tree886f99f3655ad6505a210d7043edcaa1cc87afec /src/main/java/gtPlusPlus
parent9464ce77d28a9c51c2b9fc11bdc1ae6ffb16df04 (diff)
downloadGT5-Unofficial-cabfbdb4dbe91553c23ba1baf60d25ae446d250f.tar.gz
GT5-Unofficial-cabfbdb4dbe91553c23ba1baf60d25ae446d250f.tar.bz2
GT5-Unofficial-cabfbdb4dbe91553c23ba1baf60d25ae446d250f.zip
Minor Things (#114)
Added some foils for @GTNH-Colen. Fixed scanner output on LRE. Formatting~ Fix Crop Manager giving stacks > 64.
Diffstat (limited to 'src/main/java/gtPlusPlus')
-rw-r--r--src/main/java/gtPlusPlus/core/item/ModItems.java221
-rw-r--r--src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java135
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java291
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java382
4 files changed, 514 insertions, 515 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java
index 8b72b9c7c9..159598189e 100644
--- a/src/main/java/gtPlusPlus/core/item/ModItems.java
+++ b/src/main/java/gtPlusPlus/core/item/ModItems.java
@@ -1,11 +1,9 @@
package gtPlusPlus.core.item;
-import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines;
-import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
+import static gtPlusPlus.core.creative.AddToCreativeTab.*;
import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.*;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
@@ -17,15 +15,12 @@ import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.item.base.dusts.BaseItemDust;
import gtPlusPlus.core.item.base.foil.BaseItemFoil;
-import gtPlusPlus.core.item.base.foods.BaseItemFood;
-import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
+import gtPlusPlus.core.item.base.foods.*;
import gtPlusPlus.core.item.base.gears.BaseItemSmallGear;
-import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
-import gtPlusPlus.core.item.base.ingots.BaseItemIngot_OLD;
+import gtPlusPlus.core.item.base.ingots.*;
import gtPlusPlus.core.item.base.misc.BaseItemMisc;
import gtPlusPlus.core.item.base.misc.BaseItemMisc.MiscTypes;
-import gtPlusPlus.core.item.base.plates.BaseItemPlate;
-import gtPlusPlus.core.item.base.plates.BaseItemPlateDouble;
+import gtPlusPlus.core.item.base.plates.*;
import gtPlusPlus.core.item.bauble.*;
import gtPlusPlus.core.item.chemistry.*;
import gtPlusPlus.core.item.crafting.ItemDummyResearch;
@@ -34,36 +29,24 @@ import gtPlusPlus.core.item.food.BaseItemMetaFood;
import gtPlusPlus.core.item.general.*;
import gtPlusPlus.core.item.general.books.ItemBaseBook;
import gtPlusPlus.core.item.general.capture.ItemEntityCatcher;
-import gtPlusPlus.core.item.general.chassis.ItemBoilerChassis;
-import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoil;
-import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoilWire;
+import gtPlusPlus.core.item.general.chassis.*;
import gtPlusPlus.core.item.general.spawn.ItemCustomSpawnEgg;
-import gtPlusPlus.core.item.general.throwables.ItemHydrofluoricAcidPotion;
-import gtPlusPlus.core.item.general.throwables.ItemSulfuricAcidPotion;
-import gtPlusPlus.core.item.general.throwables.ItemThrowableBomb;
+import gtPlusPlus.core.item.general.throwables.*;
import gtPlusPlus.core.item.init.ItemsFoods;
import gtPlusPlus.core.item.materials.DustDecayable;
-import gtPlusPlus.core.item.tool.misc.DebugScanner;
-import gtPlusPlus.core.item.tool.misc.GregtechPump;
-import gtPlusPlus.core.item.tool.misc.SandstoneHammer;
-import gtPlusPlus.core.item.tool.misc.box.AutoLunchBox;
-import gtPlusPlus.core.item.tool.misc.box.MagicToolBag;
-import gtPlusPlus.core.item.tool.misc.box.UniversalToolBox;
+import gtPlusPlus.core.item.tool.misc.*;
+import gtPlusPlus.core.item.tool.misc.box.*;
import gtPlusPlus.core.item.tool.staballoy.*;
import gtPlusPlus.core.item.wearable.WearableLoader;
-import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.*;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
-import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.*;
-import gtPlusPlus.core.material.nuclear.FLUORIDES;
-import gtPlusPlus.core.material.nuclear.NUCLIDE;
+import gtPlusPlus.core.material.nuclear.*;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
-import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.*;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.GTplusplus_Everglades;
import gtPlusPlus.preloader.CORE_Preloader;
@@ -76,15 +59,13 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
import net.minecraft.item.*;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.*;
public final class ModItems {
public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
-
+
public static Item ZZZ_Empty;
public static Item AAA_Broken;
@@ -199,14 +180,14 @@ public final class ModItems {
public static Item dustCalciumCarbonate;
public static Item dustLi2CO3CaOH2;
public static Item dustLi2BeF4;
-
+
public static Item dustTumbagaMix;
public static Item dustAer;
public static Item dustIgnis;
public static Item dustTerra;
public static Item dustAqua;
-
+
public static Item cellHydrogenChlorideMix;
public static BaseEuItem metaItem2;
@@ -264,7 +245,7 @@ public final class ModItems {
public static Item itemFoilUranium235;
public static Item itemDustIndium;
public static BlockBaseModular blockRawMeat;
-
+
public static Item itemBoilerChassis;
public static Item itemDehydratorCoilWire;
public static Item itemDehydratorCoil;
@@ -302,7 +283,7 @@ public final class ModItems {
public static Item dustDecayedRadium226;
public static Item dustRadium226;
public static Item dustProtactinium233;
-
+
public static ItemGiantEgg itemBigEgg;
public static GregtechPump toolGregtechPump;
@@ -310,7 +291,7 @@ public final class ModItems {
public static ItemGenericToken itemGenericToken;
public static Item itemControlCore;
-
+
public static Item itemSunnariumBit;
public static ItemStack itemHotTitaniumIngot;
@@ -352,14 +333,14 @@ public final class ModItems {
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Spider;
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Creeper;
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Enderman;
-
+
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether;
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal;
public static CoreItem itemExquisiteIndustrialDiamond;
public static BaseItemMetaFood itemMetaFood;
-
+
public static ItemMagicFeather itemMagicFeather;
static {
@@ -370,8 +351,8 @@ public final class ModItems {
}
public static final void init(){
-
- itemDebugScanner = new DebugScanner();
+
+ itemDebugScanner = new DebugScanner();
itemMagicFeather = new ItemMagicFeather();
itemAlkalusDisk = new BaseItemDamageable("itemAlkalusDisk", AddToCreativeTab.tabMisc, 1, 0, "Unknown Use", EnumRarity.rare, EnumChatFormatting.AQUA, false, null);
@@ -379,7 +360,7 @@ public final class ModItems {
itemGenericToken = new ItemGenericToken();
itemDummyResearch = new ItemDummyResearch();
itemCustomSpawnEgg = new ItemCustomSpawnEgg();
-
+
//Debug Loading
if (CORE_Preloader.DEBUG_MODE){
DEBUG_INIT.registerItems();
@@ -393,8 +374,8 @@ public final class ModItems {
//Some Simple forms of materials
itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber");
GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
- GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemStickyRubber", 1));
-
+ GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStackFromFQRN(CORE.MODID+":itemStickyRubber", 1));
+
//Register Hydrogen Blobs first, so we can replace old helium blobs.
itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob");
//Register Old Helium Blob, this will be replaced when held by a player.
@@ -406,7 +387,7 @@ public final class ModItems {
//Register Rope
itemFiber = new CoreItem("itemFiber", "Plant Fiber", tabMisc);
itemRope = new CoreItem("itemRope", "Rope", tabMisc);
-
+
//Load Wearable Items
WearableLoader.run();
@@ -431,8 +412,8 @@ public final class ModItems {
backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
-
-
+
+
//Load Custom Box/bags
boxTools = new UniversalToolBox("Tool Box");
boxFood = new AutoLunchBox("Eatotron-9000");
@@ -449,7 +430,7 @@ public final class ModItems {
try{
-
+
registerCustomMaterialComponents();
//Elements generate first so they can be used in compounds.
@@ -513,11 +494,11 @@ public final class ModItems {
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().STRONTIUM90, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().POLONIUM210, false);
MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().AMERICIUM241, false);
-
+
if (!CORE.GTNH) {
- MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.getInstance().TRINIUM);
+ MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.getInstance().TRINIUM);
}
-
+
//Custom Materials that will have standalone refinery processes
MaterialGenerator.generate(ELEMENT.STANDALONE.ADVANCED_NITINOL, false);
MaterialGenerator.generate(ELEMENT.STANDALONE.ASTRAL_TITANIUM);
@@ -525,16 +506,16 @@ public final class ModItems {
MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN);
MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS);
MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE);
-
+
//Custom Materials that are from Runescape
MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL);
MaterialGenerator.generate(ELEMENT.STANDALONE.WHITE_METAL);
MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.GRANITE);
MaterialGenerator.generateOreMaterialWithAllExcessComponents(ELEMENT.STANDALONE.RUNITE);
MaterialGenerator.generate(ELEMENT.STANDALONE.DRAGON_METAL, false);
-
+
MISC_MATERIALS.run();
-
+
//Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though
if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
@@ -636,7 +617,7 @@ public final class ModItems {
MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false);
MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON);
MaterialGenerator.generate(ALLOY.TRINIUM_REINFORCED_STEEL);
-
+
//Top Tier Alloys
MaterialGenerator.generate(ALLOY.HELICOPTER);
MaterialGenerator.generate(ALLOY.LAFIUM);
@@ -646,25 +627,25 @@ public final class ModItems {
MaterialGenerator.generate(ALLOY.LAURENIUM);
MaterialGenerator.generate(ALLOY.BOTMIUM);
MaterialGenerator.generate(ALLOY.HS188A);
-
+
MaterialGenerator.generate(ALLOY.TITANSTEEL);
MaterialGenerator.generate(ALLOY.ARCANITE);
- MaterialGenerator.generate(ALLOY.OCTIRON);
+ MaterialGenerator.generate(ALLOY.OCTIRON);
MaterialGenerator.generate(ALLOY.BABBIT_ALLOY, false);
MaterialGenerator.generate(ALLOY.BLACK_TITANIUM, false);
// High Level Bioplastic
MaterialGenerator.generate(ELEMENT.STANDALONE.RHUGNOR, false, false);
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
//Must be the final Alloy to Generate
MaterialGenerator.generate(ALLOY.QUANTUM);
@@ -704,8 +685,8 @@ public final class ModItems {
dustAer = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AER, true)[0];
dustIgnis = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().IGNIS, true)[0];
dustTerra = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().TERRA, true)[0];
- dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0];
-
+ dustAqua = ItemUtils.generateSpecialUseDusts(ELEMENT.getInstance().AQUA, true)[0];
+
ItemUtils.generateSpecialUseDusts(MISC_MATERIALS.WOODS_GLASS, false);
cellHydrogenChlorideMix = new BaseItemCell("hydrogenchloridemix", "Hydrogen Chloride Mix", MISC_MATERIALS.HYDROGEN_CHLORIDE.getRGB());
@@ -734,7 +715,7 @@ public final class ModItems {
//fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0);
//fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Lithium Tetrafluoroberyllate", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
//fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true);
-
+
// LFTR Core Fluid Processing
//fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
//fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true);
@@ -745,8 +726,8 @@ public final class ModItems {
//fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true);
//fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true);
fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix("nuclear.waste", "Nuclear Waste", new short[]{10, 250, 10, 100}, 0, 1000, null, CI.emptyCells(1), 1000, true);
-
-
+
+
//LFTR Control Circuit
itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null);
@@ -760,8 +741,8 @@ public final class ModItems {
GT_OreDictUnificator.registerOre("pelletZirconium", new ItemStack(itemZirconiumChlorideCinterPellet));
//Zirconium Chloride
dustZrCl4 = ItemUtils.generateSpecialUseDusts("ZrCl4", "ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[0]; //http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
- dustCookedZrCl4 = ItemUtils.generateSpecialUseDusts("CookedZrCl4", "Cooked ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[0]; //http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
-
+ dustCookedZrCl4 = ItemUtils.generateSpecialUseDusts("CookedZrCl4", "Cooked ZrCl4", "ZrCl4", Utils.rgbtoHexValue(180, 180, 180))[0]; //http://www.iaea.org/inis/collection/NCLCollectionStore/_Public/39/036/39036750.pdf
+
//Zirconium Tetrafluoride
/*GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1));
GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));*/
@@ -769,7 +750,7 @@ public final class ModItems {
//GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1));
fluidZrF4 = FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.setFluid(fluidZrF4);
-
+
//Coolant Salt
//NaBF4 - NaF - 621C
//dustNaBF4NaF = ItemUtils.generateSpecialUseDusts("NaBF4NaF", "NaBF4NaF", Utils.rgbtoHexValue(45, 45, 90))[0]; //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride
@@ -821,13 +802,13 @@ public final class ModItems {
metaItem2.registerItem(3, "Test Item 3", 1000765000, 4, "I Hold EU 3.", 32000);
metaItem2.registerItem(4, "Whirlygig", 1043644000, (short) 5, "Spin me right round.", EnumRarity.rare, EnumChatFormatting.DARK_GREEN, true);
metaItem2.registerItem(5, "Whirlygig 2", 2124867000, (short) 7, "Spin me right round.", EnumRarity.uncommon, EnumChatFormatting.RED, true);
-
+
toolGregtechPump = new GregtechPump();
toolGregtechPump.registerPumpType(0, "Simple Hand Pump", 0, 0);
toolGregtechPump.registerPumpType(1, "Advanced Hand Pump", 32000, 1);
toolGregtechPump.registerPumpType(2, "Super Hand Pump", 128000, 2);
toolGregtechPump.registerPumpType(3, "Ultimate Hand Pump", 512000, 3);
-
+
//Create Multi-tools
//ItemsMultiTools.load();
@@ -838,7 +819,7 @@ public final class ModItems {
if (!FluidRegistry.isFluidRegistered("xpjuice")){
FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[]{50, 150, 50, 100});
}
-
+
//Industrial Diamonds
itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc);
ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack();
@@ -846,12 +827,12 @@ public final class ModItems {
ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond");
ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond");
ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond");
-
+
/*
* Decayable Materials
*/
-
+
dustNeptunium238 = new DustDecayable("dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), 50640, new String[] {""+StringUtils.superscript("238Np"), "Result: Plutonium 238 ("+StringUtils.superscript("238Pu")+")"}, ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(), 5);
dustDecayedRadium226 = ItemUtils.generateSpecialUseDusts("DecayedRadium226", "Decayed Radium-226", "Contains Radon ("+StringUtils.superscript("222Rn")+")", ELEMENT.getInstance().RADIUM.getRgbAsHex())[0];
dustRadium226 = new DustDecayable("dustRadium226", ELEMENT.getInstance().RADIUM.getRgbAsHex(), 90000, new String[] {""+StringUtils.superscript("226Ra"), "Result: Radon ("+StringUtils.superscript("222Rn")+")"}, ItemUtils.getSimpleStack(dustDecayedRadium226).getItem(), 5);
@@ -859,17 +840,17 @@ public final class ModItems {
dustTechnetium99 = new DustDecayable("dustTechnetium99", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 164500, new String[] {""+StringUtils.superscript("99Mo"), "Result: Ruthenium 99("+StringUtils.superscript("99Ru")+")"}, ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(), 4);
dustTechnetium99M = new DustDecayable("dustTechnetium99M", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 8570, new String[] {""+StringUtils.superscript("99ᵐTc"), "Result: Technicium 99 ("+StringUtils.superscript("99Tc")+")"}, dustTechnetium99, 4);
dustMolybdenum99 = new DustDecayable("dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), 16450, new String[] {""+StringUtils.superscript("99Mo"), "Result: Technicium 99ᵐ ("+StringUtils.superscript("99ᵐTc")+")"}, dustTechnetium99M, 4);
-
+
itemIonParticleBase = new IonParticles();
itemStandarParticleBase = new StandardBaseParticles();
-
+
if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) {
Item a8kFlask = VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_8k", "Large Volumetric Flask", 8000);
Item a64kFlask = VolumetricFlaskHelper.generateNewFlask("Volumetric_Flask_32k", "Gigantic Volumetric Flask", 32000);
- GregtechItemList.VOLUMETRIC_FLASK_8k.set(a8kFlask);
- GregtechItemList.VOLUMETRIC_FLASK_32k.set(a64kFlask);
- }
-
+ GregtechItemList.VOLUMETRIC_FLASK_8k.set(a8kFlask);
+ GregtechItemList.VOLUMETRIC_FLASK_32k.set(a64kFlask);
+ }
+
itemBoilerChassis = new ItemBoilerChassis();
itemDehydratorCoilWire = new ItemDehydratorCoilWire();
itemDehydratorCoil = new ItemDehydratorCoil();
@@ -879,36 +860,36 @@ public final class ModItems {
itemGrindleTablet = new BaseItemGrindle();
itemDragonJar = new ItemEntityCatcher();
-
+
itemControlCore = new ItemControlCore();
-
+
itemSunnariumBit = new ItemSunnariumBit();
//Chemistry
new CoalTar();
new RocketFuels();
-
+
//Nuclear Processing
new NuclearChem();
-
+
//Farm Animal Fun
new AgriculturalChem();
-
+
//General Chemistry
new GenericChem();
-
+
// Milled Ore Processing
new MilledOreProcessing();
-
+
//Bombs
itemBombCasing = new CoreItem("itemBombCasing", "Bomb Casing", tabMisc);
- itemBombCasing.setTextureName(CORE.MODID + ":bomb_casing");
+ itemBombCasing.setTextureName(CORE.MODID + ":bomb_casing");
itemBombUnf = new CoreItem("itemBombUnf", "Bomb (unf)", tabMisc);
- itemBombUnf.setTextureName(CORE.MODID + ":bomb_casing");
+ itemBombUnf.setTextureName(CORE.MODID + ":bomb_casing");
itemDetCable = new CoreItem("itemDetCable", "Det. Cable", tabMisc);
- itemDetCable.setTextureName("string");
+ itemDetCable.setTextureName("string");
itemBomb = new ItemThrowableBomb();
-
+
//Only used for debugging.
/*if (CORE.DEVENV) {
new ConnectedBlockFinder();
@@ -954,13 +935,13 @@ public final class ModItems {
GT_OreDictUnificator.registerOre("platePhasedGold", ItemUtils.getSimpleStack(itemPlateVibrantAlloy));
GT_OreDictUnificator.registerOre("dustPhasedIron", ItemUtils.getSimpleStack(itemDustPulsatingIron));
GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
- GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
+ GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9);
CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9);
CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(16), 16, 4);
CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(1294), 16, 4*9*9);
-
+
}
else {
/*Logger.WARNING("EnderIO not Found - Generating our own Resources.");
@@ -970,7 +951,7 @@ public final class ModItems {
MaterialGenerator.generate(MaterialEIO.SOULARIUM);
MaterialGenerator.generate(MaterialEIO.ELECTRICAL_STEEL);
MaterialGenerator.generate(MaterialEIO.ENERGETIC_ALLOY);
- MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY); */
+ MaterialGenerator.generate(MaterialEIO.VIBRANT_ALLOY); */
}
//Big Reactors
@@ -1035,7 +1016,7 @@ public final class ModItems {
//IC2 Exp
if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){
Logger.INFO("IndustrialCraft2 Found - Loading Resources.");
-
+
//Baubles Mod Test
try {
final Class<?> baublesTest = ReflectionUtils.getClass("baubles.api.IBauble");
@@ -1098,7 +1079,7 @@ public final class ModItems {
itemCustomBook = new ItemBaseBook();
registerCustomTokens();
}
-
+
public static void registerCustomTokens() {
itemGenericToken.register(0, "BitCoin", 16, "Can be used on the dark web");
itemGenericToken.register(1, "Hand Pump Trade Token I", 1, "Craft into a Tier I Hand pump");
@@ -1106,10 +1087,10 @@ public final class ModItems {
itemGenericToken.register(3, "Hand Pump Trade Token III", 1, "Craft into a Tier III Hand pump");
itemGenericToken.register(4, "Hand Pump Trade Token IV", 1, "Craft into a Tier IV Hand pump");
}
-
+
public static void registerCustomMaterialComponents() {
//Custom GT++ Crafting Components
-
+
/**
* Try generate dusts for missing rare earth materials if they don't exist
*/
@@ -1127,10 +1108,10 @@ public final class ModItems {
ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163));
}
if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1))){
- ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex());
+ ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex());
}
-
- //Just an unusual plate needed for some black magic.
+
+ //Just an unusual plate needed for some black magic.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null){
itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY);
}
@@ -1183,7 +1164,13 @@ public final class ModItems {
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM);
-
+
+ //Foil
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.PIKYONIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.CINOBITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.LAFIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FOIL, ALLOY.TRINIUM_REINFORCED_STEEL);
+
//Dense Plates
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL);
@@ -1202,18 +1189,18 @@ public final class ModItems {
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL);
MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL);
- MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE);
-
-
-
-
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE);
+
+
+
+
//Special Sillyness
if (true) {
-
+
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null){
new BaseItemPlate(ELEMENT.getInstance().SODIUM);
}
-
+
Material meatRaw = NONMATERIAL.MEAT;
// A plate of Meat.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null){
@@ -1226,7 +1213,7 @@ public final class ModItems {
ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900);
}
}
-
+
// A plate of Vanadium.
if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateVanadium", 1) == null){
@@ -1245,9 +1232,9 @@ public final class ModItems {
if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){
itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM);
}
-
+
//Tumbaga Mix (For Simple Crafting)
dustTumbagaMix = ItemUtils.generateSpecialUseDusts("MixTumbaga", "Tumbaga Mix", "Au2Cu", Utils.rgbtoHexValue(255, 150, 80))[0];
-
+
}
}
diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 0ccd752775..73ccfdf8a5 100644
--- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -1,35 +1,25 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Element;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.TextureSet;
+import java.util.*;
+
+import gregtech.api.enums.*;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.api.objects.data.TypeCounter;
+import gtPlusPlus.api.objects.data.*;
import gtPlusPlus.core.client.CustomTextureSet.TextureSets;
import gtPlusPlus.core.item.base.BaseItemComponent;
import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
+import gtPlusPlus.core.item.base.foil.BaseItemFoil;
import gtPlusPlus.core.item.base.plates.BaseItemPlateHeavy;
import gtPlusPlus.core.item.base.wire.BaseItemFineWire;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.Material;
-import gtPlusPlus.core.material.MaterialStack;
+import gtPlusPlus.core.material.*;
import gtPlusPlus.core.material.state.MaterialState;
import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.data.EnumUtils;
-import gtPlusPlus.core.util.data.StringUtils;
+import gtPlusPlus.core.util.data.*;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
+import net.minecraft.item.*;
import net.minecraftforge.oredict.OreDictionary;
public class MaterialUtils {
@@ -89,7 +79,7 @@ public class MaterialUtils {
radioactivity = aDustStack != null ? GT_Utility.getRadioactivityLevel(aDustStack) : 0;
if (radioactivity == 0) {
long aProtons = material.getProtons();
- radioactivity = (int) Math.min(Math.max((aProtons / 30), 1), 9);
+ radioactivity = (int) Math.min(Math.max((aProtons / 30), 1), 9);
}
}
Logger.MATERIALS("[Debug] Calculated Radiation level to be "+radioactivity.intValue()+".");
@@ -165,7 +155,7 @@ public class MaterialUtils {
if (hasValidRGBA(rgba) || (element == Element.H) || ((material == Materials.InfusedAir) || (material == Materials.InfusedFire) || (material == Materials.InfusedEarth) || (material == Materials.InfusedWater))){
//ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material);
//ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material);
- Material M = new Material(name, materialState,iconSet, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity.intValue(), mGenerateCell, mGenerateFluid);
+ Material M = new Material(name, materialState,iconSet, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell, mGenerateFluid);
mGeneratedMaterialMap.put(aMaterialKey, M);
return M;
}
@@ -173,8 +163,8 @@ public class MaterialUtils {
Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name() +" | Valid RGB? "+(hasValidRGBA(rgba)));
}
}
- catch (Throwable t) {
- Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name());
+ catch (Throwable t) {
+ Logger.DEBUG_MATERIALS("Failed to generate GT++ material instance for "+material.name());
t.printStackTrace();
}
return null;
@@ -253,38 +243,38 @@ public class MaterialUtils {
//aTier += 1; - Probably some logic to this, idk.
switch(aTier){
- case 0:
- return 16;
- case 1:
- return 30;
- case 2:
- return 120;
- case 3:
- return 480;
- case 4:
- return 1920;
- case 5:
- return 7680;
- case 6:
- return 30720;
- case 7:
- return 122880;
- case 8:
- return 491520;
- case 9:
- return 1966080;
- case 10:
- return 7864320;
- case 11:
- return 31457280;
- case 12:
- return 125829120;
- case 13:
- return 503316480;
- case 14:
- return 2013265920;
- default:
- return Integer.MAX_VALUE;
+ case 0:
+ return 16;
+ case 1:
+ return 30;
+ case 2:
+ return 120;
+ case 3:
+ return 480;
+ case 4:
+ return 1920;
+ case 5:
+ return 7680;
+ case 6:
+ return 30720;
+ case 7:
+ return 122880;
+ case 8:
+ return 491520;
+ case 9:
+ return 1966080;
+ case 10:
+ return 7864320;
+ case 11:
+ return 31457280;
+ case 12:
+ return 125829120;
+ case 13:
+ return 503316480;
+ case 14:
+ return 2013265920;
+ default:
+ return Integer.MAX_VALUE;
}
/*else {
@@ -329,7 +319,7 @@ public class MaterialUtils {
return mName;
}
- public static TextureSet getMostCommonTextureSet(List<Material> list) {
+ public static TextureSet getMostCommonTextureSet(List<Material> list) {
TypeCounter<TextureSet> aCounter = new TypeCounter<TextureSet>(TextureSet.class);
for (Material m : list) {
TextureSet t = m.getTextureSet();
@@ -338,7 +328,7 @@ public class MaterialUtils {
}
if (t != null) {
aCounter.add(t, t.mSetName);
- }
+ }
}
return aCounter.getResults();
/*Optional<TextureSet> r = list.stream().map(Material::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey);
@@ -358,7 +348,7 @@ public class MaterialUtils {
CORE.crash();
//g = Materials._NULL;
}
- return g;
+ return g;
}
public static Materials getMaterial(String aMaterialName) {
@@ -373,10 +363,10 @@ public class MaterialUtils {
return m;
}
- public static AutoMap<Material> getCompoundMaterialsRecursively(Material aMat){
- return getCompoundMaterialsRecursively_Speiger(aMat);
+ public static AutoMap<Material> getCompoundMaterialsRecursively(Material aMat){
+ return getCompoundMaterialsRecursively_Speiger(aMat);
/*
- AutoMap<Material> aDataSet = new AutoMap<Material>();
+ AutoMap<Material> aDataSet = new AutoMap<Material>();
final int HARD_LIMIT = 1000;
int mLoopCounter = 0;
if (aMat.getComposites().size() > 0) {
@@ -389,8 +379,8 @@ public class MaterialUtils {
aDataSet.put(aMat);
return aDataSet;
}
- ListIterator<Material> listIterator = xList.listIterator();
- while(listIterator.hasNext()){
+ ListIterator<Material> listIterator = xList.listIterator();
+ while(listIterator.hasNext()){
Material e = listIterator.next();
listIterator.remove();
if (mLoopCounter > HARD_LIMIT) {
@@ -402,8 +392,8 @@ public class MaterialUtils {
}
else {
for (MaterialStack x : e.getComposites()) {
- listIterator.add(x.getStackMaterial());
- }
+ listIterator.add(x.getStackMaterial());
+ }
}
mLoopCounter++;
@@ -418,7 +408,7 @@ public class MaterialUtils {
aDataSet.put(aMat);
return aDataSet;
}
- return aDataSet;
+ return aDataSet;
*/}
public static AutoMap<Material> getCompoundMaterialsRecursively_Speiger(Material toSearch) {
@@ -431,7 +421,7 @@ public class MaterialUtils {
// Could be a Deque but i dont use the interface
// enough to use it as default.
- LinkedList<Material> toCheck = new LinkedList<Material>();
+ LinkedList<Material> toCheck = new LinkedList<Material>();
toCheck.add(toSearch);
int processed = 0;
@@ -453,7 +443,7 @@ public class MaterialUtils {
generateComponentAndAssignToAMaterial(aType, aMaterial, true);
}
- public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial, boolean generateRecipes) {
+ public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial, boolean generateRecipes) {
Item aGC;
if (aType == ComponentTypes.PLATEHEAVY) {
aGC = new BaseItemPlateHeavy(aMaterial);
@@ -461,8 +451,11 @@ public class MaterialUtils {
else if (aType == ComponentTypes.FINEWIRE) {
aGC = new BaseItemFineWire(aMaterial);
}
+ else if (aType == ComponentTypes.FOIL) {
+ aGC = new BaseItemFoil(aMaterial);
+ }
else {
- aGC = new BaseItemComponent(aMaterial, aType);
+ aGC = new BaseItemComponent(aMaterial, aType);
}
if (aGC != null) {
String aFormattedLangName = aType.getName();
@@ -482,8 +475,8 @@ public class MaterialUtils {
Logger.MATERIALS("[Lang] "+aGC.getUnlocalizedName()+".name="+aFormattedLangName);
- aMaterial.registerComponentForMaterial(aType, ItemUtils.getSimpleStack(aGC));
- }
+ aMaterial.registerComponentForMaterial(aType, ItemUtils.getSimpleStack(aGC));
+ }
}
@@ -513,7 +506,7 @@ public class MaterialUtils {
return true;
}
}
- return false;
+ return false;
}
public static boolean isNullGregtechMaterial(Materials aGregtechMaterial) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
index 01d5ef88c8..400b48b4e5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
@@ -1,32 +1,25 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
+import java.util.*;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.Textures;
+import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.*;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
-import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_Container_CropHarvestor;
-import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_GUIContainer_CropHarvestor;
+import gtPlusPlus.xmod.gregtech.api.gui.basic.*;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import ic2.api.crops.CropCard;
-import ic2.api.crops.ICropTile;
+import ic2.api.crops.*;
import ic2.core.item.DamageHandler;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
+import net.minecraft.entity.player.*;
+import net.minecraft.item.*;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -44,12 +37,12 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) {
super(aID, "basicmachine.cropharvester.0"+aTier, "Crop Manager ("+GT_Values.VN[aTier]+")", aTier, 21, aDescription);
- mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
+ this.mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
}
public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
super(aName, aTier, 21, aDescription, aTextures);
- mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
+ this.mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")";
}
@Override
@@ -59,7 +52,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
@Override
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity, mLocalName);
+ return new GT_GUIContainer_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity, this.mLocalName);
}
@Override
@@ -75,7 +68,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
@Override
public boolean isSimpleMachine() {
return true;
- }
+ }
@Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
@@ -114,12 +107,12 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
@Override
public long maxEUInput() {
- return GT_Values.V[mTier];
+ return GT_Values.V[this.mTier];
}
@Override
public int getCapacity() {
- return 32000 * mTier;
+ return 32000 * this.mTier;
}
@Override
@@ -148,26 +141,26 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
private static final int getRange(int aTier) {
switch(aTier) {
- case 1:
- return 1;
- case 2:
- return 5;
- case 3:
- return 9;
- case 4:
- return 13;
- case 5:
- return 17;
- case 6:
- return 21;
- case 7:
- return 25;
- case 8:
- return 29;
- case 9:
- return 33;
- default:
- return 0;
+ case 1:
+ return 1;
+ case 2:
+ return 5;
+ case 3:
+ return 9;
+ case 4:
+ return 13;
+ case 5:
+ return 17;
+ case 6:
+ return 21;
+ case 7:
+ return 25;
+ case 8:
+ return 29;
+ case 9:
+ return 33;
+ default:
+ return 0;
}
}
@@ -182,15 +175,45 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
}
return false;
}
-
+
public long powerUsage() {
return this.maxEUInput() / 8;
}
-
+
public long powerUsageSecondary() {
return this.maxEUInput() / 32;
}
+
+ public static AutoMap<ItemStack> splitOutputStacks(ItemStack aOutput) {
+ return splitOutputStacks(new ItemStack[] {aOutput});
+ }
+
+ public static AutoMap<ItemStack> splitOutputStacks(ItemStack[] aOutputs) {
+ AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
+ for (ItemStack aStack : aOutputs) {
+ if (aStack != null) {
+ if (aStack.stackSize <= 64) {
+ aOutputMap.add(aStack);
+ } else {
+ int aStacks = 0;
+ int aExcess = 0;
+ int aOriginalSize = aStack.stackSize;
+ while (aOriginalSize >= 64) {
+ aStacks += 1;
+ aOriginalSize -= 64;
+ }
+ aExcess = aOriginalSize;
+ for (int i = 0; i < aStacks; i++) {
+ aOutputMap.add(ItemUtils.getSimpleStack(aStack, 64));
+ }
+ aOutputMap.add(ItemUtils.getSimpleStack(aStack, aExcess));
+ }
+ }
+ }
+ return aOutputMap;
+ }
+
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
@@ -201,33 +224,33 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
int aTileY = this.getBaseMetaTileEntity().getXCoord();
int aTileZ = this.getBaseMetaTileEntity().getXCoord();
- int aRadius = 10 + getRange(mTier);
- int aSide = (aRadius-1)/2;
- ArrayList<ItemStack> aAllDrops = new ArrayList<ItemStack>();
+ int aRadius = 10 + getRange(this.mTier);
+ int aSide = (aRadius-1)/2;
+ ArrayList<ItemStack> aAllDrops = new ArrayList<ItemStack>();
- if (mCropCache.isEmpty() || aTick % 1200 == 0 || mInvalidCache) {
- if (!mCropCache.isEmpty()) {
- mCropCache.clear();
+ if (this.mCropCache.isEmpty() || aTick % 1200 == 0 || this.mInvalidCache) {
+ if (!this.mCropCache.isEmpty()) {
+ this.mCropCache.clear();
}
//Logger.INFO("Looking for crops.");
- for (int y = 0; y <= 2; y++) {
+ for (int y = 0; y <= 2; y++) {
for (int x = (-aSide); x <= aSide; x++) {
for (int z = (-aSide); z <= aSide; z++) {
TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z);
if (tTileEntity != null && tTileEntity instanceof ICropTile) {
ICropTile tCrop = (ICropTile) tTileEntity;
- mCropCache.add(tCrop);
+ this.mCropCache.add(tCrop);
}
- }
- }
+ }
+ }
}
}
- //Process Cache
+ //Process Cache
if (doesInventoryHaveSpace()) {
- for (ICropTile tCrop : mCropCache) {
+ for (ICropTile tCrop : this.mCropCache) {
if (tCrop == null) {
- mInvalidCache = true;
+ this.mInvalidCache = true;
break;
}
CropCard aCrop = tCrop.getCrop();
@@ -236,16 +259,16 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
if (!aCrop.canGrow(tCrop) && aCrop.canBeHarvested(tCrop)) {
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsage(), true)) {
ItemStack[] aHarvest = tCrop.harvest_automated(true);
- if (aHarvest != null && aHarvest.length > 0) {
+ if (aHarvest != null && aHarvest.length > 0) {
for (ItemStack aStack : aHarvest) {
if (aStack.stackSize > 0) {
- if (mTier * 5 > MathUtils.randInt(1, 100)) {
+ if (this.mTier * 5 > MathUtils.randInt(1, 100)) {
aStack.stackSize += Math.floor(tCrop.getGain()/10);
Logger.INFO("Bonus output given for "+aCrop.displayName());
}
Logger.INFO("Harvested "+aCrop.displayName());
- aAllDrops.add(aStack);
- }
+ aAllDrops.addAll(splitOutputStacks(aStack));
+ }
}
}
}
@@ -254,32 +277,32 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
processSecondaryFunctions(tCrop);
}
}
- }
+ }
if (!aAllDrops.isEmpty()) {
Logger.INFO("Handling "+aAllDrops.size()+" Harvests");
Iterator<ItemStack> iter = aAllDrops.iterator();
while (iter.hasNext()) {
- ItemStack aDrop = iter.next();
+ ItemStack aDrop = iter.next();
if (ItemUtils.checkForInvalidItems(aDrop)) {
for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) {
if (this.mInventory[i] != null) {
//Logger.INFO("Slot "+i+" contains "+this.mInventory[i].getDisplayName());
- if (GT_Utility.areStacksEqual(aDrop, mInventory[i], false)) {
+ if (GT_Utility.areStacksEqual(aDrop, this.mInventory[i], false)) {
//Same
- if (mInventory[i].stackSize < 64 && (mInventory[i].stackSize + aDrop.stackSize <= 64)) {
+ if (this.mInventory[i].stackSize < 64 && (this.mInventory[i].stackSize + aDrop.stackSize <= 64)) {
//can merge
//Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize));
- mInventory[i].stackSize += aDrop.stackSize;
+ this.mInventory[i].stackSize += aDrop.stackSize;
break;
}
- else if (mInventory[i].stackSize < 64 && (mInventory[i].stackSize + aDrop.stackSize > 64)) {
+ else if (this.mInventory[i].stackSize < 64 && (this.mInventory[i].stackSize + aDrop.stackSize > 64)) {
//can merge
//Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize));
- int aRemainder = mInventory[i].stackSize + aDrop.stackSize - 64;
+ int aRemainder = this.mInventory[i].stackSize + aDrop.stackSize - 64;
Logger.INFO("Remainder: "+aRemainder+", Continuing.");
- mInventory[i].stackSize = 64;
+ this.mInventory[i].stackSize = 64;
aDrop.stackSize = aRemainder;
continue;
}
@@ -335,7 +358,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
}
public boolean consumeWeedEX(boolean aSimulate) {
- if (hasWeedEX()) {
+ if (hasWeedEX()) {
for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) {
if (this.mInventory[i] != null) {
damage(i, 1, aSimulate);
@@ -347,7 +370,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
}
public void processSecondaryFunctions(ICropTile aCrop) {
- if (!mModeAlternative) {
+ if (!this.mModeAlternative) {
return;
}
if (hasFertilizer() && consumeFertilizer(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyFertilizer(aCrop)) {
@@ -373,18 +396,18 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0;
if (aCrop.getCrop() != null && aCrop.getCrop().isWeed(aCrop) && aCrop.getWeedExStorage() >= 75 && triggerDecline) {
switch (aCrop.getWorld().rand.nextInt(5)) {
- case 0 :
- if (aCrop.getGrowth() > 0) {
- aCrop.setGrowth((byte) (aCrop.getGrowth() - 1));
- }
- case 1 :
- if (aCrop.getGain() > 0) {
- aCrop.setGain((byte) (aCrop.getGain() - 1));
- }
- default :
- if (aCrop.getResistance() > 0) {
- aCrop.setResistance((byte) (aCrop.getResistance() - 1));
- }
+ case 0 :
+ if (aCrop.getGrowth() > 0) {
+ aCrop.setGrowth((byte) (aCrop.getGrowth() - 1));
+ }
+ case 1 :
+ if (aCrop.getGain() > 0) {
+ aCrop.setGain((byte) (aCrop.getGain() - 1));
+ }
+ default :
+ if (aCrop.getResistance() > 0) {
+ aCrop.setResistance((byte) (aCrop.getResistance() - 1));
+ }
}
}
return true;
@@ -422,7 +445,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
this.mFluid = null;
}
//Logger.INFO("Did Hydrate");
- aCrop.setHydrationStorage(aCrop.getHydrationStorage() + drain);
+ aCrop.setHydrationStorage(aCrop.getHydrationStorage() + drain);
return true;
}
else {
@@ -433,23 +456,23 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
}
public boolean consume(int aSlot, int amount, boolean simulate) {
- ItemStack stack = this.mInventory[aSlot];
- if (stack != null && stack.stackSize >= amount) {
- int currentAmount = Math.min(amount, stack.stackSize);
- amount -= currentAmount;
- if (!simulate) {
- if (stack.stackSize == currentAmount) {
- this.mInventory[aSlot] = null;
- } else {
- stack.stackSize -= currentAmount;
- }
- }
- else {
- return amount >= 0;
- }
- return true;
- }
- return false;
+ ItemStack stack = this.mInventory[aSlot];
+ if (stack != null && stack.stackSize >= amount) {
+ int currentAmount = Math.min(amount, stack.stackSize);
+ amount -= currentAmount;
+ if (!simulate) {
+ if (stack.stackSize == currentAmount) {
+ this.mInventory[aSlot] = null;
+ } else {
+ stack.stackSize -= currentAmount;
+ }
+ }
+ else {
+ return amount >= 0;
+ }
+ return true;
+ }
+ return false;
}
public ItemStack damage(int aSlot, int amount, boolean simulate) {
@@ -480,7 +503,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
if (stack.stackSize == 0 && !simulate) {
this.mInventory[aSlot] = null;
}
- }
+ }
if (ret != null) {
int i = DamageHandler.getMaxDamage(ret);
@@ -489,39 +512,39 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
}
return ret;
}
-
- @Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory();
- }
-
- @Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aStack != null) {
- if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
- return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4;
- }
- else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
- return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2;
- }
- }
- return false;
- }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory();
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aStack != null) {
+ if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) {
+ return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4;
+ }
+ else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) {
+ return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2;
+ }
+ }
+ return false;
+ }
@Override
public String[] getDescription() {
- int aRadius = 10 + getRange(mTier);
- int aSide = (aRadius-1)/2;
+ int aRadius = 10 + getRange(this.mTier);
+ int aSide = (aRadius-1)/2;
return new String[] {
- this.mDescription,
+ this.mDescription,
"Secondary mode can Hydrate/Fertilize/Weed-EX",
"Consumes "+powerUsage()+"eu per harvest",
"Consumes "+powerUsageSecondary()+"eu per secondary operation",
"Can harvest 2 blocks above",
"Radius: "+aSide+" each side ("+aRadius+"x3x"+aRadius+")",
- "Has "+(mTier * 5)+"% chance for extra drops",
+ "Has "+(this.mTier * 5)+"% chance for extra drops",
"Holds "+this.getCapacity()+"L of Water",
- CORE.GT_Tooltip
+ CORE.GT_Tooltip
};
}
@@ -592,36 +615,36 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
@Override
public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
if (aSide == 0 || aSide == 1) {
return this.mTextures[3][aColorIndex + 1];
}
else {
- return this.mTextures[4][aColorIndex + 1];
- }
+ return this.mTextures[4][aColorIndex + 1];
+ }
/*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0
: aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
+ 1];*/
}
public ITexture[] getFront(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
}
public ITexture[] getBack(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
}
public ITexture[] getBottom(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
}
public ITexture[] getTop(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)};
}
public ITexture[] getSides(final byte aColor) {
- return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)};
}
@Override
@@ -657,13 +680,13 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- aNBT.setBoolean("mModeAlternative", mModeAlternative);
+ aNBT.setBoolean("mModeAlternative", this.mModeAlternative);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- mModeAlternative = aNBT.getBoolean("mModeAlternative");
+ this.mModeAlternative = aNBT.getBoolean("mModeAlternative");
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
index 6ff34f405a..5d6ba7f2eb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java
@@ -4,10 +4,8 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdder;
import java.util.ArrayList;
-import java.util.Collection;
-import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
-import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.structure.*;
import gregtech.api.enums.*;
import gregtech.api.interfaces.ITexture;
@@ -19,20 +17,17 @@ import gregtech.api.util.*;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.chemistry.RocketFuels;
-import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.*;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.util.minecraft.FluidUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.*;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.*;
public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine>
{
@@ -49,7 +44,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
public static String mCasingName = "Turbodyne Casing";
public static String mIntakeHatchName = "Tungstensteel Turbine Casing";
public static String mGearboxName = "Inconel Reinforced Casing";
-
+
private static Fluid sAirFluid = null;
private static FluidStack sAirFluidStack = null;
@@ -80,105 +75,105 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
protected GT_Multiblock_Tooltip_Builder createTooltip() {
GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder();
tt.addMachineType(getMachineType())
- .addInfo("Controller Block for the Large Rocket Engine")
- .addInfo("Supply Rocket Fuels and 1000L of " + mLubricantName + " per hour")
- .addInfo("Produces as much energy as you put fuel in, with optional boosting")
- .addInfo("Supply 4L of " + mCoolantName + " per second, per 2100 EU/t to boost")
- .addInfo("Takes 3x the amount of fuel and " + mLubricantName + "to run 3x faster")
- .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced")
- .addInfo("If producing more than 18.4k EU/t, fuel will be consumed less efficiently:")
- .addInfo("- 75% of max fuel efficiency at 44k EU/t output energy")
- .addInfo("- 50% of max fuel efficiency at 105k EU/t output energy")
- .addInfo("- 25% of max fuel efficiency at 294k EU/t output energy")
- .addInfo("(These thresholds are 3x higher when boosted)")
- .addInfo("formula: x = input of energy (10K^(1/3)/ x^(1/3)) * (40K^(1/3)/ x^(1/3))")
- .addSeparator()
- .beginStructureBlock(3, 3, 10, false)
- .addController("Front Center")
- .addCasingInfo(mCasingName, 64)
- .addCasingInfo(mGearboxName, 8)
- .addStructureHint("Air Intake Hatch", 1)
- .addInputBus("Side center line", 1)
- .addInputHatch("Side center line", 1)
- .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1)
- .addDynamoHatch("Top center line", 2)
- .addMufflerHatch("Back Center", 3)
- .toolTipFinisher(CORE.GT_Tooltip_Builder);
+ .addInfo("Controller Block for the Large Rocket Engine")
+ .addInfo("Supply Rocket Fuels and 1000L of " + mLubricantName + " per hour")
+ .addInfo("Produces as much energy as you put fuel in, with optional boosting")
+ .addInfo("Supply 4L of " + mCoolantName + " per second, per 2100 EU/t to boost")
+ .addInfo("Takes 3x the amount of fuel and " + mLubricantName + "to run 3x faster")
+ .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced")
+ .addInfo("If producing more than 18.4k EU/t, fuel will be consumed less efficiently:")
+ .addInfo("- 75% of max fuel efficiency at 44k EU/t output energy")
+ .addInfo("- 50% of max fuel efficiency at 105k EU/t output energy")
+ .addInfo("- 25% of max fuel efficiency at 294k EU/t output energy")
+ .addInfo("(These thresholds are 3x higher when boosted)")
+ .addInfo("formula: x = input of energy (10K^(1/3)/ x^(1/3)) * (40K^(1/3)/ x^(1/3))")
+ .addSeparator()
+ .beginStructureBlock(3, 3, 10, false)
+ .addController("Front Center")
+ .addCasingInfo(mCasingName, 64)
+ .addCasingInfo(mGearboxName, 8)
+ .addStructureHint("Air Intake Hatch", 1)
+ .addInputBus("Side center line", 1)
+ .addInputHatch("Side center line", 1)
+ .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1)
+ .addDynamoHatch("Top center line", 2)
+ .addMufflerHatch("Back Center", 3)
+ .toolTipFinisher(CORE.GT_Tooltip_Builder);
return tt;
}
@Override
public IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> getStructureDefinition() {
- if (STRUCTURE_DEFINITION == null) {
- STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder()
- .addShape(mName, transpose(new String[][]{
- {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"},
- {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"},
- {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"},
+ if (this.STRUCTURE_DEFINITION == null) {
+ this.STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder()
+ .addShape(this.mName, transpose(new String[][]{
+ {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"},
+ {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"},
+ {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"},
}))
.addElement(
'C',
ofBlock(
getCasingBlock(), getCasingMeta()
+ )
)
- )
.addElement(
'I',
ofBlock(
getGearboxBlock(), getGearboxMeta()
+ )
)
- )
.addElement(
'T',
ofChain(
ofHatchAdder(
GregtechMetaTileEntity_LargeRocketEngine::addLargeRocketEngineTopList, getCasingTextureIndex(), 2
- ),
+ ),
onElementPass(
x -> ++x.mCasing,
ofBlock(
getCasingBlock(), getCasingMeta()
+ )
)
)
)
- )
.addElement(
'S',
ofChain(
ofHatchAdder(
GregtechMetaTileEntity_LargeRocketEngine::addLargeRocketEngineSideList, getCasingTextureIndex(), 1
- ),
+ ),
onElementPass(
x -> ++x.mCasing,
ofBlock(
getCasingBlock(), getCasingMeta()
+ )
)
)
)
- )
.addElement(
'M',
ofHatchAdder(
GregtechMetaTileEntity_LargeRocketEngine::addLargeRocketEngineBackList, getCasingTextureIndex(), 3
+ )
)
- )
.build();
}
- return STRUCTURE_DEFINITION;
+ return this.STRUCTURE_DEFINITION;
}
@Override
public void construct(ItemStack stackSize, boolean hintsOnly) {
- buildPiece(mName , stackSize, hintsOnly, 1, 1, 0);
+ buildPiece(this.mName , stackSize, hintsOnly, 1, 1, 0);
}
@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- mCasing = 0;
+ this.mCasing = 0;
this.mTecTechDynamoHatches.clear();
this.mAllDynamoHatches.clear();
this.mAirIntakes.clear();
- return checkPiece(mName, 1, 1, 0) && mCasing >= 64 - 48 && mAirIntakes.size() >= 8 && checkHatch();
+ return checkPiece(this.mName, 1, 1, 0) && this.mCasing >= 64 - 48 && this.mAirIntakes.size() >= 8 && checkHatch();
}
public final boolean addLargeRocketEngineTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
@@ -256,7 +251,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity);
}
-
+
public static void setAir() {
if (sAirFluidStack == null) {
sAirFluidStack = FluidUtils.getFluidStack("air", 1);
@@ -283,96 +278,96 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
}
return totalAir;
- }
+ }
}
@Override
public GT_Recipe_Map getRecipeMap() {
return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels;
}
-
+
@Override
public boolean checkRecipe(final ItemStack aStack) {
final ArrayList<FluidStack> tFluids = this.getStoredFluids();
int aircount = getAir() ;
- if (aircount < euProduction/100) {
+ if (aircount < this.euProduction/100) {
//log("Not Enough Air to Run "+aircount);
return false;
}
- else {
- boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(sAirFluid, euProduction/100));
+ else {
+ boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(sAirFluid, this.euProduction/100));
if (!hasIntakeAir) {
//log("Could not consume Air to run "+aircount);
- freeFuelTicks = 0;
+ this.freeFuelTicks = 0;
return false;
- }
+ }
}
// reste fuel ticks incase it does not reset when it stops
- if (freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0)
- freeFuelTicks = 0;
-
+ if (this.freeFuelTicks != 0 && this.mProgresstime == 0 && this.mEfficiency == 0)
+ this.freeFuelTicks = 0;
+
//log("Running "+aircount);
log("looking at hatch");
-
-
+
+
if (tFluids.size() > 0 && getRecipeMap() != null) {
-
+
if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) {
if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
if (!consumeCO2()) {
- freeFuelTicks = 0;
+ this.freeFuelTicks = 0;
return false;
}
}
} else
{
- freeFuelTicks = 0;
+ this.freeFuelTicks = 0;
return false;
}
-
- if (freeFuelTicks == 0)
+
+ if (this.freeFuelTicks == 0)
this.boostEu = consumeLOH();
-
+
for (final FluidStack hatchFluid1 : tFluids) {
if (hatchFluid1.isFluidEqual(sAirFluidStack)) {
continue;
}
-
- if (freeFuelTicks == 0) {
+
+ if (this.freeFuelTicks == 0) {
for (final GT_Recipe aFuel : getRecipeMap().mRecipeList) {
final FluidStack tLiquid;
tLiquid = aFuel.mFluidInputs[0];
if (hatchFluid1.isFluidEqual(tLiquid)) {
if (!consumeFuel(aFuel,hatchFluid1.amount)) {
continue;
- }
- this.fuelValue = aFuel.mSpecialValue;
+ }
+ this.fuelValue = aFuel.mSpecialValue * 3;
this.fuelRemaining = hatchFluid1.amount;
this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]<<1);
this.mProgresstime = 1;
this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = euProduction/2000;
+ this.mEfficiencyIncrease = this.euProduction/2000;
return true;
//log("");
}
}
-
+
} else
{
- this.mEfficiencyIncrease = euProduction/2000;
- freeFuelTicks--;
+ this.mEfficiencyIncrease = this.euProduction/2000;
+ this.freeFuelTicks--;
this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5]<<1);
this.mProgresstime = 1;
this.mMaxProgresstime = 1;
return true;
}
-
+
}
}
this.mEUt = 0;
this.mEfficiency = 0;
- freeFuelTicks = 0;
+ this.freeFuelTicks = 0;
return false;
}
@@ -381,23 +376,23 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
* @param aFuel
* @return
*/
- public boolean consumeFuel(GT_Recipe aFuel,int amount) {
- amount *= this.boostEu ? 0.3 : 0.9;
- freeFuelTicks = 0;
- int value = aFuel.mSpecialValue * 3;
- int energy = value * amount;
- if (amount < 5)
- return false;
- FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
- if (!this.depleteInput(tLiquid)) {
- return false;
- }
- else {
- this.fuelConsumption = this.boostEu ? amount * 3 : amount;
- this.freeFuelTicks = 20;
- setEUProduction(energy);
- return true;
- }
+ public boolean consumeFuel(GT_Recipe aFuel,int amount) {
+ amount *= this.boostEu ? 0.3 : 0.9;
+ this.freeFuelTicks = 0;
+ int value = aFuel.mSpecialValue * 3;
+ int energy = value * amount;
+ if (amount < 5)
+ return false;
+ FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
+ if (!this.depleteInput(tLiquid)) {
+ return false;
+ }
+ else {
+ this.fuelConsumption = this.boostEu ? amount * 3 : amount;
+ this.freeFuelTicks = 20;
+ setEUProduction(energy);
+ return true;
+ }
}
public void setEUProduction(int energy){
@@ -405,19 +400,19 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
double energyEfficiency;
double tDevideEnergy = Math.cbrt(energy);
if (energy > 10000) {
- //cbrt(10 000) /
- energyEfficiency = ((double) 21.5443469/tDevideEnergy);
+ //cbrt(10 000) /
+ energyEfficiency = (21.5443469/tDevideEnergy);
if (energy >= 40000)
//cbrt(40 000) /
- energyEfficiency *= ((double)34.19951893/tDevideEnergy);
+ energyEfficiency *= (34.19951893/tDevideEnergy);
energyEfficiency *= energy;
- }
+ }
else {
energyEfficiency = energy;
}
- euProduction = (int) ((double) energyEfficiency * 1.84);
+ this.euProduction = (int) (energyEfficiency * 1.84);
if (this.boostEu)
- euProduction *= 3;
+ this.euProduction *= 3;
}
public boolean consumeCO2() {
@@ -430,93 +425,94 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
}
public boolean consumeLOH() {
- int LOHamount = (3 * euProduction)/1000;
+ int LOHamount = (3 * this.euProduction)/1000;
return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, LOHamount)); //(40 * ((long) euProduction / 10000))
}
-
+
+ @Override
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ if (this.mAllDynamoHatches.size() > 0) {
+ return addEnergyOutputMultipleDynamos(aEU, true);
+ }
+ return false;
+ }
+
+
@Override
- public boolean addEnergyOutput(long aEU) {
- if (aEU <= 0) {
- return true;
- }
- if (mAllDynamoHatches.size() > 0) {
- return addEnergyOutputMultipleDynamos(aEU, true);
- }
- return false;
- }
-
-
public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
- int injected = 0;
- long totalOutput = 0;
- long aFirstVoltageFound = -1;
- boolean aFoundMixedDynamos = false;
- for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) {
- if( aDynamo == null ) {
- return false;
- }
- if (isValidMetaTileEntity(aDynamo)) {
- long aVoltage = aDynamo.maxEUOutput();
- long aTotal = aDynamo.maxAmperesOut() * aVoltage;
- // Check against voltage to check when hatch mixing
- if (aFirstVoltageFound == -1) {
- aFirstVoltageFound = aVoltage;
- }
- else {
- /**
- * Calcualtes overclocked ness using long integers
- * @param aEUt - recipe EUt
- * @param aDuration - recipe Duration
- * @param mAmperage - should be 1 ?
- */
- //Long time calculation
- if (aFirstVoltageFound != aVoltage) {
- aFoundMixedDynamos = true;
- }
- }
- totalOutput += aTotal;
- }
- }
-
- if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) {
- explodeMultiblock();
- return false;
- }
-
- long leftToInject;
- //Long EUt calculation
- long aVoltage;
- //Isnt too low EUt check?
- int aAmpsToInject;
- int aRemainder;
-
- //xEUt *= 4;//this is effect of everclocking
- for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) {
- if (isValidMetaTileEntity(aDynamo)) {
- leftToInject = aEU - injected;
- aVoltage = aDynamo.maxEUOutput();
- aAmpsToInject = (int) (leftToInject / aVoltage);
- aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
- long powerGain;
- for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) {
- if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)){
- powerGain = aRemainder;
- }else{
- powerGain = aVoltage;
- }
- aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false);
- injected += powerGain;
- }
- }
- }
- return injected > 0;
- }
-
+ int injected = 0;
+ long totalOutput = 0;
+ long aFirstVoltageFound = -1;
+ boolean aFoundMixedDynamos = false;
+ for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
+ if( aDynamo == null ) {
+ return false;
+ }
+ if (isValidMetaTileEntity(aDynamo)) {
+ long aVoltage = aDynamo.maxEUOutput();
+ long aTotal = aDynamo.maxAmperesOut() * aVoltage;
+ // Check against voltage to check when hatch mixing
+ if (aFirstVoltageFound == -1) {
+ aFirstVoltageFound = aVoltage;
+ }
+ else {
+ /**
+ * Calcualtes overclocked ness using long integers
+ * @param aEUt - recipe EUt
+ * @param aDuration - recipe Duration
+ * @param mAmperage - should be 1 ?
+ */
+ //Long time calculation
+ if (aFirstVoltageFound != aVoltage) {
+ aFoundMixedDynamos = true;
+ }
+ }
+ totalOutput += aTotal;
+ }
+ }
+
+ if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) {
+ explodeMultiblock();
+ return false;
+ }
+
+ long leftToInject;
+ //Long EUt calculation
+ long aVoltage;
+ //Isnt too low EUt check?
+ int aAmpsToInject;
+ int aRemainder;
+
+ //xEUt *= 4;//this is effect of everclocking
+ for (GT_MetaTileEntity_Hatch aDynamo : this.mAllDynamoHatches) {
+ if (isValidMetaTileEntity(aDynamo)) {
+ leftToInject = aEU - injected;
+ aVoltage = aDynamo.maxEUOutput();
+ aAmpsToInject = (int) (leftToInject / aVoltage);
+ aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
+ long powerGain;
+ for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) {
+ if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)){
+ powerGain = aRemainder;
+ }else{
+ powerGain = aVoltage;
+ }
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false);
+ injected += powerGain;
+ }
+ }
+ }
+ return injected > 0;
+ }
+
@Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mRuntime%20 == 0) {
- if (mMufflerHatches.size() == 1 && mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) {
- GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = (GT_MetaTileEntity_Hatch_Muffler_Adv) mMufflerHatches.get(0);
+ if (this.mMufflerHatches.size() == 1 && this.mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) {
+ GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = (GT_MetaTileEntity_Hatch_Muffler_Adv) this.mMufflerHatches.get(0);
if (!tMuffler.hasValidFilter()) {
ArrayList<ItemStack> tInputs = getStoredInputs();
for (ItemStack tItem : tInputs) {
@@ -561,16 +557,16 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public void saveNBTData(final NBTTagCompound aNBT) {
- aNBT.setInteger("freeFuelTicks", freeFuelTicks);
- aNBT.setInteger("euProduction", euProduction);
+ aNBT.setInteger("freeFuelTicks", this.freeFuelTicks);
+ aNBT.setInteger("euProduction", this.euProduction);
super.saveNBTData(aNBT);
}
@Override
public void loadNBTData(final NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- freeFuelTicks = aNBT.getInteger("freeFuelTicks");
- euProduction = aNBT.getInteger("euProduction");
+ this.freeFuelTicks = aNBT.getInteger("freeFuelTicks");
+ this.euProduction = aNBT.getInteger("euProduction");
}
@Override
@@ -580,12 +576,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public int getMaxEfficiency(final ItemStack aStack) {
- return euProduction;
+ return this.euProduction;
}
@Override
public int getPollutionPerTick(final ItemStack aStack) {
- return 75 * ( euProduction / 10000);
+ return 75 * ( this.euProduction / 10000);
}
@Override
@@ -595,16 +591,16 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public String[] getExtraInfoData() {
- return new String[] {
+ return new String[] {
"Rocket Engine",
"Current Air: "+getAir(),
"Current Pollution: " + getPollutionPerTick(null),
- "Time until next fuel consumption: "+freeFuelTicks,
+ "Time until next fuel consumption: "+this.freeFuelTicks,
"Current Output: " + this.mEUt * this.mEfficiency / 10000 + " EU/t",
"Fuel Consumption: " + (this.fuelConsumption) + "L/s",
- "Fuel Value: " + this.fuelValue*3 + " EU/L",
+ "Fuel Value: " + this.fuelValue + " EU/L",
"Fuel Remaining: " + this.fuelRemaining + " Litres",
- "Current Efficiency: " + this.mEfficiency / 100 + "%",
+ "Current Efficiency: " + this.mEfficiency / 100 + "%",
(this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" };
}