aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
author‭huajijam <strhuaji@gmail.com>2019-05-17 23:26:41 +0800
committer‭huajijam <strhuaji@gmail.com>2019-05-17 23:26:41 +0800
commit5920c6db3ff62d89ba41db4eda59cc6d70ddce3b (patch)
treed4d6d5036e8cb95d2232066f0ee257f59b5aa967 /src/Java/gtPlusPlus/core
parent787c31758d2ea3259f8da9c5c7ffd4b28429eb9a (diff)
parentcacc2915ef0039e3460817e4f116d44cf8e44e5f (diff)
downloadGT5-Unofficial-5920c6db3ff62d89ba41db4eda59cc6d70ddce3b.tar.gz
GT5-Unofficial-5920c6db3ff62d89ba41db4eda59cc6d70ddce3b.tar.bz2
GT5-Unofficial-5920c6db3ff62d89ba41db4eda59cc6d70ddce3b.zip
Automatic synchronization
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/