aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java89
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java47
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java15
-rw-r--r--src/Java/gtPlusPlus/core/config/ConfigHandler.java5
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java13
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java59
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java95
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java78
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/base/CoreItem.java5
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java47
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java3
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java6
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java132
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java2
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java11
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java7
-rw-r--r--src/Java/gtPlusPlus/core/material/ELEMENT.java2
-rw-r--r--src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java89
-rw-r--r--src/Java/gtPlusPlus/core/material/ORES.java2
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java628
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java157
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java217
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java27
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotAirFilter.java30
-rw-r--r--src/Java/gtPlusPlus/core/util/math/MathUtils.java9
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/EnergyUtils.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java75
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java52
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java49
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java59
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java52
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java61
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java232
36 files changed, 2008 insertions, 367 deletions
diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
new file mode 100644
index 0000000000..3a7d4461f4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
@@ -0,0 +1,89 @@
+package gtPlusPlus.core.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import net.minecraft.command.ICommand;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+
+public class CommandEnableDebugWhileRunning implements ICommand
+{
+ private final List<String> aliases;
+
+ public CommandEnableDebugWhileRunning(){
+ this.aliases = new ArrayList<>();
+ }
+
+ @Override
+ public int compareTo(final Object o){
+ return 0;
+
+ }
+
+ @Override
+ public String getCommandName(){
+ return "debugmodegtpp";
+
+ }
+
+ @Override
+ public String getCommandUsage(final ICommandSender var1){
+ return "/debugmodegtpp";
+
+ }
+
+ @Override
+ public List<String> getCommandAliases(){
+ return this.aliases;
+
+ }
+
+ @Override
+ public void processCommand(final ICommandSender S, final String[] argString){
+ Logger.INFO("Toggling Debug Mode");
+
+ final World W = S.getEntityWorld();
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+
+ if (PlayerUtils.isPlayerOP(P)) {
+ CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
+ }
+
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(final ICommandSender var1){
+ if (var1 == null) {
+ return false;
+ }
+ final EntityPlayer P = CommandUtils.getPlayer(var1);
+ if (P != null && PlayerUtils.isPlayerOP(P)) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2){
+ return null;
+ }
+
+ @Override
+ public boolean isUsernameIndex(final String[] var1, final int var2){
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index cacc471249..03b0f944b7 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -27,6 +27,8 @@ import gtPlusPlus.core.handler.COMPAT_IntermodStaging;
import gtPlusPlus.core.handler.GuiHandler;
import gtPlusPlus.core.handler.StopAnnoyingFuckingAchievements;
import gtPlusPlus.core.handler.events.BlockEventHandler;
+import gtPlusPlus.core.handler.events.EnderDragonDeathHandler;
+import gtPlusPlus.core.handler.events.EntityDeathHandler;
import gtPlusPlus.core.handler.events.GeneralTooltipEventHandler;
import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler;
@@ -35,17 +37,26 @@ import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.tileentities.ModTileEntities;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.debug.DEBUG_INIT;
+import gtPlusPlus.core.util.minecraft.EntityUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.player.PlayerCache;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner;
import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO;
import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
+import net.minecraft.entity.monster.EntityBlaze;
+import net.minecraft.entity.monster.EntityZombie;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeChunkManager;
public class CommonProxy {
@@ -145,6 +156,8 @@ public class CommonProxy {
// Register Chunkloader
ForgeChunkManager.setForcedChunkLoadingCallback(GTplusplus.instance, ChunkManager.getInstance());
Utils.registerEvent(ChunkManager.getInstance());
+ Utils.registerEvent(new EnderDragonDeathHandler());
+ Utils.registerEvent(new EntityDeathHandler());
if (ConfigSwitches.disableZombieReinforcement) {
// Make Zombie reinforcements fuck off.
@@ -179,6 +192,7 @@ public class CommonProxy {
COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
COMPAT_IntermodStaging.postInit(e);
COMPAT_HANDLER.runQueuedRecipes();
+ registerCustomMobDrops();
}
public void serverStarting(final FMLServerStartingEvent e) {
@@ -224,5 +238,38 @@ public class CommonProxy {
public void registerCustomItemsForMaterials() {
Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1));
}
+
+ public void registerCustomMobDrops() {
+
+ //Zombie
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10);
+ EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10);
+
+ //Blazes
+ if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) {
+ EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
+ EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10);
+ }
+
+
+ //Special mobs Support
+ if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) {
+ Class aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie");
+ ItemStack aFortune1 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ ItemStack aFortune2 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ ItemStack aFortune3 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune1, 1, 100);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune2, 1, 50);
+ EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1);
+ EntityUtils.registerDropsForMob(aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200);
+ }
+
+
+
+ }
}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
index c6fcc83d01..c9704603af 100644
--- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java
@@ -3,6 +3,7 @@ package gtPlusPlus.core.common.compat;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.bauble.BatteryPackBaseBauble;
+import gtPlusPlus.core.item.bauble.FireProtectionBauble;
import gtPlusPlus.core.item.bauble.MonsterKillerBaseBauble;
import gtPlusPlus.core.item.general.ItemCloakingDevice;
import gtPlusPlus.core.item.general.ItemHealingDevice;
@@ -34,12 +35,18 @@ public class COMPAT_Baubles {
ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0);
//itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
ModItems.itemPersonalHealingDevice = new ItemHealingDevice();
+ ModItems.itemPersonalFireProofDevice = new FireProtectionBauble();
try {
- ModItems.itemChargePack1 = new BatteryPackBaseBauble(6);
- ModItems.itemChargePack2 = new BatteryPackBaseBauble(7);
- ModItems.itemChargePack3 = new BatteryPackBaseBauble(8);
- ModItems.itemChargePack4 = new BatteryPackBaseBauble(9);
+ ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1);
+ ModItems.itemChargePack_Low_2 = new BatteryPackBaseBauble(2);
+ ModItems.itemChargePack_Low_3 = new BatteryPackBaseBauble(3);
+ ModItems.itemChargePack_Low_4 = new BatteryPackBaseBauble(4);
+ ModItems.itemChargePack_Low_5 = new BatteryPackBaseBauble(5);
+ ModItems.itemChargePack_High_1 = new BatteryPackBaseBauble(6);
+ ModItems.itemChargePack_High_2 = new BatteryPackBaseBauble(7);
+ ModItems.itemChargePack_High_3 = new BatteryPackBaseBauble(8);
+ ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9);
}
catch (Throwable t) {
t.printStackTrace();
diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
index 64c8b74b33..89c1324a54 100644
--- a/src/Java/gtPlusPlus/core/config/ConfigHandler.java
+++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
@@ -72,7 +72,10 @@ public class ConfigHandler {
enableAnimatedTurbines = config.getBoolean("enableAnimatedTurbines", "gregtech", true,
"Gives GT Gas/Steam turbines animated textures while running.");
turbineCutoffBase = config.getInt("turbineCutoffBase", "gregtech", 75000, 0, Integer.MAX_VALUE, "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable.");
-
+
+ enableHarderRecipesForHighTierCasings = config.getBoolean("enableHarderRecipesForHighTierCasings", "gregtech", false,
+ "Makes LuV+ Casings and Hulls more difficult to craft.");
+
// Pipes & Cables
enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true,
"Adds Custom GT Fluid Pipes.");
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index 1e3cb0ffbb..fd30457b46 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -22,6 +22,9 @@ import gtPlusPlus.core.recipe.*;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaPollutionCreator;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling;
import gtPlusPlus.xmod.gregtech.registration.gregtech.*;
import net.minecraft.item.ItemStack;
@@ -49,6 +52,14 @@ public class COMPAT_HANDLER {
public static void registerGregtechMachines() {
if (Gregtech) {
+ //Debug
+ GregtechItemList.Garbage_Collector_Debug_Machine.set(
+ new GregtechMetaGarbageCollector(
+ "garbagecollector.01.tier.single",
+ "JVM Garbage Collector",
+ "Useful for debugging or smoother performance on local servers").getStackForm(1L));
+
+
//Free IDs
/*
---
@@ -114,7 +125,7 @@ public class COMPAT_HANDLER {
GregtechBedrockPlatforms.run();
GregtechBufferDynamos.run();
GregtechAmazonWarehouse.run();
- GregtechIndustrialCryogenicFreezer.run();
+ GregtechFactoryGradeReplacementMultis.run();
GregtechThaumcraftDevices.run();
GregtechThreadedBuffers.run();
GregtechIndustrialMixer.run();
diff --git a/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java b/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
new file mode 100644
index 0000000000..884f14386d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java
@@ -0,0 +1,59 @@
+package gtPlusPlus.core.handler.events;
+
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.entity.boss.EntityDragon;
+import net.minecraftforge.event.entity.living.LivingDropsEvent;
+
+public class EnderDragonDeathHandler {
+
+ private static final String mDragonClassName = "chylex.hee.entity.boss.EntityBossDragon";
+ private static final boolean mHEE;
+ private static final Class mHardcoreDragonClass;
+
+ static {
+ mHEE = ReflectionUtils.doesClassExist(mDragonClassName);
+ mHardcoreDragonClass = (mHEE ? ReflectionUtils.getClass(mDragonClassName) : null);
+ }
+
+ @SubscribeEvent
+ public void onEntityDrop(LivingDropsEvent event) {
+
+ boolean aDidDrop = false;
+ int aCountTotal = 0;
+
+ //HEE Dragon
+ if (mHEE) {
+ if (mHardcoreDragonClass != null) {
+ if (mHardcoreDragonClass.isInstance(event.entityLiving)) {
+ for (int y = 0; y < MathUtils.randInt(100, 250); y++) {
+ int aAmount = MathUtils.randInt(5, 25);
+ event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
+ aDidDrop = true;
+ aCountTotal =+ aAmount;
+ }
+ }
+ }
+ }
+ //Vanilla Dragon or any other dragon that extends it
+ else {
+ if (event.entityLiving instanceof EntityDragon) {
+ for (int y = 0; y < MathUtils.randInt(25, 50); y++) {
+ int aAmount = MathUtils.randInt(1, 10);
+ event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1));
+ aDidDrop = true;
+ aCountTotal =+ aAmount;
+ }
+ }
+ }
+
+ if (aDidDrop) {
+ PlayerUtils.messageAllPlayers(aCountTotal+" Shards of Dragons Blood have crystalized into a metallic form.");
+ }
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java b/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
new file mode 100644
index 0000000000..c4ab6edaa6
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
@@ -0,0 +1,95 @@
+package gtPlusPlus.core.handler.events;
+
+import java.util.HashMap;
+import java.util.HashSet;
+
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.data.Triplet;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.event.entity.living.LivingDropsEvent;
+
+public class EntityDeathHandler {
+
+
+ private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>>();
+ private static final HashSet<Class> mInternalClassKeyCache = new HashSet<Class>();
+
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aMaxAmount - The maximum size of the ItemStack which drops.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
+ Triplet<ItemStack, Integer, Integer> aData = new Triplet<ItemStack, Integer, Integer>(aStack, aMaxAmount, aChance);
+ AutoMap<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass);
+ if (aDataMap == null) {
+ aDataMap = new AutoMap<Triplet<ItemStack, Integer, Integer>>();
+ }
+ aDataMap.put(aData);
+ mMobDropMap.put(aMobClass, aDataMap);
+
+ Logger.INFO("[Loot] Registered "+aStack.getDisplayName()+" (1-"+aMaxAmount+") as a valid drop for "+aMobClass.getCanonicalName());
+
+ if (!mInternalClassKeyCache.contains(aMobClass)) {
+ mInternalClassKeyCache.add(aMobClass);
+ }
+
+ }
+
+ private static ItemStack processItemDropTriplet(Triplet<ItemStack, Integer, Integer> aData) {
+ ItemStack aLoot = aData.getValue_1();
+ int aMaxDrop = aData.getValue_2();
+ int aChanceOutOf10000 = aData.getValue_3();
+ if (MathUtils.randInt(0, 10000) <= aChanceOutOf10000) {
+ aLoot = ItemUtils.getSimpleStack(aLoot, MathUtils.randInt(1, aMaxDrop));
+ if (ItemUtils.checkForInvalidItems(aLoot)) {
+ return aLoot;
+ }
+ }
+ return null;
+ }
+
+ private static boolean processDropsForMob(EntityLivingBase entityLiving) {
+ AutoMap<Triplet<ItemStack, Integer, Integer>> aMobData = mMobDropMap.get(entityLiving.getClass());
+ boolean aDidDrop = false;
+ if (aMobData != null) {
+ if (!aMobData.isEmpty()) {
+ ItemStack aPossibleDrop;
+ for (Triplet<ItemStack, Integer, Integer> g : aMobData) {
+ aPossibleDrop = processItemDropTriplet(g);
+ if (aPossibleDrop != null) {
+ if (entityLiving.entityDropItem(aPossibleDrop, MathUtils.randFloat(0, 1)) != null) {
+ aDidDrop = true;
+ }
+ }
+ }
+ }
+ }
+ return aDidDrop;
+ }
+
+
+
+
+
+ @SubscribeEvent
+ public void onEntityDrop(LivingDropsEvent event) {
+ boolean aDidDrop = false;
+ if (event == null || event.entityLiving == null) {
+ return;
+ }
+ for (Class c : mInternalClassKeyCache) {
+ if (c.isInstance(event.entityLiving)) {
+ aDidDrop = processDropsForMob(event.entityLiving);
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 51d41674d3..de22821127 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -82,6 +82,7 @@ import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialGenerator;
import gtPlusPlus.core.material.NONMATERIAL;
@@ -93,6 +94,7 @@ 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.reflect.ReflectionUtils;
import gtPlusPlus.everglades.GTplusplus_Everglades;
import gtPlusPlus.xmod.eio.material.MaterialEIO;
@@ -182,6 +184,7 @@ public final class ModItems {
public static Item itemPersonalCloakingDevice;
public static Item itemPersonalCloakingDeviceCharged;
public static Item itemPersonalHealingDevice;
+ public static Item itemPersonalFireProofDevice;
public static Item itemSlowBuildingRing;
public static MultiPickaxeBase MP_GTMATERIAL;
@@ -332,10 +335,15 @@ public final class ModItems {
public static IonParticles itemIonParticleBase;
public static StandardBaseParticles itemStandarParticleBase;
- public static BatteryPackBaseBauble itemChargePack1;
- public static BatteryPackBaseBauble itemChargePack2;
- public static BatteryPackBaseBauble itemChargePack3;
- public static BatteryPackBaseBauble itemChargePack4;
+ public static BatteryPackBaseBauble itemChargePack_Low_1;
+ public static BatteryPackBaseBauble itemChargePack_Low_2;
+ public static BatteryPackBaseBauble itemChargePack_Low_3;
+ public static BatteryPackBaseBauble itemChargePack_Low_4;
+ public static BatteryPackBaseBauble itemChargePack_Low_5;
+ public static BatteryPackBaseBauble itemChargePack_High_1;
+ public static BatteryPackBaseBauble itemChargePack_High_2;
+ public static BatteryPackBaseBauble itemChargePack_High_3;
+ public static BatteryPackBaseBauble itemChargePack_High_4;
public static DebugScanner itemDebugScanner;
@@ -355,6 +363,8 @@ public final class ModItems {
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Nether;
public static MonsterKillerBaseBauble itemAmuletMonsterKiller_Infernal;
+ public static CoreItem itemExquisiteIndustrialDiamond;
+
static {
Logger.INFO("Items!");
//Default item used when recipes fail, handy for debugging. Let's make sure they exist when this class is called upon.
@@ -539,6 +549,9 @@ public final class ModItems {
MaterialGenerator.generate(ELEMENT.STANDALONE.GRANITE, false, false);
MaterialGenerator.generate(ELEMENT.STANDALONE.RUNITE, false);
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){
@@ -842,6 +855,63 @@ public final class ModItems {
itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1);
}
+ //Industrial Diamonds
+ itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc);
+ ItemStack tempStack = itemExquisiteIndustrialDiamond.getStack();
+ ItemUtils.addItemToOreDictionary(tempStack, "gemDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "craftingIndustrialDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond");
+ ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond");
+
+ //Custom GT++ Crafting Components
+
+ //Springs
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.NITINOL_60);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.AQUATIC_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.EGLIN_STEEL);
+
+ //Small Springs
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.MARAGING250);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.NICHROME);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STABALLOY);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STEEL_BLACK);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.BLACK_TITANIUM);
+
+ //Fine Wire
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.WHITE_METAL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().PALLADIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().ZIRCONIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.LEAGRISIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.BABBIT_ALLOY);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM);
+
+ //Dense Plates
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL);
+ MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM);
+ 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);
+
+
+
+
//Special Sillyness
if (true) {
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index 33198e8d41..90e831cbb4 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -248,12 +248,17 @@ public class BaseItemComponent extends Item{
public int getColorFromItemStack(final ItemStack stack, final int renderPass) {
+ if (this.componentType == ComponentTypes.CELL || this.componentType == ComponentTypes.PLASMACELL) {
if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){
return Utils.rgbtoHexValue(255, 255, 255);
}
if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){
return Utils.rgbtoHexValue(255, 255, 255);
}
+ }
+ if (this.componentType == ComponentTypes.PLATEHEAVY) {
+
+ }
@@ -495,7 +500,10 @@ public class BaseItemComponent extends Item{
PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma", OrePrefixes.cellPlasma),
CELL("Cell", " Cell", "cell", OrePrefixes.cell),
NUGGET("Nugget", " Nugget", "nugget", OrePrefixes.nugget),
- PLATEHEAVY("HeavyPlate", " Heavy Plate", "plateHeavy", OrePrefixes.plateDense);
+ PLATEHEAVY("HeavyPlate", "Heavy@Plate", "plateHeavy", OrePrefixes.plateDense),
+ SPRING("Spring", " Spring", "spring", OrePrefixes.spring),
+ SMALLSPRING("SmallSpring", "Small@Spring", "springSmall", OrePrefixes.springSmall),
+ FINEWIRE("FineWire", "Fine@Wire", "wireFine", OrePrefixes.wireFine),;
private String COMPONENT_NAME;
private String DISPLAY_NAME;
diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
index 376be7bac8..7ce96b2a88 100644
--- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java
+++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
@@ -17,6 +17,7 @@ import net.minecraft.world.World;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
public class CoreItem extends Item
{
@@ -221,6 +222,10 @@ public class CoreItem extends Item
public boolean isRepairable() {
return false;
}
+
+ public ItemStack getStack() {
+ return ItemUtils.getSimpleStack(this);
+ }
/* @Override
public String getItemStackDisplayName(final ItemStack tItem) {
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
index 273995e181..e1c3e179ee 100644
--- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java
@@ -40,7 +40,7 @@ public class BaseItemDustUnique extends Item{
this.setCreativeTab(tabMisc);
this.colour = colour;
this.materialName = materialName;
- if (mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")){
+ if (mChemicalFormula == null || mChemicalFormula.equals("") || mChemicalFormula.equals("NullFormula")){
this.chemicalNotation = StringUtils.subscript(materialName);
}
else {
diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
new file mode 100644
index 0000000000..c9072b0d82
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateHeavy.java
@@ -0,0 +1,47 @@
+package gtPlusPlus.core.item.base.plates;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.util.IIcon;
+
+public class BaseItemPlateHeavy extends BaseItemComponent{
+
+ final static ComponentTypes HEAVY = ComponentTypes.PLATEHEAVY;
+
+ public BaseItemPlateHeavy(final Material material) {
+ super(material, HEAVY);
+ }
+
+ @Override
+ public String getCorrectTextures(){
+ return CORE.MODID + ":" + "itemHeavyPlate";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ return true;
+ }
+
+ @Override
+ public void registerIcons(final IIconRegister i) {
+ this.base = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate");
+ this.overlay = i.registerIcon(CORE.MODID + ":" + "itemHeavyPlate_Overlay");
+ }
+
+ @Override
+ public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
+
+ if (pass == 0) {
+ return this.base;
+ }
+ else {
+ return this.overlay;
+ }
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
index 2d9b35ac63..2e40d86473 100644
--- a/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
+++ b/src/Java/gtPlusPlus/core/item/bauble/BatteryPackBaseBauble.java
@@ -242,8 +242,7 @@ public class BatteryPackBaseBauble extends ElectricBaseBauble {
@Override
public String getTextureNameForBauble() {
- // TODO Auto-generated method stub
- return null;
+ return "chargepack/"+mTier;
}
}
diff --git a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
index fb490285e9..cfa5cb363d 100644
--- a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
+++ b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java
@@ -9,11 +9,9 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
@@ -21,7 +19,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
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.util.EnumChatFormatting;
@@ -42,7 +39,7 @@ public abstract class ElectricBaseBauble extends BaseBauble implements IElectric
mTier = aTier;
maxValueEU = aMaxEU;
this.setUnlocalizedName(aUnlocalName);
- this.setTextureName(getTextureNameForBauble());
+ this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
this.setMaxDamage(27);
this.setMaxStackSize(1);
this.setNoRepair();
@@ -54,6 +51,7 @@ public abstract class ElectricBaseBauble extends BaseBauble implements IElectric
public abstract String getTextureNameForBauble();
+ @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
@Override
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
diff --git a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
new file mode 100644
index 0000000000..04467091c0
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
@@ -0,0 +1,132 @@
+package gtPlusPlus.core.item.bauble;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.UUID;
+
+import baubles.api.BaubleType;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class FireProtectionBauble extends BaseBauble {
+
+ public static HashMap<UUID, Boolean> mDataMap = new HashMap<UUID, Boolean>();
+ public static HashSet<UUID> mPlayerMap = new HashSet<UUID>();
+
+ private static Field isImmuneToFire;
+
+ static {
+ isImmuneToFire = ReflectionUtils.getField(Entity.class, "isImmuneToFire");
+ }
+
+ public static boolean fireImmune(Entity aEntity) {
+ return aEntity.isImmuneToFire();
+ }
+
+ public static boolean setEntityImmuneToFire(Entity aEntity, boolean aImmune) {
+ return ReflectionUtils.setField(aEntity, isImmuneToFire, aImmune);
+ }
+
+ public FireProtectionBauble() {
+ super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0);
+ String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name";
+ this.setUnlocalizedName(aUnlocalName);
+ this.setTextureName(CORE.MODID + ":" + getTextureNameForBauble());
+ this.setMaxDamage(100);
+ this.setMaxStackSize(1);
+ this.setNoRepair();
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ if (GameRegistry.findItem(CORE.MODID, aUnlocalName) == null) {
+ GameRegistry.registerItem(this, aUnlocalName);
+ }
+ }
+
+ @Override
+ public void onUpdate(final ItemStack itemStack, final World worldObj, final Entity player, final int p_77663_4_,
+ final boolean p_77663_5_) {
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+
+ }
+
+ @Override
+ public String getItemStackDisplayName(final ItemStack p_77653_1_) {
+ return (EnumChatFormatting.DARK_RED + super.getItemStackDisplayName(p_77653_1_) + EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public boolean showDurabilityBar(final ItemStack stack) {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) {
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean canEquip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(final ItemStack arg0, final EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ mPlayerMap.add(bPlayer.getUniqueID());
+ }
+ }
+ }
+
+ @Override
+ public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ if (bPlayer.isPotionActive(Potion.fireResistance)) {
+ bPlayer.removePotionEffect(Potion.fireResistance.id);
+ }
+ mPlayerMap.remove(bPlayer.getUniqueID());
+ setEntityImmuneToFire(bPlayer, false);
+ }
+ }
+ }
+
+ @Override
+ public void onWornTick(final ItemStack aBaubleStack, final EntityLivingBase aPlayer) {
+ if (!aPlayer.worldObj.isRemote) {
+ if (aPlayer instanceof EntityPlayer) {
+ EntityPlayer bPlayer = (EntityPlayer) aPlayer;
+ if (!fireImmune(bPlayer)) {
+ setEntityImmuneToFire(bPlayer, true);
+ }
+ if (!bPlayer.isPotionActive(Potion.fireResistance)) {
+ bPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 100, 4));
+ }
+ }
+ }
+ }
+
+ public String getTextureNameForBauble() {
+ return "baubles/itemFireProtectGlovesBetter";
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
index aa89ff1627..aab302688b 100644
--- a/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
+++ b/src/Java/gtPlusPlus/core/item/bauble/MonsterKillerBaseBauble.java
@@ -169,7 +169,7 @@ public class MonsterKillerBaseBauble extends ElectricBaseBauble {
@Override
public String getTextureNameForBauble() {
- return CORE.MODID + ":" + "baubles/itemAmulet";
+ return "baubles/itemAmulet";
}
}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 632378987a..38be7d8593 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -51,7 +51,7 @@ public class CORE {
public static final String name = "GT++";
public static final String MODID = "miscutils";
- public static final String VERSION = "1.7.02.99-pre";
+ public static final String VERSION = "1.7.03.01";
public static String MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase();
public static String USER_COUNTRY = GeoUtils.determineUsersCountry();
public static boolean isModUpToDate = Utils.isModUpToDate();
@@ -214,6 +214,7 @@ public class CORE {
public static boolean enableNitroFix = false;
public static boolean enableSulfuricAcidFix = false;
public static boolean enableAnimatedTurbines = true;
+ public static boolean enableHarderRecipesForHighTierCasings = true;
//Single Block Machines
public static boolean enableMachine_SolarGenerators = false;
@@ -282,4 +283,12 @@ public class CORE {
public static final String VERSION = "0.1";
}
+ public static final void crash() {
+ System.exit(0);
+ }
+
+ public static final void gc() {
+ System.gc();
+ }
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index d2639a220f..95e3631aaf 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -15,7 +15,7 @@ public final class ALLOY {
public static final Material KANTHAL = MaterialUtils.generateMaterialFromGtENUM(Materials.Kanthal);
public static final Material NICHROME = MaterialUtils.generateMaterialFromGtENUM(Materials.Nichrome);
public static final Material TUNGSTENSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.TungstenSteel);
- public static final Material STAINLESSSTEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.StainlessSteel);
+ public static final Material STAINLESS_STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.StainlessSteel);
public static final Material OSMIRIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Osmiridium);
public static final Material ENERGYCRYSTAL = new Material(
@@ -695,7 +695,8 @@ public final class ALLOY {
new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 30),
new MaterialStack(ALLOY.MARAGING350, 40),
new MaterialStack(ALLOY.TUNGSTENSTEEL, 20),
- new MaterialStack(ALLOY.OSMIRIDIUM, 10)
+ new MaterialStack(ALLOY.OSMIRIDIUM, 10),
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 10)
});
@@ -803,7 +804,7 @@ public final class ALLOY {
true, //Uses Blast furnace?
//Material Stacks with Percentage of required elements.
new MaterialStack[]{
- new MaterialStack(ALLOY.STAINLESSSTEEL, 10),
+ new MaterialStack(ALLOY.STAINLESS_STEEL, 10),
new MaterialStack(ALLOY.TUNGSTEN_CARBIDE, 10),
new MaterialStack(ALLOY.NICHROME, 10),
new MaterialStack(ALLOY.BRONZE, 10),
diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java
index 9ba6fe0f1d..99586b37fe 100644
--- a/src/Java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java
@@ -51,7 +51,7 @@ public final class ELEMENT {
public final Material BROMINE = new Material("Bromine", MaterialState.PURE_LIQUID, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material
public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_LIQUID, new short[]{255, 255, 255}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material
public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium);
- public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium);
+ public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium, new short[] {230, 210, 110}, TextureSet.SET_FLINT);
public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium);
public final Material ZIRCONIUM = new Material("Zirconium", MaterialState.SOLID, new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material
public final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium);
diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
new file mode 100644
index 0000000000..c7032ab7c7
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
@@ -0,0 +1,89 @@
+package gtPlusPlus.core.material;
+
+import gregtech.api.enums.TextureSet;
+import gtPlusPlus.core.material.nuclear.FLUORIDES;
+import gtPlusPlus.core.material.state.MaterialState;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
+
+public final class MISC_MATERIALS {
+
+ /*
+ * Some of these materials purely exist as data objects, items will most likely be assigned seperately.
+ * Most are just compositions which will have dusts assigned to them.
+ */
+
+ public static void run() {
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_OXIDE, false);
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false);
+ }
+
+ public static final Material STRONTIUM_OXIDE = new Material(
+ "Strontium Oxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "SrO",
+ 0,
+ false,
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
+ });
+
+ public static final Material STRONTIUM_HYDROXIDE = new Material(
+ "Strontium Hydroxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "Sr(OH)2",
+ 0,
+ false,
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(FLUORIDES.HYDROXIDE, 2)
+ });
+
+ public static final Material SELENIUM_DIOXIDE = new Material(
+ "Selenium Dioxide",
+ MaterialState.PURE_LIQUID, //State
+ null, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().SELENIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 2)
+ });
+
+ public static final Material SELENIOUS_ACID = new Material(
+ "Selenious Acid",
+ MaterialState.PURE_LIQUID, //State
+ null, //Material Colour
+ -1, //Melting Point in C
+ -1, //Boiling Point in C
+ -1, //Protons
+ -1,
+ false, //Uses Blast furnace?
+ //Material Stacks with Percentage of required elements.
+ new MaterialStack[]{
+ new MaterialStack(SELENIUM_DIOXIDE, 1),
+ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 8),
+ new MaterialStack(ELEMENT.getInstance().OXYGEN, 4)
+ });
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java
index 801e4924b3..0e1691a557 100644
--- a/src/Java/gtPlusPlus/core/material/ORES.java
+++ b/src/Java/gtPlusPlus/core/material/ORES.java
@@ -545,7 +545,7 @@ public final class ORES {
-1, //Radiation
new MaterialStack[]{// (Ca,Sr,Ce,Na)5(PO4)3F
new MaterialStack(ELEMENT.getInstance().CALCIUM, 5),
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 5),
+ new MaterialStack(MISC_MATERIALS.STRONTIUM_OXIDE, 5),
new MaterialStack(ELEMENT.getInstance().CERIUM, 5),
new MaterialStack(ELEMENT.getInstance().SODIUM, 5),
new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 3),
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 483fce8ce5..b6d41443ef 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -26,6 +26,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.NONMATERIAL;
import gtPlusPlus.core.material.ORES;
@@ -90,47 +91,64 @@ public class RECIPES_GREGTECH {
assemblyLineRecipes();
latheRecipes();
vacuumFreezerRecipes();
+ fluidheaterRecipes();
+
+ /**
+ * Special Recipe handlers
+ */
+ RECIPES_SeleniumProcessing.init();
+
+
+
+
+
+
addFuels();
}
+ private static void fluidheaterRecipes() {
+ GT_Values.RA.addFluidHeaterRecipe(CI.getNumberedCircuit(20), FluidUtils.getWater(1000), FluidUtils.getHotWater(1000), 30, 30);
+
+ }
+
private static void vacuumFreezerRecipes() {
GT_Values.RA.addVacuumFreezerRecipe(GregtechItemList.Bomb_Cast_Molten.get(1), GregtechItemList.Bomb_Cast_Set.get(1), 20 * 30);
}
private static void latheRecipes() {
-
+
GT_Values.RA.addLatheRecipe(
ALLOY.EGLIN_STEEL.getBlock(1),
GregtechItemList.Bomb_Cast_Mold.get(1),
null,
20 * 60 * 15,
120);
-
+
GT_Values.RA.addLatheRecipe(
GregtechItemList.Bomb_Cast_Set.get(1),
GregtechItemList.Bomb_Cast_Broken.get(2),
ItemUtils.getSimpleStack(ModItems.itemBombCasing, 2),
20 * 60 * 5,
30);
-
+
}
private static void fusionRecipes() {
- /**
- * Adds a Fusion reactor Recipe
- *
- * @param aInput1 = first Input (not null, and respects StackSize)
- * @param aInput2 = second Input (not null, and respects StackSize)
- * @param aOutput = Output of the Fusion (can be null, and respects StackSize)
- * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
- * @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!)
- * @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0)
- */
-
+ /**
+ * Adds a Fusion reactor Recipe
+ *
+ * @param aInput1 = first Input (not null, and respects StackSize)
+ * @param aInput2 = second Input (not null, and respects StackSize)
+ * @param aOutput = Output of the Fusion (can be null, and respects StackSize)
+ * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0)
+ * @param aFusionEnergyPerTick = The EU generated per Tick (can even be negative!)
+ * @param aEnergyNeededForStartingFusion = EU needed for heating the Reactor up (must be >= 0)
+ */
+
//Hydrogen Plasma
- /*CORE.RA.addFusionReactorRecipe(
+ /*CORE.RA.addFusionReactorRecipe(
Particle.getIon("Hydrogen", 0),
Particle.getIon("Hydrogen", 0),
Materials.Hydrogen.getPlasma(1),
@@ -138,8 +156,8 @@ public class RECIPES_GREGTECH {
16,
4096,
40000000);*/
-
-
+
+
//Hypogen Creation
GT_Values.RA.addFusionReactorRecipe(
Materials.Neutronium.getMolten(128),
@@ -157,23 +175,23 @@ public class RECIPES_GREGTECH {
2048 * 4,
(int) GT_Values.V[7],
150000000 * 2);
-
+
}
private static void assemblyLineRecipes() {
-
-
+
+
ItemStack[] aCoilWire = new ItemStack[] {
ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 0, GTNH ? 64 : 32),
ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 1, GTNH ? 48 : 16),
ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 2, GTNH ? 32 : 8),
ItemUtils.simpleMetaStack("miscutils:itemDehydratorCoilWire", 3, GTNH ? 16 : 4),
};
-
-
-
-
+
+
+
+
//Containment Casings
CORE.RA.addAssemblylineRecipe(
ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
@@ -199,12 +217,12 @@ public class RECIPES_GREGTECH {
ALLOY.ENERGYCRYSTAL.getFluid(144 * 9 * (GTNH ? 8 : 4)),
ALLOY.TUMBAGA.getFluid(144 * 9 * (GTNH ? 32 : 8)),
ALLOY.NICHROME.getFluid(144 * 1 * (GTNH ? 16 : 4)),
-
+
},
ItemUtils.getSimpleStack(ModBlocks.blockCasings3Misc, 15, 32),
20 * 60 * 10 * (GTNH ? 2 : 1),
(int) GT_Values.V[6]);
-
+
//Slow Fusion Controller
CORE.RA.addAssemblylineRecipe(
GregtechItemList.COMET_Cyclotron.get(1),
@@ -232,8 +250,8 @@ public class RECIPES_GREGTECH {
GregtechItemList.Miniature_Fusion.get(1),
20 * 60 * 5 * (GTNH ? 2 : 1),
(int) GT_Values.V[7]);
-
-
+
+
//Plasma Tank
CORE.RA.addAssemblylineRecipe(
ItemUtils.getOrePrefixStack(OrePrefixes.pipeMedium, Materials.Superconductor, 1),
@@ -250,17 +268,17 @@ public class RECIPES_GREGTECH {
CI.getTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
CI.getTertiaryTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
CI.getAlternativeTieredFluid(4, 144 * 9 * (GTNH ? 16 : 8)),
-
+
},
GregtechItemList.Plasma_Tank.get(1),
20 * 60 * 1 * (GTNH ? 2 : 1),
(int) GT_Values.V[5]);
-
-
+
+
/*
* Contianment casings
*/
-
+
ItemStack[] aGemCasings = new ItemStack[] {
GregtechItemList.Battery_Casing_Gem_1.get(1),
GregtechItemList.Battery_Casing_Gem_2.get(1),
@@ -273,7 +291,7 @@ public class RECIPES_GREGTECH {
GregtechItemList.Battery_Casing_Gem_2.get(1),
GregtechItemList.Battery_Casing_Gem_3.get(1),
};
-
+
int aCasingSlot = 0;
for (int j = 6; j < 10; j++) {
CORE.RA.addAssemblylineRecipe(
@@ -290,24 +308,24 @@ public class RECIPES_GREGTECH {
CI.getTieredFluid(j, 144 * 3 * (GTNH ? 16 : 8)),
CI.getTertiaryTieredFluid(j-2, 144 * 4 * (GTNH ? 16 : 8)),
CI.getAlternativeTieredFluid(j, 144 * 6 * (GTNH ? 16 : 8)),
-
+
},
aGemCasings[aCasingSlot++],
20 * 60 * 1 * (GTNH ? 2 : 1),
(int) GT_Values.V[j]);
}
-
+
/*
* Gem Battery Recipes
*/
-
+
ItemStack[] aGemBatteries = new ItemStack[] {
GregtechItemList.Battery_Gem_1.get(1),
GregtechItemList.Battery_Gem_2.get(1),
GregtechItemList.Battery_Gem_3.get(1),
GregtechItemList.Battery_Gem_4.get(1),
};
-
+
ItemStack[] aExoticInputs = new ItemStack[] {
Particle.getBaseParticle(Particle.PROTON),
Particle.getBaseParticle(Particle.ELECTRON),
@@ -338,8 +356,8 @@ public class RECIPES_GREGTECH {
20 * 60 * 1 * (GTNH ? 2 : 1),
(int) GT_Values.V[j]);
}
-
-
+
+
//Nano Healer
CORE.RA.addAssemblylineRecipe(
ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1),
@@ -360,28 +378,28 @@ public class RECIPES_GREGTECH {
CI.getTertiaryTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
CI.getAlternativeTieredFluid(6, 144 * 18 * (GTNH ? 16 : 8)),
CI.getAlternativeTieredFluid(7, 144 * 18 * (GTNH ? 16 : 8)),
-
+
},
ItemUtils.getItemStackFromFQRN("miscutils:personalHealingDevice", 1),
20 * 60 * 30 * (GTNH ? 2 : 1),
(int) GT_Values.V[7]);
-
-
-
+
+
+
//Charge Pack LuV-UV
ItemStack[] aChargeResearch = new ItemStack[] {
ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore7", 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack1, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack2, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack3, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
};
-
+
ItemStack[] aChargeOutputs = new ItemStack[] {
- ItemUtils.getSimpleStack(ModItems.itemChargePack1, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack2, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack3, 1),
- ItemUtils.getSimpleStack(ModItems.itemChargePack4, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_1, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_2, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_3, 1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_High_4, 1),
};
ItemStack[] aBufferCoreInputs = new ItemStack[] {
@@ -390,7 +408,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore9", GTNH ? 8 : 4),
ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore10", GTNH ? 8 : 4),
};
-
+
int aCurrSlot = 0;
for (int h = 6; h < 10; h++) {
CORE.RA.addAssemblylineRecipe(
@@ -398,7 +416,7 @@ public class RECIPES_GREGTECH {
20 * 60 * 10 * (aCurrSlot + 1),
new ItemStack[] {
ItemUtils.getSimpleStack(
- aGemBatteries[aCurrSlot], GTNH ? 4 : 2),
+ aGemBatteries[aCurrSlot], GTNH ? 4 : 2),
aBufferCoreInputs[aCurrSlot],
aCoilWire[aCurrSlot],
CI.getTieredComponent(OrePrefixes.plate, h, GTNH ? 16 : 8),
@@ -423,15 +441,15 @@ public class RECIPES_GREGTECH {
(int) GT_Values.V[h]);
aCurrSlot++;
}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
}
private static void laserEngraverRecipes() {
@@ -442,21 +460,21 @@ public class RECIPES_GREGTECH {
ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.getDust(1),
20 * 60 * 3,
MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.vTier));
-
+
GT_Values.RA.addLaserEngraverRecipe(
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Titanium, 8L),
GregtechItemList.Laser_Lens_Special.get(0),
ELEMENT.STANDALONE.ASTRAL_TITANIUM.getDust(1),
20 * 60 * 2,
MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ASTRAL_TITANIUM.vTier));
-
+
GT_Values.RA.addLaserEngraverRecipe(
ALLOY.NITINOL_60.getBlock(2),
GregtechItemList.Laser_Lens_Special.get(0),
ELEMENT.STANDALONE.ADVANCED_NITINOL.getBlock(1),
20 * 60 * 1,
MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.ADVANCED_NITINOL.vTier));
-
+
GT_Values.RA.addLaserEngraverRecipe(
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 64L),
GregtechItemList.Laser_Lens_Special.get(0),
@@ -464,15 +482,15 @@ public class RECIPES_GREGTECH {
20 * 60 * 5,
MaterialUtils.getVoltageForTier(ELEMENT.STANDALONE.CHRONOMATIC_GLASS.vTier));
-
+
GT_Values.RA.addLaserEngraverRecipe(
CI.getFieldGenerator(6, 1),
CI.getEmitter(7, 2),
ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1),
20 * 60 * 5,
MaterialUtils.getVoltageForTier(5));
-
-
+
+
}
private static void breweryRecipes() {
@@ -537,7 +555,7 @@ public class RECIPES_GREGTECH {
FluidUtils.getFluidStack("molten.trinium", 136 * 144), 0, 20 * 3000,
2040*4);
}
-
+
//Eglin Steel
CORE.RA.addBlastSmelterRecipe(
new ItemStack[] {
@@ -553,7 +571,7 @@ public class RECIPES_GREGTECH {
0,
20 * 45,
120);
-
+
//HG1223
CORE.RA.addBlastSmelterRecipe(
new ItemStack[] {
@@ -568,12 +586,12 @@ public class RECIPES_GREGTECH {
new ItemStack[] {
CI.emptyCells(1)
},
- 100, //Output Chance
+ new int[] {10000}, //Output Chance
20 * 120,
122880);
-
-
-
+
+
+
// Germanium Roasting
CORE.RA.addBlastSmelterRecipe(
@@ -588,41 +606,6 @@ public class RECIPES_GREGTECH {
20 * 300,
4000);
- // Selenium Roasting
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(16),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPyrite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(4000),
- ELEMENT.getInstance().SELENIUM.getFluid(144),
- 0,
- 20 * 300,
- 2000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(17),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedChalcopyrite", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(4000),
- ELEMENT.getInstance().SELENIUM.getFluid(144),
- 0,
- 20 * 300,
- 2000);
- CORE.RA.addBlastSmelterRecipe(
- new ItemStack[] {
- ItemUtils.getGregtechCircuit(18),
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedGalena", 8),
- ELEMENT.getInstance().CARBON.getDust(32),
- },
- Materials.SulfuricAcid.getFluid(4000),
- ELEMENT.getInstance().SELENIUM.getFluid(144),
- 0,
- 20 * 300,
- 2000);
-
// Ruthenium Roasting
CORE.RA.addBlastSmelterRecipe(
@@ -669,7 +652,7 @@ public class RECIPES_GREGTECH {
0,
20 * 300,
8000);
-
+
// Rhenium Roasting
CORE.RA.addBlastSmelterRecipe(
new ItemStack[] {
@@ -704,7 +687,7 @@ public class RECIPES_GREGTECH {
0,
20 * 300,
4000);
-
+
//Thallium Roasting
CORE.RA.addBlastSmelterRecipe(
new ItemStack[] {
@@ -718,9 +701,28 @@ public class RECIPES_GREGTECH {
0,
20 * 300,
8000);
-
-
-
+
+
+
+ //Strontium processing
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(21),
+ MISC_MATERIALS.STRONTIUM_OXIDE.getDust(8),
+ ELEMENT.getInstance().ALUMINIUM.getDust(8),
+ },
+ null,
+ ELEMENT.getInstance().OXYGEN.getFluid(8000),
+ new ItemStack[] {
+ ELEMENT.getInstance().ALUMINIUM.getIngot(8),
+ ELEMENT.getInstance().STRONTIUM.getIngot(8)
+ },
+ new int[] {10000, 10000}, //Output Chance
+ 20 * 120,
+ 480*4);
+
+
+
}
@@ -733,7 +735,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("sulfuricacid", 250));
-
+
// Hydrofluoric Acid
boolean addedGtExtraction = false;
// Try use Internal GT Fluid first
@@ -751,10 +753,10 @@ public class RECIPES_GREGTECH {
FluidUtils.getFluidStack("hydrofluoricacid", 125), null);
//Add an empty recipe, but only if we didn't for the standard GT HF. Prevents Fluid transformation exploits.
if (!addedGtExtraction)
- GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
- ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 125));
+ GT_Values.RA.addFluidCannerRecipe(ItemUtils.getSimpleStack(ModItems.itemHydrofluoricPotion),
+ ItemUtils.getSimpleStack(Items.glass_bottle), null, FluidUtils.getFluidStack("hydrofluoricacid", 125));
+
-
}
private static void cokeOvenRecipes() {
@@ -893,18 +895,18 @@ public class RECIPES_GREGTECH {
ItemStack cropGrape = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cropGrape", 1);
ItemStack foodRaisins = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1);
-
+
if (cropGrape != null && foodRaisins != null)
- CORE.RA.addDehydratorRecipe(new ItemStack[] {
- cropGrape
- }, // Item
- null, // Fluid input (slot 1)
- null, // Fluid output (slot 2)
- new ItemStack[] {
- foodRaisins
- }, // Output
- new int[] { 0 }, 10, // Time in ticks
- 2); // EU
+ CORE.RA.addDehydratorRecipe(new ItemStack[] {
+ cropGrape
+ }, // Item
+ null, // Fluid input (slot 1)
+ null, // Fluid output (slot 2)
+ new ItemStack[] {
+ foodRaisins
+ }, // Output
+ new int[] { 0 }, 10, // Time in ticks
+ 2); // EU
}
catch (final NullPointerException e) {
@@ -914,7 +916,7 @@ public class RECIPES_GREGTECH {
// Calcium Hydroxide
if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) || LoadedMods.IHL) {
try {
-
+
CORE.RA.addDehydratorRecipe(
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10) }, // Item
FluidUtils.getFluidStack("water", 10000), // Fluid input
@@ -1010,7 +1012,7 @@ public class RECIPES_GREGTECH {
null,
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 9),
FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)
- },
+ },
new int[] { 0 }, 120 * 20, // Time in ticks
500); // EU
@@ -1112,7 +1114,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2) }, // Output
3 * 20, // Time in ticks
30); // EU
-
+
/*
* Try Add custom Recipe for drying leather
*/
@@ -1297,41 +1299,41 @@ public class RECIPES_GREGTECH {
ItemUtils.getSimpleStack(ModItems.itemDetCable, 24),
30,
120);
-
+
/*addAR(ItemUtils.getItemStackOfAmountFromOreDict("plateIncoloy020", 16),
ItemUtils.getItemStackOfAmountFromOreDict("frameGtIncoloyMA956", 4), null,
GregtechItemList.Casing_Power_SubStation.get(4), 80, 120);*/
-
-
-
-
+
+
+
+
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
- GregtechItemList.Casing_Multi_Use.get(1),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8),
- CI.sensor_HV,
- CI.emitter_HV,
- CI.fieldGenerator_HV,
- },
+ GregtechItemList.Casing_Multi_Use.get(1),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 1),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 8),
+ CI.sensor_HV,
+ CI.emitter_HV,
+ CI.fieldGenerator_HV,
+ },
null,
ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame),
20*20,
2048);
-
-
-
-
-
+
+
+
+
+
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(ModItems.itemRope, 6)}, null, ItemUtils.getSimpleStack(ModBlocks.blockNet, 2), 1*20, 8);
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(CI.explosiveITNT, 2), ItemUtils.getSimpleStack(CI.explosiveTNT, 4), ELEMENT.getInstance().SULFUR.getDust(2), ELEMENT.getInstance().IRON.getFrameBox(1)}, null, ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive, 3), 5*20, 60);
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {ItemUtils.getSimpleStack(Items.nether_star), ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 8), ItemUtils.getItemStackOfAmountFromOreDict("stickBlackSteel", 8)}, null, ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard, 32), 30*20, 500);
-
-
+
+
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
CI.electricPump_LV,
@@ -1357,7 +1359,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("stickChrome", 1),
ItemUtils.getItemStackOfAmountFromOreDict("plateStainlessSteel", 2)
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1), 10*20*3, 480);
-
+
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
CI.electricPump_EV,
CI.electricMotor_EV,
@@ -1368,6 +1370,93 @@ public class RECIPES_GREGTECH {
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1), 10*20*4, 1960);
+
+
+
+ //Low tier Charge Packs
+
+ final ItemStack[] aPackBatteries = new ItemStack[] {
+ ItemList.Battery_RE_LV_Lithium.get(GTNH ? 8 : 4),
+ ItemList.Battery_RE_MV_Lithium.get(GTNH ? 8 : 4),
+ ItemList.Battery_RE_HV_Lithium.get(GTNH ? 8 : 4),
+ GregtechItemList.Battery_RE_EV_Lithium.get(GTNH ? 8 : 4),
+ ItemList.Energy_LapotronicOrb.get(GTNH ? 8 : 4),
+ };
+ final ItemStack[] aPackPlates = new ItemStack[] {
+ CI.getPlate(1, GTNH ? 6 : 3),
+ CI.getPlate(2, GTNH ? 12 : 6),
+ CI.getPlate(3, GTNH ? 18 : 9),
+ CI.getPlate(4, GTNH ? 24 : 12),
+ CI.getPlate(5, GTNH ? 30 : 15),
+ };
+ final ItemStack[] aPackWire = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.wireGt02, 1, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.wireGt04, 2, GTNH ? 16 : 8),
+ CI.getTieredComponent(OrePrefixes.wireGt08, 3, GTNH ? 14 : 7),
+ CI.getTieredComponent(OrePrefixes.wireGt12, 4, GTNH ? 12 : 6),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 12 : 6),
+ };
+ final ItemStack[] aPackCircuit = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.circuit, 1, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 4 : 2),
+ CI.getTieredComponent(OrePrefixes.circuit, 3, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 4, GTNH ? 8 : 4),
+ CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 12 : 6),
+ };
+ final ItemStack[] aPackRing = new ItemStack[] {
+ CI.getTieredComponent(OrePrefixes.ring, 1, GTNH ? 20 : 10),
+ CI.getTieredComponent(OrePrefixes.ring, 2, GTNH ? 20 : 10),
+ CI.getTieredComponent(OrePrefixes.ring, 3, GTNH ? 20 : 10),
+ CI.getTieredComponent(OrePrefixes.ring, 4, GTNH ? 20 : 10),
+ CI.getTieredComponent(OrePrefixes.ring, 5, GTNH ? 20 : 10),
+ };
+ final ItemStack[] aPackOutput = new ItemStack[] {
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_1),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_2),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_3),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_4),
+ ItemUtils.getSimpleStack(ModItems.itemChargePack_Low_5)
+ };
+
+ for (int i = 1; i < 6; i++) {
+
+ int aAS = i-1;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aPackPlates[aAS],
+ aPackRing[aAS],
+ aPackWire[aAS],
+ aPackCircuit[aAS],
+ aPackBatteries[aAS],
+ CI.getSensor(i, GTNH ? 4 : 2),
+ },
+ CI.getTieredFluid(i, (144 * (GTNH ? 4 : 2))),
+ aPackOutput[aAS],
+ 30 * 20 * i,
+ (int) GT_Values.V[i]);
+ }
+
+
+ if (!GTNH) {
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.WroughtIron, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 2L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Bronze, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 2L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Brass, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 2L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plateDouble, Materials.Invar, 1L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 2L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
+
+ } else {
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.WroughtIron, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.WroughtIron, 4L), GregtechItemList.Fluid_Cell_1L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Bronze, 4L), GregtechItemList.Fluid_Cell_16L.get(1L, new Object[0]), 50, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Brass, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Brass, 4L), GregtechItemList.Fluid_Cell_36L.get(1L, new Object[0]), 75, 32);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
+ }
+ }
+
+
+
+
+
}
private static boolean addAR(final ItemStack inputA, final ItemStack inputB, final FluidStack inputFluidA,
@@ -1467,14 +1556,14 @@ public class RECIPES_GREGTECH {
NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 10000, 150, 2000);
GT_Values.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), null,
NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 10000, 200, 1500);
-
+
//ZIRCONIUM_TETRAFLUORIDE
GT_Values.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), null,
FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 10000, 200, 512+256);
-
-
-
-/* GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ZrF4U235", 1), null,
+
+
+
+ /* GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ZrF4U235", 1), null,
FluidUtils.getFluidStack("molten.libef2zrf4u235", 144), 10000, 250, 1000);
//LFTR Fuel 2
GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ZrF4UF4", 1), null,
@@ -1516,10 +1605,10 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("dustSmallThorium", 20),
ELEMENT.getInstance().URANIUM232.getDust(1), GT_Values.NI, GT_Values.NI, GT_Values.NI,
new int[] { 0, 0, 10 }, 500 * 20, 2000);
-
+
//Process Used Fuel Rods for Krypton
-
+
//Uranium
GT_Values.RA.addCentrifugeRecipe(
CI.getNumberedCircuit(20),
@@ -1546,7 +1635,7 @@ public class RECIPES_GREGTECH {
ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1),
ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1),
new int[] { 0, 0, 500, 500, 500, 500 }, 750 * 20, 4000);
-
+
//Thorium
GT_Values.RA.addCentrifugeRecipe(
CI.getNumberedCircuit(20),
@@ -1560,8 +1649,8 @@ public class RECIPES_GREGTECH {
ELEMENT.getInstance().POLONIUM.getSmallDust(1),
ELEMENT.getInstance().THALLIUM.getTinyDust(1),
new int[] { 0, 0, 5000, 5000, 5000, 2500 }, 250 * 20, 4000);
-
-
+
+
}
@@ -1615,7 +1704,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16), FluidUtils.getFluidStack("water", 1000),
FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4),
CI.emptyCells(1), 300 * 20);
-
+
//Bombs
GT_Values.RA.addChemicalRecipe(
ItemUtils.getSimpleStack(ModItems.itemBombCasing, 4),
@@ -1624,7 +1713,7 @@ public class RECIPES_GREGTECH {
null,
ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
300 * 20);
-
+
GT_Values.RA.addChemicalRecipe(
ItemUtils.getSimpleStack(ModItems.itemBombUnf, 4),
ItemUtils.getSimpleStack(ModItems.itemDetCable, 4),
@@ -1632,7 +1721,7 @@ public class RECIPES_GREGTECH {
null,
ItemUtils.getSimpleStack(ModItems.itemBomb, 4),
10 * 20);
-
+
// LFTR Fuel Related Compounds
if (GTNH) {
@@ -1697,32 +1786,32 @@ public class RECIPES_GREGTECH {
CI.emptyCells(7),
2 * 20);
}
-
-
+
+
//Technetium
GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1), null,
FluidUtils.getFluidStack("sulfuricacid", 1000), FluidUtils.getFluidStack("sulfuricacid", 144 * 2),
ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1), 100 * 20);
-
+
}
private static void blastFurnaceRecipes() {
- //public boolean addBlastRecipe(
+ //public boolean addBlastRecipe(
//ItemStack aInput1, ItemStack aInput2,
//FluidStack aFluidInput, FluidStack aFluidOutput,
//ItemStack aOutput1, ItemStack aOutput2,
//int aDuration, int aEUt, int aLevel)
-
+
GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2),
ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), GT_Values.NF, GT_Values.NF,
ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), null, 60 * 20, 2000, 3000);
GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1), null, GT_Values.NF,
GT_Values.NF, ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 1), null, 60 * 20, 340, 300);
-
-
+
+
//Synthetic Graphite
GT_Values.RA.addBlastRecipe(
CI.getNumberedCircuit(22),
@@ -1734,7 +1823,7 @@ public class RECIPES_GREGTECH {
60 * 20,
MaterialUtils.getVoltageForTier(GTNH ? 5 : 4),
4500);
-
+
//Bomb Casings
GT_Values.RA.addBlastRecipe(
GregtechItemList.Bomb_Cast.get(4),
@@ -1746,7 +1835,7 @@ public class RECIPES_GREGTECH {
4 * 60 * 20,
MaterialUtils.getVoltageForTier(GTNH ? 3 : 2),
2800);
-
+
//Krypton Processing
if (ModItems.itemHotTitaniumIngot != null) {
GT_Values.RA.addBlastRecipe(
@@ -1760,8 +1849,8 @@ public class RECIPES_GREGTECH {
500,
Materials.Titanium.mBlastFurnaceTemp);
}
-
-
+
+
}
private static void autoclaveRecipes() {
@@ -1785,7 +1874,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("plateMeatRaw", 1));
GT_ModHandler.addCompressionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9),
ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1));
-
+
CORE.RA.addCompressorRecipe(ItemList.FusionComputer_UV.get(9), GregtechItemList.Compressed_Fusion_Reactor.get(1), (int) GT_Values.V[7], (int) GT_Values.V[8]);
}
@@ -1861,13 +1950,13 @@ public class RECIPES_GREGTECH {
CORE.RA.addCyclotronRecipe(new ItemStack[] {ELEMENT.getInstance().URANIUM238.getDust(1) }, FluidUtils.getFluidStack("deuterium", 400),
new ItemStack[] {ItemUtils.getSimpleStack(ModItems.dustNeptunium238)}, null, new int[] { 500 }, 20 * 5, 500 * 4,
500 * 20); //PO Special Value
-
-
+
+
/**
* Particle Science
*/
-
+
// Quark Smash
CORE.RA.addCyclotronRecipe(
CI.getNumberedCircuit(3),
@@ -1879,7 +1968,7 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.STRANGE),
Particle.getBaseParticle(Particle.TOP),
Particle.getBaseParticle(Particle.BOTTOM),
- },
+ },
null,
new int[] { 50, 50, 50, 50, 50, 50 },
20 * 300 * 9,
@@ -1897,7 +1986,7 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.ELECTRON_NEUTRINO),
Particle.getBaseParticle(Particle.MUON_NEUTRINO),
Particle.getBaseParticle(Particle.TAU_NEUTRINO),
- },
+ },
null,
new int[] { 600, 40, 20, 15, 10, 5 },
20 * 300 * 8,
@@ -1914,14 +2003,14 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.Z_BOSON),
Particle.getBaseParticle(Particle.W_BOSON),
Particle.getBaseParticle(Particle.HIGGS_BOSON),
- },
+ },
null,
new int[] { 160, 260, 150, 150, 1 },
20 * 300 * 6,
(int) GT_Values.V[7],
750 * 20);
-
-
+
+
// Mixed Smash 1
CORE.RA.addCyclotronRecipe(
CI.getNumberedCircuit(12),
@@ -1935,13 +2024,13 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.LAMBDA),
Particle.getBaseParticle(Particle.OMEGA),
Particle.getBaseParticle(Particle.HIGGS_BOSON),
- },
+ },
null,
new int[] { 10, 20, 20, 10, 10, 5, 5, 2 },
17 * 247 * 32,
(int) GT_Values.V[8],
750 * 20);
-
+
// Graviton Smash
CORE.RA.addCyclotronRecipe(
CI.getNumberedCircuit(15),
@@ -1949,20 +2038,20 @@ public class RECIPES_GREGTECH {
new ItemStack[] {
Particle.getBaseParticle(Particle.GRAVITON),
Particle.getBaseParticle(Particle.UNKNOWN)
- },
+ },
null,
new int[] {15, 100},
20 * (GTNH ? 90 : 30),
(int) GT_Values.V[6],
1000 * 20);
-
+
FluidStack aPlasma = Materials.Duranium.getMolten(GTNH ? 40 : 10);
FluidStack aPlasma_NULL = Materials._NULL.getPlasma(1);
-
+
if (aPlasma == null || aPlasma.isFluidEqual(aPlasma_NULL)) {
aPlasma = Materials.Americium.getMolten(GTNH ? 20 : 5);
}
-
+
// Quantum Anomaly
CORE.RA.addCyclotronRecipe(
new ItemStack[] {
@@ -1972,17 +2061,17 @@ public class RECIPES_GREGTECH {
aPlasma,
new ItemStack[] {
GregtechItemList.Laser_Lens_Special.get(1)
- },
+ },
null,
new int[] {100},
20 * (GTNH ? 300 : 60),
(int) GT_Values.V[6],
1000 * 20);
-
+
/*
* Ions
*/
-
+
int IonCount = 2;
int tenCountA = (GTNH ? 2 : 1);
int tenCountB = 0;
@@ -1993,33 +2082,33 @@ public class RECIPES_GREGTECH {
FluidStack aPlasma2 = FluidUtils.getFluidStack("plasma."+y.toLowerCase(), 2);
Materials aTestMat = MaterialUtils.getMaterial(y);
FluidStack aPlasma3 = aTestMat != null ? aTestMat.getPlasma(2) : aPlasma2;
-
+
// Ionize Plasma
if ((aPlasma2 != null && !aPlasma2.isFluidEqual(aPlasma_NULL)) || (aPlasma3 != null && !aPlasma3.isFluidEqual(aPlasma_NULL))) {
- CORE.RA.addCyclotronRecipe(
- CI.getNumberedCircuit(1+(tenCountA-1)),
- aPlasma2 != null ? aPlasma2 : aPlasma3,
- new ItemStack[] {
- Particle.getIon(y, 1),
- Particle.getIon(y, 2),
- Particle.getIon(y, 3),
- Particle.getIon(y, -1),
- Particle.getIon(y, -2),
- Particle.getIon(y, -3),
- Particle.getIon(y, 1),
- Particle.getIon(y, 2),
- Particle.getIon(y, -1),
- },
- null,
- new int[] { 275, 250, 225, 275, 250, 225, 275, 250, 275},
- 20 * 20 * (IonCount++) * tenCountA,
- (int) GT_Values.V[7],
- 1500 * 20 * tenCountA);
+ CORE.RA.addCyclotronRecipe(
+ CI.getNumberedCircuit(1+(tenCountA-1)),
+ aPlasma2 != null ? aPlasma2 : aPlasma3,
+ new ItemStack[] {
+ Particle.getIon(y, 1),
+ Particle.getIon(y, 2),
+ Particle.getIon(y, 3),
+ Particle.getIon(y, -1),
+ Particle.getIon(y, -2),
+ Particle.getIon(y, -3),
+ Particle.getIon(y, 1),
+ Particle.getIon(y, 2),
+ Particle.getIon(y, -1),
+ },
+ null,
+ new int[] { 275, 250, 225, 275, 250, 225, 275, 250, 275},
+ 20 * 20 * (IonCount++) * tenCountA,
+ (int) GT_Values.V[7],
+ 1500 * 20 * tenCountA);
}
else {
Logger.INFO("Plasma for "+y+" does not exist, please report this to Alkalus.");
}
-
+
if (tenCountB == 12) {
tenCountB = 0;
tenCountA++;
@@ -2028,7 +2117,7 @@ public class RECIPES_GREGTECH {
tenCountB++;
}
}
-
+
// Generate Hydrogen Ion Recipe
CORE.RA.addCyclotronRecipe(
CI.getNumberedCircuit(24),
@@ -2043,19 +2132,19 @@ public class RECIPES_GREGTECH {
Particle.getIon("Hydrogen", -1),
Particle.getIon("Hydrogen", -2),
Particle.getIon("Hydrogen", -3)
- },
+ },
null,
new int[] { 125, 125, 125, 125, 125, 125, 125, 125, 125 },
20 * 20,
(int) GT_Values.V[6],
15000);
-
+
// Generate Hydrogen Plasma Recipe
CORE.RA.addCyclotronRecipe(
new ItemStack[] {
Particle.getIon("Hydrogen", 0),
ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1)
- },
+ },
null,
new ItemStack[] {
Particle.getBaseParticle(Particle.PROTON),
@@ -2065,20 +2154,20 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.UNKNOWN),
Particle.getBaseParticle(Particle.UNKNOWN),
CI.emptyCells(1)
- },
+ },
FluidUtils.getFluidStack("plasma.hydrogen", 1),
new int[] { 250, 250, 250, 500, 500, 500, 10000 },
20 * 60 * 2,
(int) GT_Values.V[7],
750 * 20);
-
+
// Generate Protons Easily
CORE.RA.addCyclotronRecipe(
new ItemStack[] {
CI.getNumberedCircuit(20),
Particle.getIon("Hydrogen", 0)
- },
+ },
FluidUtils.getWildcardFluidStack("hydrogen", 100),
new ItemStack[] {
Particle.getBaseParticle(Particle.PROTON),
@@ -2090,18 +2179,18 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.PROTON),
Particle.getBaseParticle(Particle.PROTON),
Particle.getBaseParticle(Particle.PROTON),
- },
+ },
null,
new int[] { 750, 750, 750, 750, 750, 750, 750, 750, 750 },
20 * 20,
(int) GT_Values.V[6],
15000);
-
+
CORE.RA.addCyclotronRecipe(
new ItemStack[] {
CI.getNumberedCircuit(22),
Particle.getBaseParticle(Particle.UNKNOWN),
- },
+ },
FluidUtils.getWildcardFluidStack("hydrogen", 100),
new ItemStack[] {
Particle.getBaseParticle(Particle.PROTON),
@@ -2113,14 +2202,14 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.PROTON),
Particle.getBaseParticle(Particle.PROTON),
Particle.getBaseParticle(Particle.PROTON),
- },
+ },
null,
new int[] { 375, 375, 375, 375, 375, 375, 375, 375, 375 },
20 * 20,
(int) GT_Values.V[6],
15000);
-
-
+
+
//Create Strange Dust
CORE.RA.addCyclotronRecipe(
new ItemStack[] {
@@ -2133,20 +2222,20 @@ public class RECIPES_GREGTECH {
Particle.getBaseParticle(Particle.UNKNOWN),
Particle.getBaseParticle(Particle.UNKNOWN),
Particle.getBaseParticle(Particle.UNKNOWN),
- },
+ },
FluidUtils.getFluidStack(FluidUtils.getWildcardFluidStack("ender", 1000), 1000),
new ItemStack[] {
ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT.getDust(1)
- },
+ },
null,
new int[] { 2500 },
20 * 60 * 15,
(int) GT_Values.V[7],
15000);
-
-
-
-
+
+
+
+
}
@@ -2161,12 +2250,15 @@ public class RECIPES_GREGTECH {
ELEMENT.getInstance().CERIUM.getSmallDust(1),
ELEMENT.getInstance().CADMIUM.getSmallDust(1),
ELEMENT.getInstance().CAESIUM.getSmallDust(1),
- ELEMENT.getInstance().YTTERBIUM.getTinyDust(1),
- ELEMENT.getInstance().SAMARIUM.getTinyDust(1),
- ELEMENT.getInstance().GADOLINIUM.getTinyDust(1)
- },
- new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 1000, 1000, 1000 }, 20 * 30, 500);
-
+ ORES.SAMARSKITE_YB.getSmallDust(1),
+ ORES.FLORENCITE.getSmallDust(1),
+ ORES.FLUORCAPHITE.getSmallDust(1),
+ //ELEMENT.getInstance().YTTERBIUM.getTinyDust(1),
+ //ELEMENT.getInstance().SAMARIUM.getTinyDust(1),
+ //ELEMENT.getInstance().GADOLINIUM.getTinyDust(1)
+ },
+ new int[] { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 30, 500);
+
// Zirconium
GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1),
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1),
@@ -2176,7 +2268,7 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) },
new int[] { 5000, 2500, 1000, 1000, 300, 300 }, 20 * 30, 500);
-
+
// Zirconium
GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1),
new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1),
@@ -2247,38 +2339,38 @@ public class RECIPES_GREGTECH {
ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1),
ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), new int[] { 10000, 1250, 2500 },
20 * 20, 24);
-
-
+
+
if (!GTNH) {
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedNaquadah", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallNaquadahEnriched", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
- 20 * 20, 24);
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedNaquadah", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustNaquadah", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallNaquadahEnriched", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
+ 20 * 20, 24);
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallOsmium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
- 20 * 20, 24);
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIridium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustIridium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallOsmium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 2500, 5000 },
+ 20 * 20, 24);
- // Trinium
- GT_Values.RA.addElectromagneticSeparatorRecipe(
- ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedWulfenite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustWulfenite", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 3000, 3000 },
- 20 * 20, 24);
+ // Trinium
+ GT_Values.RA.addElectromagneticSeparatorRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedWulfenite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustWulfenite", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTrinium", 1), new int[] { 10000, 3000, 3000 },
+ 20 * 20, 24);
}
-
-
-
-
+
+
+
+
}
private static void advancedMixerRecipes() {
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index bfd50e0ce1..52a6c4889e 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -221,6 +221,9 @@ public class RECIPES_Machines {
energyCores();
wirelessChargers();
largeArcFurnace();
+ industrialVacuumFurnace();
+ fakeMachineCasingCovers();
+ superBuses();
}
private static void initModItems(){
@@ -1031,25 +1034,25 @@ public class RECIPES_Machines {
if (CORE.ConfigSwitches.enableMultiblock_ThermalBoiler){
RECIPE_ThermalBoilerController = GregtechItemList.GT4_Thermal_Boiler.get(1);
- RECIPE_ThermalBoilerCasing = GregtechItemList.Casing_ThermalContainment.get(4);
- ItemStack centrifugeHV = ItemList.Machine_HV_Centrifuge.get(1);
+ RECIPE_ThermalBoilerCasing = GregtechItemList.Casing_ThermalContainment.get(GTNH ? 1 : 2);
+ ItemStack centrifugeHV = GTNH ? ItemList.Machine_IV_Centrifuge.get(1) : ItemList.Machine_EV_Centrifuge.get(1);
RecipeUtils.addShapedGregtechRecipe(
"craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- "gearGtTitanium", "circuitElite", "gearGtTitanium",
+ "gearGtTitanium", CI.getTieredCircuitOreDictName(6), "gearGtTitanium",
"craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
RECIPE_ThermalBoilerController);
RecipeUtils.addShapedGregtechRecipe(
"craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
- "gearGtTungstenSteel", "circuitElite", "gearGtTungstenSteel",
+ "gearGtTungstenSteel", CI.getTieredCircuitOreDictName(5), "gearGtTungstenSteel",
"craftingGeothermalGenerator", centrifugeHV, "craftingGeothermalGenerator",
RECIPE_ThermalBoilerController);
RecipeUtils.addShapedGregtechRecipe(
- "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel",
+ ALLOY.MARAGING350.getPlate(1), "plateStainlessSteel", ALLOY.MARAGING350.getPlate(1),
"circuitAdvanced", CI.machineCasing_HV, "circuitAdvanced",
- "plateStainlessSteel", "plateStainlessSteel", "plateStainlessSteel",
+ ALLOY.MARAGING350.getPlate(1), ALLOY.MARAGING350.getPlate(1), ALLOY.MARAGING350.getPlate(1),
RECIPE_ThermalBoilerCasing);
//Lava Filter Recipe
@@ -2022,4 +2025,146 @@ public class RECIPES_Machines {
60 * 20 * 8,
MaterialUtils.getVoltageForTier(6));
}
+
+ private static void industrialVacuumFurnace() {
+ int aCostMultiplier = GTNH ? 2 : 1;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
+ CI.getHeatCoil(2),
+ CI.getElectricPiston(3, 2 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 6, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.gearGt, 6, 2 * aCostMultiplier),
+ },
+ CI.getTertiaryTieredFluid(5, (144 * 2 * 4 * aCostMultiplier)), //Input Fluid
+ GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount),
+ 20 * 10 * 6,
+ MaterialUtils.getVoltageForTier(6));
+
+ ;
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ GregtechItemList.Casing_Vacuum_Furnace.get(Casing_Amount),
+ CI.getTieredComponent(OrePrefixes.wireGt16, 7, 4 * aCostMultiplier),
+ CI.getEnergyCore(6, 1 * aCostMultiplier),
+ CI.getRobotArm(4, 4 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.plate, 7, 8 * aCostMultiplier),
+ CI.getTieredComponent(OrePrefixes.circuit, 6, 8 * aCostMultiplier),
+ },
+ CI.getTieredFluid(7, (144 * 4 * 5 * aCostMultiplier)), //Input Fluid
+ GregtechItemList.Controller_Vacuum_Furnace.get(1),
+ 60 * 20 * 12,
+ MaterialUtils.getVoltageForTier(7));
+ }
+
+ private static void fakeMachineCasingCovers() {
+ GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] {
+ GregtechItemList.FakeMachineCasingPlate_ULV,
+ GregtechItemList.FakeMachineCasingPlate_LV,
+ GregtechItemList.FakeMachineCasingPlate_MV,
+ GregtechItemList.FakeMachineCasingPlate_HV,
+ GregtechItemList.FakeMachineCasingPlate_EV,
+ GregtechItemList.FakeMachineCasingPlate_IV,
+ GregtechItemList.FakeMachineCasingPlate_LuV,
+ GregtechItemList.FakeMachineCasingPlate_ZPM,
+ GregtechItemList.FakeMachineCasingPlate_UV,
+ GregtechItemList.FakeMachineCasingPlate_MAX,
+ };
+ for (int i = 0;i<10;i++) {
+ GT_Values.RA.addCutterRecipe(
+ CI.getTieredMachineCasing(i),
+ mMachineCasingCovers[i].get(5),
+ null,
+ 20 * 5 * i,
+ (int) GT_Values.V[i]);
+ }
+ }
+
+ private static void superBuses() {
+ GregtechItemList[] mSuperBusesInput = new GregtechItemList[] {
+ GregtechItemList.Hatch_SuperBus_Input_ULV,
+ GregtechItemList.Hatch_SuperBus_Input_LV,
+ GregtechItemList.Hatch_SuperBus_Input_MV,
+ GregtechItemList.Hatch_SuperBus_Input_HV,
+ GregtechItemList.Hatch_SuperBus_Input_EV,
+ GregtechItemList.Hatch_SuperBus_Input_IV,
+ GregtechItemList.Hatch_SuperBus_Input_LuV,
+ GregtechItemList.Hatch_SuperBus_Input_ZPM,
+ GregtechItemList.Hatch_SuperBus_Input_UV,
+ GregtechItemList.Hatch_SuperBus_Input_MAX,
+ };
+
+ GregtechItemList[] mSuperBusesOutput = new GregtechItemList[] {
+ GregtechItemList.Hatch_SuperBus_Output_ULV,
+ GregtechItemList.Hatch_SuperBus_Output_LV,
+ GregtechItemList.Hatch_SuperBus_Output_MV,
+ GregtechItemList.Hatch_SuperBus_Output_HV,
+ GregtechItemList.Hatch_SuperBus_Output_EV,
+ GregtechItemList.Hatch_SuperBus_Output_IV,
+ GregtechItemList.Hatch_SuperBus_Output_LuV,
+ GregtechItemList.Hatch_SuperBus_Output_ZPM,
+ GregtechItemList.Hatch_SuperBus_Output_UV,
+ GregtechItemList.Hatch_SuperBus_Output_MAX,
+ };
+
+ ItemStack[] mInputHatch = new ItemStack[] {
+ ItemList.Hatch_Input_Bus_EV.get(1),
+ ItemList.Hatch_Input_Bus_IV.get(1),
+ ItemList.Hatch_Input_Bus_LuV.get(1),
+ ItemList.Hatch_Input_Bus_ZPM.get(1),
+ ItemList.Hatch_Input_Bus_UV.get(1),
+ ItemList.Hatch_Input_Bus_MAX.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_ULV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_LV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_MV.get(1),
+ GregtechItemList.Hatch_SuperBus_Input_HV.get(1),
+ };
+
+ ItemStack[] mOutputHatch = new ItemStack[] {
+ ItemList.Hatch_Output_Bus_EV.get(1),
+ ItemList.Hatch_Output_Bus_IV.get(1),
+ ItemList.Hatch_Output_Bus_LuV.get(1),
+ ItemList.Hatch_Output_Bus_ZPM.get(1),
+ ItemList.Hatch_Output_Bus_UV.get(1),
+ ItemList.Hatch_Output_Bus_MAX.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_ULV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_LV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_MV.get(1),
+ GregtechItemList.Hatch_SuperBus_Output_HV.get(1),
+ };
+
+ //Input Buses
+ for (int i = 0; i < 10; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ CI.getNumberedCircuit(16),
+ mInputHatch[i],
+ CI.getElectricMotor(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getGear(i, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ },
+ CI.getAlternativeTieredFluid(i, 144 * 8),
+ mSuperBusesInput[i].get(1), 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+ }
+ //Output Buses
+ for (int i = 0; i < 10; i++) {
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ CI.getNumberedCircuit(18),
+ mOutputHatch[i],
+ CI.getElectricPiston(i, GTNH ? 8 : 2),
+ CI.getConveyor(i, GTNH ? 10 : 5),
+ CI.getGear(i, GTNH ? 6 : 3),
+ CI.getTieredComponent(OrePrefixes.circuit, i, GTNH ? 4 : 2)
+ },
+ CI.getTertiaryTieredFluid(i, 144 * 8),
+ mSuperBusesOutput[i].get(1), 20 * 30 * 2 * i,
+ (int) GT_Values.V[i]);
+ }
+
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
new file mode 100644
index 0000000000..471a3cc33e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java
@@ -0,0 +1,217 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.MISC_MATERIALS;
+import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.reflect.AddGregtechRecipe;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_SeleniumProcessing {
+
+ public static void init() {
+
+ //We need this
+ MaterialUtils.generateSpecialDustAndAssignToAMaterial(MISC_MATERIALS.SELENIUM_DIOXIDE);
+
+ // Makes Selenium Dioxide
+ processCopperRecipes();
+
+ //Liquify the Dried Dioxide
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(1000), 20, 1024);
+
+ // Produce Selenious Acid
+ AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluid(1000), 20, 2048);
+
+ // Make Selenium
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(14),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8),
+ ELEMENT.getInstance().CARBON.getDust(16),
+ },
+ MISC_MATERIALS.SELENIOUS_ACID.getFluid(750),
+ ELEMENT.getInstance().SELENIUM.getFluid(144 * 1),
+ new ItemStack[] {
+ CI.emptyCells(8),
+ ELEMENT.getInstance().SELENIUM.getIngot(1),
+ ELEMENT.getInstance().SELENIUM.getIngot(1),
+ },
+ new int[] {10000, 2000, 2000},
+ 20 * 300,
+ 7200);
+
+
+ /*// Old recipes for Selenium Roasting
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(16),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPyrite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(4000),
+ ELEMENT.getInstance().SELENIUM.getFluid(144),
+ 0,
+ 20 * 300,
+ 2000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(17),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedChalcopyrite", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(4000),
+ ELEMENT.getInstance().SELENIUM.getFluid(144),
+ 0,
+ 20 * 300,
+ 2000);
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ItemUtils.getGregtechCircuit(18),
+ ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedGalena", 8),
+ ELEMENT.getInstance().CARBON.getDust(32),
+ },
+ Materials.SulfuricAcid.getFluid(4000),
+ ELEMENT.getInstance().SELENIUM.getFluid(144),
+ 0,
+ 20 * 300,
+ 2000);*/
+ }
+
+
+ public static void processCopperRecipes() {
+
+ //Copper
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(20), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {
+ 10000,
+ 100,
+ 100,
+ 500,
+ 500,
+ 500,
+ 1000,
+ 1000,
+ 1000
+ },
+ 40 * 20, // Time in ticks
+ 1024); // EU
+
+
+ //Tetra
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {
+ 10000,
+ 100,
+ 100,
+ 300,
+ 300,
+ 300,
+ 800,
+ 800,
+ 800
+ },
+ 40 * 20, // Time in ticks
+ 1024); // EU
+ //Chalco
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {
+ 10000,
+ 100,
+ 100,
+ 300,
+ 300,
+ 300,
+ 800,
+ 800,
+ 800
+ },
+ 40 * 20, // Time in ticks
+ 1024); // EU
+ //Malachite
+ CORE.RA.addDehydratorRecipe(
+ new ItemStack[]{
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1), // Item Input
+ },
+ FluidUtils.getHotWater(1000), // Fluid
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid
+ new ItemStack[] {
+ ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1),
+ }, // Output
+ new int[] {
+ 10000,
+ 100,
+ 100,
+ 300,
+ 300,
+ 300,
+ 800,
+ 800,
+ 800
+ },
+ 40 * 20, // Time in ticks
+ 1024); // EU
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index dffb438e4a..a9f336d19c 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -17,6 +17,7 @@ import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.eio.material.MaterialEIO;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import ic2.core.Ic2Items;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -574,7 +575,7 @@ public class CI {
private static final Material[] aMaterial_Tertiary = new Material[] {
ALLOY.STEEL,
ELEMENT.getInstance().ALUMINIUM,
- ALLOY.STAINLESSSTEEL,
+ ALLOY.STAINLESS_STEEL,
ELEMENT.getInstance().TUNGSTEN,
ALLOY.HASTELLOY_N,
ALLOY.ENERGYCRYSTAL,
@@ -1201,4 +1202,28 @@ public class CI {
return ItemUtils.getSimpleStack(aType, aSize);
}
+ public static ItemStack getHeatCoil(int i) {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ if (i == 1) {
+ return ItemList.Casing_Coil_Kanthal.get(1);
+ } else if (i == 2) {
+ return ItemList.Casing_Coil_Nichrome.get(1);
+ } else {
+ return ItemList.Casing_Coil_Cupronickel.get(1);
+ }
+ } else {
+ if (!CORE.GTNH) {
+ if (i > 6) {
+ i = 6;
+ }
+ } else {
+ if (i > 8) {
+ i = 8;
+ }
+ }
+ return ItemUtils.simpleMetaStack(StaticFields59.getBlockCasings5(), i, 1);
+ }
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotAirFilter.java b/src/Java/gtPlusPlus/core/slots/SlotAirFilter.java
new file mode 100644
index 0000000000..92e9bebe21
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotAirFilter.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.core.slots;
+
+import gtPlusPlus.core.item.general.ItemAirFilter;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotAirFilter extends Slot {
+
+ public SlotAirFilter(final IInventory inventory, final int slot, final int x, final int y) {
+ super(inventory, slot, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (itemstack == null) {
+ return false;
+ }
+ if (itemstack.getItem() instanceof ItemAirFilter){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
index 3cef3c511f..bda722b47e 100644
--- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -7,6 +7,7 @@ import gregtech.api.enums.GT_Values;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
@@ -227,7 +228,7 @@ public class MathUtils {
* @param x Value A.
* @return boolean Whether or not it divides evenly.
*/
- public static boolean isNumberEven(final int x){
+ public static boolean isNumberEven(final long x){
if ((x % 2) == 0)
{
return true;
@@ -696,5 +697,11 @@ public class MathUtils {
int aAmount = Math.max(Math.min(i, aMax), aMin);
return aAmount;
}
+
+ public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong){
+ int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong/Integer.MAX_VALUE));
+ int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE));
+ return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/EnergyUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
index ef68436f21..7daefbcc23 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/EnergyUtils.java
@@ -1,9 +1,7 @@
package gtPlusPlus.core.util.minecraft;
-import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
-import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
import ic2.api.item.ISpecialElectricItem;
@@ -40,7 +38,7 @@ public class EnergyUtils {
if (isElectricItem(aStack)) {
int tTier = ((IElectricItem) aStack.getItem()).getTier(aStack);
int aDischargeValue = GT_ModHandler.dischargeElectricItem(aStack, aEnergyToDrain, tTier, true, false, false);
- Logger.INFO("Trying to drain "+aDischargeValue);
+ //Logger.INFO("Trying to drain "+aDischargeValue);
return aDischargeValue > 0;
}
else {
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java
index 8c5a9f6581..49aa3a1306 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/EntityUtils.java
@@ -11,6 +11,7 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.AABB;
import gtPlusPlus.api.objects.minecraft.BlockPos;
+import gtPlusPlus.core.handler.events.EntityDeathHandler;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import ic2.core.IC2Potion;
import ic2.core.item.armor.ItemArmorHazmat;
@@ -20,6 +21,7 @@ import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
@@ -87,7 +89,7 @@ public class EntityUtils {
}
return false;
}
-
+
public static boolean applyHeatDamageToEntity(final int heatLevel, final World world, final Entity entityHolding){
if (!world.isRemote){
if ((heatLevel > 0) && (entityHolding instanceof EntityLivingBase)) {
@@ -113,11 +115,7 @@ public class EntityUtils {
*/
public synchronized static boolean doFireDamage(Entity entity, int amount){
if (dealFireDamage == null){
- try {
- dealFireDamage = Entity.class.getDeclaredMethod("dealFireDamage", int.class);
- dealFireDamage.setAccessible(true);
- }
- catch (NoSuchMethodException | SecurityException e) {}
+ dealFireDamage = ReflectionUtils.getMethod(Entity.class, "dealFireDamage", int.class);
}
else {
try {
@@ -131,42 +129,41 @@ public class EntityUtils {
public static void doDamage(Entity entity, DamageSource dmg, int i) {
entity.attackEntityFrom(dmg, i);
}
-
+
public static boolean isTileEntityRegistered(Class aTileClass, String aTileName) {
Field aRegistry = ReflectionUtils.getField(ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "nameToClassMap");
Field aRegistry2 = ReflectionUtils.getField(ReflectionUtils.getClass("net.minecraft.tileentity.TileEntity"), "classToNameMap");
try {
Object o = aRegistry.get(null);
if (o != null) {
- Map nameToClassMap = (Map) o;
- if (!nameToClassMap.containsKey(aTileName)) {
- o = aRegistry2.get(null);
- if (o != null) {
- Map classToNameMap = (Map) o;
- if (!classToNameMap.containsKey(aTileClass)) {
- return false;
- }
- else {
- return true;
- }
- }
- }
- else {
- return true;
- }
+ Map nameToClassMap = (Map) o;
+ if (!nameToClassMap.containsKey(aTileName)) {
+ o = aRegistry2.get(null);
+ if (o != null) {
+ Map classToNameMap = (Map) o;
+ if (!classToNameMap.containsKey(aTileClass)) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+ }
+ else {
+ return true;
+ }
}
} catch (IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return false;
}
-
+
public static double getDistance(Entity p1, Entity p2) {
- return Math.sqrt( Math.pow(p1.posX - p2.posX, 2) + Math.pow(p1.posY - p2.posY, 2) + Math.pow(p1.posZ - p2.posZ, 2));
+ return Math.sqrt( Math.pow(p1.posX - p2.posX, 2) + Math.pow(p1.posY - p2.posY, 2) + Math.pow(p1.posZ - p2.posZ, 2));
}
-
+
public static AutoMap<Entity> getEntitiesWithinBoundingBoxExcluding(Entity aExclusion, AABB aBoundingBox){
-
if (aExclusion == null) {
return new AutoMap<Entity>();
}
@@ -175,9 +172,8 @@ public class EntityUtils {
return new AutoMap<Entity>(aEntities);
}
}
-
+
public static AutoMap<Entity> getEntitiesWithinBoundingBox(Class aEntityType, AABB aBoundingBox){
-
if (aEntityType == null) {
return new AutoMap<Entity>();
}
@@ -186,5 +182,26 @@ public class EntityUtils {
return new AutoMap<Entity>(aEntities);
}
}
+
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects. Simplified function with static Max drop size of 1.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aChance) {
+ registerDropsForMob(aMobClass, aStack, 1, aChance);
+ }
+
+ /**
+ * Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
+ * @param aMobClass - The Base Class you want to drop this item.
+ * @param aStack - The ItemStack, stack size is not respected.
+ * @param aMaxAmount - The maximum size of the ItemStack which drops.
+ * @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
+ */
+ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
+ EntityDeathHandler.registerDropsForMob(aMobClass, aStack, aMaxAmount, aChance);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index 0ae751a20b..09263bb639 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -25,14 +25,64 @@ public class FluidUtils {
return FluidUtils.getFluidStack("water", amount);
}
- public static FluidStack getlava(final int amount){
+ public static FluidStack getDistilledWater(final int amount){
+ return FluidUtils.getFluidStack("ic2distilledwater", amount);
+ }
+
+ public static FluidStack getHotWater(final int amount) {
+ return FluidUtils.getFluidStack("ic2hotwater", amount);
+ }
+
+ public static FluidStack getLava(final int amount){
return FluidUtils.getFluidStack("lava", amount);
}
+ public static FluidStack getPahoehoeLava(final int amount){
+ return FluidUtils.getFluidStack("ic2pahoehoelava", amount);
+ }
+
public static FluidStack getMilk(final int amount){
return FluidUtils.getFluidStack("milk", amount);
}
+ public static FluidStack getColdCoolant(final int amount){
+ return FluidUtils.getFluidStack("ic2coolant", amount);
+ }
+
+ public static FluidStack getHotCoolant(final int amount){
+ return FluidUtils.getFluidStack("ic2hotcoolant", amount);
+ }
+
+ public static FluidStack getSteam(final int amount){
+ return FluidUtils.getFluidStack("steam", amount);
+ }
+
+ public static FluidStack getIC2Steam(final int amount){
+ return FluidUtils.getFluidStack("ic2steam", amount);
+ }
+
+ public static FluidStack getSuperHeatedSteam(final int amount){
+ return FluidUtils.getFluidStack("ic2superheatedsteam", amount);
+ }
+
+ @Deprecated
+ /**
+ * Do not use - Gives third tier steam - Not implemented
+ * @param amount
+ * @return
+ */
+ public static FluidStack getHyperSteam(final int amount){
+ return FluidUtils.getFluidStack("water", amount);
+ }
+
+ public static FluidStack getUUA(final int amount){
+ return FluidUtils.getFluidStack("uuamplifier", amount);
+ }
+
+ public static FluidStack getUUM(final int amount){
+ return FluidUtils.getFluidStack("ic2uumatter", amount);
+ }
+
public static FluidStack getFluidStack(final String fluidName, final int amount){
Logger.WARNING("Trying to get a fluid stack of "+fluidName);
try {
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index ae799baa2b..adeaf8c8ad 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -15,6 +15,7 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.api.objects.minecraft.BlockPos;
import gtPlusPlus.core.item.ModItems;
@@ -34,6 +35,8 @@ import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
import net.minecraft.block.Block;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@@ -479,20 +482,27 @@ public class ItemUtils {
return new BaseItemPlate_OLD(internalName, displayName, mFormula, rgb, radioactivity);
}
+
public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust) {
+ return generateSpecialUseDusts(material, onlyLargeDust, false);
+ }
+
+ public static Item[] generateSpecialUseDusts(final Material material, final boolean onlyLargeDust, final boolean disableExtraRecipes) {
final String materialName = material.getLocalizedName();
final String unlocalizedName = Utils.sanitizeString(materialName);
final int Colour = material.getRgbAsHex();
+ final String aChemForm = material.vChemicalFormula;
+ final boolean isChemFormvalid = (aChemForm != null && aChemForm.length() > 0);
Item[] output = null;
if (onlyLargeDust == false) {
- output = new Item[] { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, Colour, "Dust"),
- new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, Colour, "Small"),
- new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, Colour, "Tiny") };
+ output = new Item[] { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Dust"),
+ new BaseItemDustUnique("itemDustSmall" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Small"),
+ new BaseItemDustUnique("itemDustTiny" + unlocalizedName, materialName, isChemFormvalid ? aChemForm : "", Colour, "Tiny") };
} else {
output = new Item[] { new BaseItemDustUnique("itemDust" + unlocalizedName, materialName, Colour, "Dust") };
}
- new RecipeGen_DustGeneration(material);
+ new RecipeGen_DustGeneration(material, disableExtraRecipes);
return output;
}
@@ -1179,4 +1189,35 @@ public class ItemUtils {
return false;
}
+ public static ItemStack[] cleanItemStackArray(ItemStack[] input) {
+ int aArraySize = input.length;
+ ItemStack[] aOutput = new ItemStack[aArraySize];
+ AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>();
+ for (ItemStack checkStack : input) {
+ if (ItemUtils.checkForInvalidItems(checkStack)) {
+ aCleanedItems.put(checkStack);
+ }
+ }
+ for (int i=0;i<aArraySize;i++) {
+ ItemStack aMappedStack = aCleanedItems.get(i);
+ if (aMappedStack != null){
+ aOutput[i] = aMappedStack;
+ }
+ }
+ return aOutput;
+ }
+
+ public static ItemStack getEnchantedBook(Enchantment aEnch, int aLevel) {
+ return enchantItem(new ItemStack(Items.enchanted_book), aEnch, aLevel);
+ }
+
+ public static ItemStack enchantItem(ItemStack aStack, Enchantment aEnch, int aLevel) {
+ Items.enchanted_book.addEnchantment(aStack, new EnchantmentData(aEnch, aLevel));
+ return aStack;
+ }
+
+ public static boolean doesOreDictHaveEntryFor(String string) {
+ return OreDictionary.doesOreNameExist(string);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 743e4bedf1..364430b07d 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -15,6 +15,9 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.data.TypeCounter;
import gtPlusPlus.core.client.CustomTextureSet.TextureSets;
+import gtPlusPlus.core.item.base.BaseItemComponent;
+import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
+import gtPlusPlus.core.item.base.plates.BaseItemPlateHeavy;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialStack;
@@ -23,6 +26,7 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.data.EnumUtils;
import gtPlusPlus.core.util.data.StringUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -439,6 +443,61 @@ public class MaterialUtils {
}
return resultList;
}
+
+ public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial) {
+ generateComponentAndAssignToAMaterial(aType, aMaterial, true);
+ }
+
+ public static void generateComponentAndAssignToAMaterial(ComponentTypes aType, Material aMaterial, boolean generateRecipes) {
+ Item aGC;
+ if (aType == ComponentTypes.PLATEHEAVY) {
+ aGC = new BaseItemPlateHeavy(aMaterial);
+ }
+ else {
+ aGC = new BaseItemComponent(aMaterial, aType);
+ }
+ if (aGC != null) {
+ String aFormattedLangName = aType.getName();
+
+ if (!aFormattedLangName.startsWith(" ")) {
+ if (aFormattedLangName.contains("@")) {
+ String[] aSplit = aFormattedLangName.split("@");
+ aFormattedLangName = aSplit[0] + " " + aMaterial.getLocalizedName() + " " + aSplit[1];
+ }
+ }
+
+ if (aFormattedLangName.equals(aType.getName())) {
+ aFormattedLangName = aMaterial.getLocalizedName() + aFormattedLangName;
+
+ }
+
+
+
+ Logger.MATERIALS("[Lang] "+aGC.getUnlocalizedName()+".name="+aFormattedLangName);
+ aMaterial.registerComponentForMaterial(aType, ItemUtils.getSimpleStack(aGC));
+ }
+ }
+
+
+
+
+
+
+
+
+ public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial) {
+ generateSpecialDustAndAssignToAMaterial(aMaterial, true);
+ }
+
+ public static void generateSpecialDustAndAssignToAMaterial(Material aMaterial, boolean generateMixerRecipes) {
+ Item[] aDusts = ItemUtils.generateSpecialUseDusts(aMaterial, false, Utils.invertBoolean(generateMixerRecipes));
+ if (aDusts != null && aDusts.length > 0) {
+ aMaterial.registerComponentForMaterial(OrePrefixes.dust, ItemUtils.getSimpleStack(aDusts[0]));
+ aMaterial.registerComponentForMaterial(OrePrefixes.dustSmall, ItemUtils.getSimpleStack(aDusts[1]));
+ aMaterial.registerComponentForMaterial(OrePrefixes.dustTiny, ItemUtils.getSimpleStack(aDusts[2]));
+ }
+
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
index 7dd127203e..2fb7344a28 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
@@ -174,4 +174,8 @@ public class PlayerUtils {
return false;
}
+ public static void messageAllPlayers(String string) {
+ Utils.sendServerMessage(string);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
index 774c8b6f13..13bc0c9382 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java
@@ -6,8 +6,11 @@ import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.interfaces.RunnableWithInfo;
@@ -23,6 +26,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
+import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
@@ -579,7 +583,53 @@ public static int mInvalidID = 1;
return aRecipeMap.mRecipeList.remove(aRecipeToRemove);
}
return false;
- }
+ }
+
+ public static boolean addGtRecipe(GT_Recipe aRecipeToAdd, GT_Recipe_Map aRecipeMap) {
+ if (!aRecipeMap.mRecipeList.contains(aRecipeToAdd)) {
+ return aRecipeMap.mRecipeList.add(aRecipeToAdd);
+ }
+ return false;
+ }
+
+ public static boolean removeRecipeByOutput(ItemStack aOutput) {
+ return removeRecipeByOutput(aOutput, true, false, false);
+ }
+
+ public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT,
+ boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) {
+ if (aOutput == null) {
+ return false;
+ } else {
+ boolean rReturn = false;
+ ArrayList<IRecipe> tList = (ArrayList) CraftingManager.getInstance().getRecipeList();
+ aOutput = GT_OreDictUnificator.get(aOutput);
+ int tList_sS = tList.size();
+
+ for (int i = 0; i < tList_sS; ++i) {
+ IRecipe tRecipe = (IRecipe) tList.get(i);
+ if (!aNotRemoveShapelessRecipes
+ || !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe)) {
+ if (aOnlyRemoveNativeHandlers) {
+ if (!gregtech.api.util.GT_ModHandler.sNativeRecipeClasses.contains(tRecipe.getClass().getName())) {
+ continue;
+ }
+ } else if (gregtech.api.util.GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) {
+ continue;
+ }
+
+ ItemStack tStack = tRecipe.getRecipeOutput();
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) {
+ tList.remove(i--);
+ tList_sS = tList.size();
+ rReturn = true;
+ }
+ }
+ }
+
+ return rReturn;
+ }
+ }
diff --git a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
index fcb8c42197..0b22ea3acc 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
@@ -7,13 +7,72 @@ import net.minecraft.item.ItemStack;
import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.internal.IGT_RecipeAdder;
-
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraftforge.fluids.FluidStack;
public final class AddGregtechRecipe {
+
+
+ public static boolean importPyroRecipe(GT_Recipe aRecipe) {
+
+ int aModifiedTime = (int) (aRecipe.mDuration * 0.8);
+
+ if (aRecipe.mInputs == null || aRecipe.mFluidInputs == null || aRecipe.mFluidOutputs == null || aRecipe.mOutputs == null) {
+ return false;
+ }
+
+ if (aRecipe.mInputs.length > 2 || aRecipe.mFluidInputs.length > 1 || aRecipe.mFluidOutputs.length > 1 || aRecipe.mOutputs.length > 1) {
+ return false;
+ }
+ else if (aRecipe.mInputs.length <= 0 || aRecipe.mFluidInputs.length <= 0 || aRecipe.mFluidOutputs.length <= 0 || aRecipe.mOutputs.length <= 0) {
+ return false;
+ }
+
+ int aCircuitNumber = -1;
+ int aItemSlot = -1;
+
+ int aSlot = 0;
+ for (ItemStack a : aRecipe.mInputs) {
+ if (a != null && a.getItem() != CI.getNumberedCircuit(1).getItem()) {
+ aItemSlot = aSlot;
+ }
+ else {
+ aSlot++;
+ }
+ }
+
+ for (int i=0;i<25;i++) {
+ ItemStack aTest = CI.getNumberedCircuit(i);
+ for (ItemStack a : aRecipe.mInputs) {
+ if (a != null && GT_Utility.areStacksEqual(a, aTest)) {
+ aCircuitNumber = i;
+ break;
+ }
+ }
+ }
+
+ if (aCircuitNumber < 0) {
+ return false;
+ }
+
+
+ return CORE.RA.addCokeOvenRecipe(
+ aRecipe.mInputs[aItemSlot],
+ ItemUtils.getGregtechCircuit(aCircuitNumber),
+ aRecipe.mFluidInputs[0],
+ aRecipe.mFluidOutputs[0],
+ aRecipe.mOutputs[0],
+ aModifiedTime,
+ aRecipe.mEUt);
+
+
+ }
+
public static boolean addCokeAndPyrolyseRecipes(
ItemStack input1, int circuitNumber,
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 722a4f3ff7..2371753fe6 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -3,10 +3,17 @@ package gtPlusPlus.core.util.reflect;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.util.HashMap;
import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
@@ -133,8 +140,8 @@ public class ReflectionUtils {
public static Method getMethod(Object aObject, String aMethodName, Class[] aTypes) {
return getMethod(aObject.getClass(), aMethodName, aTypes);
}
-
-
+
+
/**
* Returns a cached {@link Method} object.
* @param aClass - Class containing the Method.
@@ -193,7 +200,7 @@ public class ReflectionUtils {
return y.get();
}
}
-
+
/**
* Returns a cached {@link Field} object.
* @param aInstance - {@link Object} to get the field instance from.
@@ -219,6 +226,20 @@ public class ReflectionUtils {
return isClassPresent(classname);
}
+
+ /**
+ * Returns the class of the objects type parameter
+ * @param o - Object to examine paramters on
+ * @return - a Class<?> or null
+ */
+ public static Class<?> getTypeOfGenericObject(Object o) {
+ Class<?> aTypeParam = findSuperClassParameterType(o, o.getClass(), 0);
+ if (aTypeParam == null) {
+ aTypeParam = findSubClassParameterType(o, o.getClass(), 0);
+ }
+ return aTypeParam;
+ }
+
public static void makeFieldAccessible(final Field field) {
if (!Modifier.isPublic(field.getModifiers()) ||
!Modifier.isPublic(field.getDeclaringClass().getModifiers()))
@@ -271,6 +292,7 @@ public class ReflectionUtils {
return loaded > 0;
}
+
public static boolean setField(final Object object, final String fieldName, final Object fieldValue) {
@@ -291,15 +313,42 @@ public class ReflectionUtils {
}
}
return false;
+
+
+ }
+
+ public static boolean setField(final Object object, final Field field, final Object fieldValue) {
+ Class<?> clazz = object.getClass();
+ while (clazz != null) {
+ try {
+ final Field field2 = getField(clazz, field.getName());
+ if (field2 != null) {
+ setFieldValue_Internal(object, field, fieldValue);
+ return true;
+ }
+ } catch (final NoSuchFieldException e) {
+ Logger.REFLECTION("setField("+object.toString()+", "+field.getName()+") failed.");
+ clazz = clazz.getSuperclass();
+ } catch (final Exception e) {
+ Logger.REFLECTION("setField("+object.toString()+", "+field.getName()+") failed.");
+ throw new IllegalStateException(e);
+ }
+ }
+ return false;
}
/**
* Allows to change the state of an immutable instance. Huh?!?
*/
- public static void setFinalFieldValue(Class<?> clazz, String fieldName, Object newValue) throws Exception {
+ public static void setFinalFieldValue(Class<?> clazz, String fieldName, Object newValue) {
Field nameField = getField(clazz, fieldName);
- setFieldValue_Internal(clazz, nameField, newValue);
+ try {
+ setFieldValue_Internal(clazz, nameField, newValue);
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Deprecated
@@ -414,13 +463,27 @@ public class ReflectionUtils {
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /*
+ * Internal Magic that probably should not get exposed.
+ */
+
@@ -429,11 +492,126 @@ public class ReflectionUtils {
+ /*
+ *
+ * Below Code block is used for determining generic types associated with type<E>
+ *
+ */
+
+
+ //https://xebia.com/blog/acessing-generic-types-at-runtime-in-java/
+ //https://www.javacodegeeks.com/2013/12/advanced-java-generics-retreiving-generic-type-arguments.html
+ public static Class<?> findSuperClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
+ Class<?> subClass = instance.getClass();
+ while (classOfInterest != subClass.getSuperclass()) {
+ // instance.getClass() is no subclass of classOfInterest or instance is a direct instance of classOfInterest
+ subClass = subClass.getSuperclass();
+ if (subClass == null) {
+ return null;
+ }
+ }
+ ParameterizedType parameterizedType = (ParameterizedType) subClass.getGenericSuperclass();
+ Class<?> aReturn;
+ aReturn = (Class<?>) parameterizedType.getActualTypeArguments()[parameterIndex];
+ return aReturn;
+ }
+
+ public static Class<?> findSubClassParameterType(Object instance, Class<?> classOfInterest, int parameterIndex) {
+ Map<Type, Type> typeMap = new HashMap<Type, Type>();
+ Class<?> instanceClass = instance.getClass();
+ while (classOfInterest != instanceClass.getSuperclass()) {
+ extractTypeArguments(typeMap, instanceClass);
+ instanceClass = instanceClass.getSuperclass();
+ if (instanceClass == null) {
+ return null;
+ }
+ }
+
+ ParameterizedType parameterizedType = (ParameterizedType) instanceClass.getGenericSuperclass();
+ Type actualType = parameterizedType.getActualTypeArguments()[parameterIndex];
+ if (typeMap.containsKey(actualType)) {
+ actualType = typeMap.get(actualType);
+ }
+ if (actualType instanceof Class) {
+ return (Class<?>) actualType;
+ } else if (actualType instanceof TypeVariable) {
+ return browseNestedTypes(instance, (TypeVariable<?>) actualType);
+ } else {
+ return null;
+ }
+ }
+
+ private static void extractTypeArguments(Map<Type, Type> typeMap, Class<?> clazz) {
+ Type genericSuperclass = clazz.getGenericSuperclass();
+ if (!(genericSuperclass instanceof ParameterizedType)) {
+ return;
+ }
+
+ ParameterizedType parameterizedType = (ParameterizedType) genericSuperclass;
+ Type[] typeParameter = ((Class<?>) parameterizedType.getRawType()).getTypeParameters();
+ Type[] actualTypeArgument = parameterizedType.getActualTypeArguments();
+ for (int i = 0; i < typeParameter.length; i++) {
+ if(typeMap.containsKey(actualTypeArgument[i])) {
+ actualTypeArgument[i] = typeMap.get(actualTypeArgument[i]);
+ }
+ typeMap.put(typeParameter[i], actualTypeArgument[i]);
+ }
+ }
+
+ private static Class<?> browseNestedTypes(Object instance, TypeVariable<?> actualType) {
+ Class<?> instanceClass = instance.getClass();
+ List<Class<?>> nestedOuterTypes = new LinkedList<Class<?>>();
+ for (Class<?> enclosingClass = instanceClass
+ .getEnclosingClass(); enclosingClass != null; enclosingClass = enclosingClass.getEnclosingClass()) {
+ try {
+ Field this$0 = instanceClass.getDeclaredField("this$0");
+ Object outerInstance = this$0.get(instance);
+ Class<?> outerClass = outerInstance.getClass();
+ nestedOuterTypes.add(outerClass);
+ Map<Type, Type> outerTypeMap = new HashMap<Type, Type>();
+ extractTypeArguments(outerTypeMap, outerClass);
+ for (Map.Entry<Type, Type> entry : outerTypeMap.entrySet()) {
+ if (!(entry.getKey() instanceof TypeVariable)) {
+ continue;
+ }
+ TypeVariable<?> foundType = (TypeVariable<?>) entry.getKey();
+ if (foundType.getName().equals(actualType.getName())
+ && isInnerClass(foundType.getGenericDeclaration(), actualType.getGenericDeclaration())) {
+ if (entry.getValue() instanceof Class) {
+ return (Class<?>) entry.getValue();
+ }
+ actualType = (TypeVariable<?>) entry.getValue();
+ }
+ }
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+
+ }
+
+ }
+ return null;
+ }
+
+ private static boolean isInnerClass(GenericDeclaration outerDeclaration, GenericDeclaration innerDeclaration) {
+ if (!(outerDeclaration instanceof Class) || !(innerDeclaration instanceof Class)) {
+ return false;
+ }
+ Class<?> outerClass = (Class<?>) outerDeclaration;
+ Class<?> innerClass = (Class<?>) innerDeclaration;
+ while ((innerClass = innerClass.getEnclosingClass()) != null) {
+ if (innerClass == outerClass) {
+ return true;
+ }
+ }
+ return false;
+ }
/*
- * Internal Magic that probably should not get exposed.
- */
+ *
+ * End of Generics Block
+ *
+ */
+
private static Field getField_Internal(final Class<?> clazz, final String fieldName) throws NoSuchFieldException {
@@ -525,26 +703,26 @@ public class ReflectionUtils {
return getMethod_Internal(superClass, aMethodName);
}
}
-
+
private static void dumpClassInfo(Class aClass) {
Logger.INFO("We ran into an error processing reflection in "+aClass.getName()+", dumping all data for debugging.");
// Get the methods
- Method[] methods = aClass.getDeclaredMethods();
- Field[] fields = aClass.getDeclaredFields();
- Constructor[] consts = aClass.getDeclaredConstructors();
+ Method[] methods = aClass.getDeclaredMethods();
+ Field[] fields = aClass.getDeclaredFields();
+ Constructor[] consts = aClass.getDeclaredConstructors();
Logger.INFO("Dumping all Methods.");
- for (Method method : methods) {
- System.out.println(method.getName()+" | "+StringUtils.getDataStringFromArray(method.getParameterTypes()));
- }
+ for (Method method : methods) {
+ System.out.println(method.getName()+" | "+StringUtils.getDataStringFromArray(method.getParameterTypes()));
+ }
Logger.INFO("Dumping all Fields.");
- for (Field f : fields) {
- System.out.println(f.getName());
- }
+ for (Field f : fields) {
+ System.out.println(f.getName());
+ }
Logger.INFO("Dumping all Constructors.");
- for (Constructor c : consts) {
- System.out.println(c.getName()+" | "+c.getParameterCount()+" | "+StringUtils.getDataStringFromArray(c.getParameterTypes()));
- }
+ for (Constructor c : consts) {
+ System.out.println(c.getName()+" | "+c.getParameterCount()+" | "+StringUtils.getDataStringFromArray(c.getParameterTypes()));
+ }
}
private static Class<?> getNonPublicClass(final String className) {