From f7390af19986b4e4370379bb46dee71f12b717e8 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 13 May 2019 15:45:29 +1000 Subject: + Added High Quality Industrial Diamond. + Added various material components. + Added a debug machine used for calling the Garbage Collector. + Added recipe to obtain Hot Water. + Added way to obtain Dragonsblood. + Added lots of quick access fluids directly to FluidUtils. % Updated English Locale. $ Fixed issue preventing all Multiblocks from forming. $ Fixed some minor texture issues. --- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 11 +++++ .../handler/events/EnderDragonDeathHandler.java | 57 ++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java (limited to 'src/Java/gtPlusPlus/core/handler') diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 1e3cb0ffbb..a00d1ea152 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 /* --- 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..c1c2341dd6 --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java @@ -0,0 +1,57 @@ +package gtPlusPlus.core.handler.events; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.util.Utils; +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; + + //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; + } + } + } + } + //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; + } + } + } + + if (aDidDrop) { + PlayerUtils.messageAllPlayers("Small quantities of Dragonsblood has crystalized after the death of the Ender Dragon!"); + } + + } + +} -- cgit From ff47ff098d524402639b3593a0eb58dbbcbeb538 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 13 May 2019 18:20:11 +1000 Subject: + Added EntityDeathHandler.java, along with some custom drops for Zombies, Blazes and SpecialMob's Brutish Zombie. $ Temporarily disabled bonus outputs again on Multiblocks, fixing the ghost item issue along with processing. --- src/Java/gtPlusPlus/core/common/CommonProxy.java | 42 +++++ .../handler/events/EnderDragonDeathHandler.java | 6 +- .../core/handler/events/EntityDeathHandler.java | 95 ++++++++++++ .../core/util/minecraft/EntityUtils.java | 75 +++++---- .../gtPlusPlus/core/util/minecraft/ItemUtils.java | 11 ++ .../base/GregtechMeta_MultiBlockBase.java | 169 +++++++++++++++++---- .../GregtechMetaTileEntity_IndustrialSifter.java | 2 +- 7 files changed, 341 insertions(+), 59 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/handler/events/EntityDeathHandler.java (limited to 'src/Java/gtPlusPlus/core/handler') diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 23bdb2c5f1..6058d03b80 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -28,6 +28,7 @@ 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; @@ -36,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 { @@ -147,6 +157,7 @@ public class CommonProxy { 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. @@ -181,6 +192,7 @@ public class CommonProxy { COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); COMPAT_IntermodStaging.postInit(e); COMPAT_HANDLER.runQueuedRecipes(); + registerCustomMobDrops(); } public void serverStarting(final FMLServerStartingEvent e) { @@ -226,5 +238,35 @@ 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 + EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getSimpleStack(TF_Items.dustPyrotheum, 1), 1, 10); + EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getSimpleStack(TF_Items.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/handler/events/EnderDragonDeathHandler.java b/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java index c1c2341dd6..884f14386d 100644 --- a/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java @@ -2,7 +2,6 @@ package gtPlusPlus.core.handler.events; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -24,6 +23,7 @@ public class EnderDragonDeathHandler { public void onEntityDrop(LivingDropsEvent event) { boolean aDidDrop = false; + int aCountTotal = 0; //HEE Dragon if (mHEE) { @@ -33,6 +33,7 @@ public class EnderDragonDeathHandler { int aAmount = MathUtils.randInt(5, 25); event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1)); aDidDrop = true; + aCountTotal =+ aAmount; } } } @@ -44,12 +45,13 @@ public class EnderDragonDeathHandler { 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("Small quantities of Dragonsblood has crystalized after the death of the Ender Dragon!"); + 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>> mMobDropMap = new HashMap>>(); + private static final HashSet mInternalClassKeyCache = new HashSet(); + + /** + * 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 aData = new Triplet(aStack, aMaxAmount, aChance); + AutoMap> aDataMap = mMobDropMap.get(aMobClass); + if (aDataMap == null) { + aDataMap = new AutoMap>(); + } + 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 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> aMobData = mMobDropMap.get(entityLiving.getClass()); + boolean aDidDrop = false; + if (aMobData != null) { + if (!aMobData.isEmpty()) { + ItemStack aPossibleDrop; + for (Triplet 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/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 getEntitiesWithinBoundingBoxExcluding(Entity aExclusion, AABB aBoundingBox){ - if (aExclusion == null) { return new AutoMap(); } @@ -175,9 +172,8 @@ public class EntityUtils { return new AutoMap(aEntities); } } - + public static AutoMap getEntitiesWithinBoundingBox(Class aEntityType, AABB aBoundingBox){ - if (aEntityType == null) { return new AutoMap(); } @@ -186,5 +182,26 @@ public class EntityUtils { return new AutoMap(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/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 8b2e04d738..433f26aa11 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -35,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; @@ -1205,4 +1207,13 @@ public class ItemUtils { 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; + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index e9f8546545..0e1ef0e47e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -540,26 +540,149 @@ GT_MetaTileEntity_MultiBlockBase { } + /* + * public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] + * aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int + * aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on + * the Processing Array. A bit overkill, but very flexible. + * + * + * if (this.doesMachineBoostOutput()) { log("Boosting."); return + * checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes, + * aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); } + * + * + * //Control Core to control the Multiblocks behaviour. int aControlCoreTier = + * getControlCoreTier(); + * + * //If no core, return false; if (aControlCoreTier > 0) { + * log("Control core found."); } + * + * + * // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0; + * this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new + * FluidStack[]{}; + * + * long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, + * GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); + * + * //Check to see if Voltage Tier > Control Core Tier if (tTier > + * aControlCoreTier) { + * log("Control core found is lower tier than power tier. OK"); tTier = (byte) + * aControlCoreTier; } + * + * tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9); + * + * GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( + * getBaseMetaTileEntity(), mLastRecipe, false, + * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + * + * log("Running checkRecipeGeneric(1)"); // Remember last recipe - an + * optimization for findRecipe() this.mLastRecipe = tRecipe; + * + * if (tRecipe == null) { log("BAD RETURN - 1"); return false; } + * + * if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + * log("BAD RETURN - 2"); return false; } + * + * // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; float + * tTotalEUt = 0.0f; + * + * int parallelRecipes = 0; + * + * log("parallelRecipes: "+parallelRecipes); + * log("aMaxParallelRecipes: "+aMaxParallelRecipes); + * log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); + * log("tRecipeEUt: "+tRecipeEUt); Logger.INFO("EU1: "+tRecipeEUt); // Count + * recipes to do in parallel, consuming input items and fluids and considering + * input voltage limits for (; parallelRecipes < aMaxParallelRecipes && + * tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if + * (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + * log("Broke at "+parallelRecipes+"."); break; } + * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt + * += tRecipeEUt; Logger.INFO("EU2: "+tTotalEUt); } + * + * if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; } + * + * Logger.INFO("EU3: "+tTotalEUt); + * + * // -- Try not to fail after this point - inputs have already been consumed! + * -- + * + * + * // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% + * speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, + * aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f + + * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration * + * tTimeFactor * 10000); + * + * int aTempEu = (int) Math.floor(tTotalEUt); Logger.INFO("EU4: "+aTempEu); + * this.mEUt = (int) aTempEu; + * + * + * this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + * this.mEfficiencyIncrease = 10000; + * + * // Overclock if (this.mEUt <= 16) { this.mEUt = (this.mEUt * (1 << tTier - 1) + * * (1 << tTier - 1)); this.mMaxProgresstime = (this.mMaxProgresstime / (1 << + * tTier - 1)); } else { while (this.mEUt <= + * gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; + * this.mMaxProgresstime /= 2; } } + * + * if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } + * + * this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + * + * // Collect fluid outputs FluidStack[] tOutputFluids = new + * FluidStack[tRecipe.mFluidOutputs.length]; for (int h = 0; h < + * tRecipe.mFluidOutputs.length; h++) { if (tRecipe.getFluidOutput(h) != null) { + * tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); tOutputFluids[h].amount + * *= parallelRecipes; } } + * + * // Collect output item types ItemStack[] tOutputItems = new + * ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h < + * tRecipe.mOutputs.length; h++) { if (tRecipe.getOutput(h) != null) { + * tOutputItems[h] = tRecipe.getOutput(h).copy(); tOutputItems[h].stackSize = 0; + * } } + * + * // Set output item stack sizes (taking output chance into account) for (int f + * = 0; f < tOutputItems.length; f++) { if (tRecipe.mOutputs[f] != null && + * tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { if + * (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < + * tRecipe.getOutputChance(f)) tOutputItems[f].stackSize += + * tRecipe.mOutputs[f].stackSize; } } } + * + * tOutputItems = removeNulls(tOutputItems); + * + * // Sanitize item stack size, splitting any stacks greater than max stack size + * List splitStacks = new ArrayList(); for (ItemStack + * tItem : tOutputItems) { while (tItem.getMaxStackSize() < tItem.stackSize) { + * ItemStack tmp = tItem.copy(); tmp.stackSize = tmp.getMaxStackSize(); + * tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + * splitStacks.add(tmp); } } + * + * if (splitStacks.size() > 0) { ItemStack[] tmp = new + * ItemStack[splitStacks.size()]; tmp = splitStacks.toArray(tmp); tOutputItems = + * ArrayUtils.addAll(tOutputItems, tmp); } + * + * // Strip empty stacks List tSList = new ArrayList(); + * for (ItemStack tS : tOutputItems) { if (tS.stackSize > 0) tSList.add(tS); } + * tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + * + * // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids = + * tOutputFluids; updateSlots(); + * + * // Play sounds (GT++ addition - GT multiblocks play no sounds) + * startProcess(); + * + * log("GOOD RETURN - 1"); return true; } + */ + public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { - // Based on the Processing Array. A bit overkill, but very flexible. - - - if (this.doesMachineBoostOutput()) { - log("Boosting."); - return checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); - } - - - //Control Core to control the Multiblocks behaviour. - int aControlCoreTier = getControlCoreTier(); - - //If no core, return false; - if (aControlCoreTier > 0) { - log("Control core found."); - } + // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -572,15 +695,8 @@ GT_MetaTileEntity_MultiBlockBase { byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); - //Check to see if Voltage Tier > Control Core Tier - if (tTier > aControlCoreTier) { - log("Control core found is lower tier than power tier. OK"); - tTier = (byte) aControlCoreTier; - } - tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9); - - GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( + GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); @@ -636,7 +752,7 @@ GT_MetaTileEntity_MultiBlockBase { this.mEUt = (int)Math.ceil(tTotalEUt); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; + this.mEfficiencyIncrease = 10000; // Overclock if (this.mEUt <= 16) { @@ -719,8 +835,7 @@ GT_MetaTileEntity_MultiBlockBase { log("GOOD RETURN - 1"); return true; - } - +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index 7c57f799d7..38306d914d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -120,7 +120,7 @@ extends GregtechMeta_MultiBlockBase { @Override protected boolean doesMachineBoostOutput() { - return true; + return false; } @Override -- cgit From afbdec041ed8696392076e24fc87511f9b54909e Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 13 May 2019 19:30:18 +1000 Subject: + Added the Industrial Vacuum Furnace. This Multiblock also doubles as a Dehydrator for higher tiers. + Added recipe for the Industrial Vacuum Furnace. % Cleaned up heating coil code, now it's in one location for easier updating in future. --- src/Java/gregtech/api/util/Recipe_GT.java | 2 + .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 47 ++- src/Java/gtPlusPlus/core/recipe/common/CI.java | 25 ++ .../xmod/gregtech/api/enums/GregtechItemList.java | 4 + .../xmod/gregtech/common/StaticFields59.java | 51 +++ .../common/blocks/GregtechMetaCasingBlocks4.java | 6 +- .../basic/GregtechMetaGarbageCollector.java | 2 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 1 - ...regtechMetaTileEntity_IndustrialDehydrator.java | 378 +++++++++++++++++++++ .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 64 +--- .../registration/gregtech/GregtechDehydrator.java | 6 + .../GregtechFactoryGradeReplacementMultis.java | 24 ++ .../GregtechIndustrialCryogenicFreezer.java | 26 -- 14 files changed, 539 insertions(+), 99 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java delete mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java (limited to 'src/Java/gtPlusPlus/core/handler') diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index 950e9bf1e2..1e37c9be13 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -12,6 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Fuel; import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; @@ -246,6 +247,7 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{ public static final GT_Recipe_Map sGeoThermalFuels = new GT_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); public static final GT_Recipe_Map sChemicalDehydratorRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sVacuumFurnaceRecipes = new GT_Recipe_Map(new HashSet(500), "gt.recipe.vacfurnace", "Vacuum Furnace", null, "gregtech:textures/gui/basicmachines/Default", 2, 2, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true); public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map(new HashSet(200), "gt.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 9, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sSteamTurbineFuels = new GT_Recipe_Map(new HashSet(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index a00d1ea152..fd30457b46 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -125,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/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index bfd50e0ce1..a9183e8d98 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -221,6 +221,7 @@ public class RECIPES_Machines { energyCores(); wirelessChargers(); largeArcFurnace(); + industrialVacuumFurnace(); } private static void initModItems(){ @@ -1031,25 +1032,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 +2023,38 @@ 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)); + } + } diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 80abc18158..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; @@ -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/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 6e9a099e72..742304f918 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -313,6 +313,10 @@ public enum GregtechItemList implements GregtechItemContainer { //Larger Turbines Large_Steam_Turbine, Large_HPSteam_Turbine, Casing_Turbine_Shaft, Casing_Turbine_LP, Casing_Turbine_HP, + + //Large Vacuum Furnace + Casing_Vacuum_Furnace, + Controller_Vacuum_Furnace, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java index 99563b60ef..9c552db3ad 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -219,6 +219,57 @@ public class StaticFields59 { } return null; } + + public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) { + if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) { + return getHeatingCapacityForCoilTier(aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3); + } + else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 8)) { + return getHeatingCapacityForCoilTier(aMeta); + } + return 0; + } + + public static int getHeatingCapacityForCoilTier(int aCoilTier) { + int mHeatingCapacity = 0; + switch (aCoilTier) { + case 0: + mHeatingCapacity = 1800; + break; + case 1: + mHeatingCapacity = 2700; + break; + case 2: + mHeatingCapacity = 3600; + break; + case 3: + mHeatingCapacity = 4500; + break; + case 4: + mHeatingCapacity = 5400; + break; + case 5: + mHeatingCapacity = 7200; + break; + case 6: + mHeatingCapacity = 9000; + break; + case 7: + mHeatingCapacity = 9900; + break; + case 8: + mHeatingCapacity = 10800; + break; + default: + Logger.INFO("Heating Coils are bad."); + mHeatingCapacity = 0; + } + if (CORE.GTNH && aCoilTier <= 6) { + mHeatingCapacity += 1; + } + + return mHeatingCapacity; + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 54323d8c2e..97babc587e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -34,7 +34,7 @@ extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Turbine Shaft"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Low Pressure Turbine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "High Pressure Turbine Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); @@ -50,8 +50,8 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 7)); GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 8)); GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 9)); - /*GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10)); - GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10)); + /*GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java index c09302fb3e..0a65db7be4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java @@ -23,7 +23,7 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { int mFrequency = 5; public GregtechMetaGarbageCollector(final String aName, final String aNameRegional, final String aDescription) { - super(28750, aName, aNameRegional, 5, 0, aDescription); + super(991, aName, aNameRegional, 5, 0, aDescription); } public GregtechMetaGarbageCollector(final String aName, final String aDescription, final ITexture[][][] aTextures) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index 3f3a276f0c..9490fc678b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -11,7 +11,6 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java new file mode 100644 index 0000000000..2c17629d8f --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -0,0 +1,378 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; + +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.Recipe_GT; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.StaticFields59; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_MultiBlockBase { + + private static int CASING_TEXTURE_ID; + private static String mCasingName = "Vacuum Casing"; + private int mHeatingCapacity = 0; + private boolean mDehydratorMode = false; + + public GregtechMetaTileEntity_IndustrialDehydrator(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); + mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); + } + + public GregtechMetaTileEntity_IndustrialDehydrator(String aName) { + super(aName); + CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); + mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialDehydrator(mName); + } + + public String[] getTooltip() { + if (mCasingName.toLowerCase().contains(".name")) { + mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); + } + return new String[] { + "Factory Grade Vacuum Furnace", + "Can toggle the operation temperature with a Screwdriver", + "All Dehydrator recipes are Low Temp recipes", + "Speed: 120% | Eu Usage: 50% | Parallel: 4", + "Constructed exactly the same as a normal EBF", + "Has three layers of coils instead (24)", + "Use "+mCasingName+"s (10 at least!)", + "Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)", + "Each 1800K over the min. Heat Capacity allows for one upgraded overclock", + "Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%", + }; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID], + new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE + : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) }; + } + return new ITexture[] { Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID] }; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return mDehydratorMode ? Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes : Recipe_GT.Gregtech_Recipe_Map.sVacuumFurnaceRecipes; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + + public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; + + this.mHeatingCapacity = 0; + if (!aBaseMetaTileEntity.getAirOffset(xDir, 1, zDir)) { + return false; + } + if (!aBaseMetaTileEntity.getAirOffset(xDir, 2, zDir)) { + return false; + } + if (!aBaseMetaTileEntity.getAirOffset(xDir, 3, zDir)) { + return false; + } + Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir); + byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir); + this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta); + + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((i != 0) || (j != 0)) { + //Coils 1 + if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) { + Logger.INFO("Heating Coils missing."); + return false; + } + + //Coils 2 + if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) { + Logger.INFO("Heating Coils missing."); + return false; + } + + //Coils 3 + if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) { + Logger.INFO("Heating Coils missing."); + return false; + } + } + + //Top Layer + final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j); + if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j), ModBlocks.blockCasings4Misc, 10)) { + Logger.INFO("Top Layer missing."); + return false; + } + } + } + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if ((xDir + i != 0) || (zDir + j != 0)) { + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,zDir + j); + if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings4Misc, 10)) { + Logger.INFO("Bottom Layer missing."); + return false; + } + } + } + } + return true; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 25; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public String getMachineType() { + return "Vacuum Furnace / Dehydrator"; + } + + @Override + public int getMaxParallelRecipes() { + return 4; + } + + @Override + public int getEuDiscountForParallelism() { + return 50; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "ElectricBlastFurnace"; + } + + public boolean checkRecipe(ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 120); + } + + @Override + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[] {}; + this.mOutputFluids = new FluidStack[] {}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + Logger.WARNING("Running checkRecipeGeneric(0)"); + + GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + + Logger.WARNING("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + if (tRecipe == null || this.mHeatingCapacity < tRecipe.mSpecialValue) { + Logger.WARNING("BAD RETURN - 1"); + return false; + } + + if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + Logger.WARNING("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + int tHeatCapacityDivTiers = (mHeatingCapacity - tRecipe.mSpecialValue) / 900; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + // Count recipes to do in parallel, consuming input items and fluids and + // considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + Logger.WARNING("Broke at " + parallelRecipes + "."); + break; + } + Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + "."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + Logger.WARNING("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor); + int rInt = 2; + + this.mEUt = (int) Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= (tHeatCapacityDivTiers >= rInt ? 4 : 2); + } + } + + if (tHeatCapacityDivTiers > 0) { + this.mEUt = (int) (this.mEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List splitStacks = new ArrayList(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List tSList = new ArrayList(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) + tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + Logger.WARNING("GOOD RETURN - 1"); + return true; + + } + + @Override + public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + mDehydratorMode = Utils.invertBoolean(mDehydratorMode); + String aMode = mDehydratorMode ? "Dehydrator" : "Vacuum Furnace"; + PlayerUtils.messagePlayer(aPlayer, "Mode: "+aMode); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mDehydratorMode", mDehydratorMode); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mDehydratorMode = aNBT.getBoolean("mDehydratorMode"); + } + +} + + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index ac362e2c40..dd00c9731d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -28,6 +28,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -171,68 +172,9 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase CASING_TEXTURE_ID)) { return false; }*/ + Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir); byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir); - - if (!CORE.GTNH) { - switch (tUsedMeta) { - case 0: - this.mHeatingCapacity = 1800; - break; - case 1: - this.mHeatingCapacity = 2700; - break; - case 2: - this.mHeatingCapacity = 3600; - break; - case 3: - this.mHeatingCapacity = 4500; - break; - case 4: - this.mHeatingCapacity = 5400; - break; - case 5: - this.mHeatingCapacity = 7200; - break; - case 6: - this.mHeatingCapacity = 9001; - break; - default:Logger.INFO("Heating Coils are bad."); - return false; - } - } else { - switch (tUsedMeta) { - case 0: - this.mHeatingCapacity = 1801; - break; - case 1: - this.mHeatingCapacity = 2701; - break; - case 2: - this.mHeatingCapacity = 3601; - break; - case 3: - this.mHeatingCapacity = 4501; - break; - case 4: - this.mHeatingCapacity = 5401; - break; - case 5: - this.mHeatingCapacity = 7201; - break; - case 6: - this.mHeatingCapacity = 9001; - break; - case 7: - this.mHeatingCapacity = 9901; - break; - case 8: - this.mHeatingCapacity = 10801; - break; - default: - Logger.INFO("Heating Coils are bad."); - return false; - } - } + this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta); for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index 54ab6d45bb..63443b852a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -14,6 +14,8 @@ import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialDehydrator; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; public class GregtechDehydrator { public static void run() { @@ -73,6 +75,10 @@ public class GregtechDehydrator { "You can definitely make space icecream with this.. ", Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); + + //Advanced + GregtechItemList.Controller_Vacuum_Furnace.set(new GregtechMetaTileEntity_IndustrialDehydrator(992, "multimachine.adv.vacuumfurnace", "Utupu-Tanuri").getStackForm(1L)); + ItemStack coilWire1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 4); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java new file mode 100644 index 0000000000..2b683dd888 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java @@ -0,0 +1,24 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Implosion; + +public class GregtechFactoryGradeReplacementMultis { + + public static void run() { + run1(); + } + + private static void run1() { + Logger.INFO("Gregtech 5 Content | Registering Advanced GT Multiblock replacements."); + GregtechItemList.Machine_Adv_BlastFurnace.set(new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "Volcanus").getStackForm(1L)); + GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2").getStackForm(1L)); + GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer").getStackForm(1L)); + GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV").getStackForm(1L)); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java deleted file mode 100644 index 65f3e41911..0000000000 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCryogenicFreezer.java +++ /dev/null @@ -1,26 +0,0 @@ -package gtPlusPlus.xmod.gregtech.registration.gregtech; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Implosion; - -public class GregtechIndustrialCryogenicFreezer { - - public static void run() { - if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - run1(); - } - } - - private static void run1() { - Logger.INFO("Gregtech 5 Content | Registering Advanced GT Multiblock replacements."); - GregtechItemList.Machine_Adv_BlastFurnace.set(new GregtechMetaTileEntity_Adv_EBF(963, "multimachine.adv.blastfurnace", "Volcanus").getStackForm(1L)); - GregtechItemList.Machine_Adv_ImplosionCompressor.set(new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2").getStackForm(1L)); - GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer(910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer").getStackForm(1L)); - GregtechItemList.FusionComputer_UV2.set(new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV").getStackForm(1L)); - } - -} -- cgit