From 87bfa35039be5fae405619baa0fbb05d4b1cf491 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 26 Jun 2016 22:28:21 +1000 Subject: +Electric Blast Furnace clone - For Testing +Added Blazing Pyrotheum +Added Gelid Cryotheum +Added Blizz Rods --- src/Java/miscutil/MiscUtils.java | 6 + src/Java/miscutil/core/common/CommonProxy.java | 4 +- src/Java/miscutil/core/handler/COMPAT_HANDLER.java | 2 +- .../core/handler/COMPAT_IntermodStaging.java | 29 +- .../gregtech/GregtechSteamCondenser.java | 2 + .../intermod/growthcraft/Growthcraft_Handler.java | 61 - .../intermod/growthcraft/HANDLER_Growthcraft.java | 65 + .../HANDLER_ThermalFoundation.java | 37 + .../block/TF_Block_Fluid_Cryotheum.java | 187 +++ .../block/TF_Block_Fluid_Pyrotheum.java | 180 +++ .../thermalfoundation/block/TF_Blocks.java | 26 + .../thermalfoundation/fluid/TF_Fluids.java | 42 + .../intermod/thermalfoundation/item/TF_Items.java | 66 + .../recipe/TF_Gregtech_Recipes.java | 48 + src/Java/miscutil/core/lib/LoadedMods.java | 20 + src/Java/miscutil/gregtech/HANDLER_Gregtech.java | 26 + .../gregtech/api/enums/GregtechItemList.java | 5 +- .../gregtech/api/enums/GregtechOrePrefixes.java | 1374 ++++++++++---------- .../miscutil/gregtech/common/Meta_GT_Proxy.java | 84 ++ .../common/blocks/fluid/GregtechFluidHandler.java | 35 + ...GregtechMetaTileEntityElectricBlastFurnace.java | 236 ++++ 21 files changed, 1780 insertions(+), 755 deletions(-) delete mode 100644 src/Java/miscutil/core/intermod/growthcraft/Growthcraft_Handler.java create mode 100644 src/Java/miscutil/core/intermod/growthcraft/HANDLER_Growthcraft.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/HANDLER_ThermalFoundation.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Blocks.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/fluid/TF_Fluids.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/item/TF_Items.java create mode 100644 src/Java/miscutil/core/intermod/thermalfoundation/recipe/TF_Gregtech_Recipes.java create mode 100644 src/Java/miscutil/gregtech/HANDLER_Gregtech.java create mode 100644 src/Java/miscutil/gregtech/common/Meta_GT_Proxy.java create mode 100644 src/Java/miscutil/gregtech/common/blocks/fluid/GregtechFluidHandler.java create mode 100644 src/Java/miscutil/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityElectricBlastFurnace.java (limited to 'src/Java/miscutil') diff --git a/src/Java/miscutil/MiscUtils.java b/src/Java/miscutil/MiscUtils.java index 9281429a91..ba9cf34692 100644 --- a/src/Java/miscutil/MiscUtils.java +++ b/src/Java/miscutil/MiscUtils.java @@ -1,13 +1,18 @@ package miscutil; +import gregtech.api.util.GT_Config; + import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; import miscutil.core.commands.CommandMath; import miscutil.core.common.CommonProxy; import miscutil.core.lib.CORE; import miscutil.core.util.Utils; +import miscutil.gregtech.HANDLER_Gregtech; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -37,6 +42,7 @@ implements ActionListener Utils.LOG_INFO("Loading "+CORE.MODID+" V"+CORE.VERSION); proxy.registerTileEntities(); proxy.registerRenderThings(); + HANDLER_Gregtech.mMaterialProperties = new GT_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "MiscUtils"), "MaterialProperties.cfg"))); proxy.preInit(event); } diff --git a/src/Java/miscutil/core/common/CommonProxy.java b/src/Java/miscutil/core/common/CommonProxy.java index ac1aa32801..3197eaffca 100644 --- a/src/Java/miscutil/core/common/CommonProxy.java +++ b/src/Java/miscutil/core/common/CommonProxy.java @@ -36,6 +36,7 @@ public class CommonProxy { Utils.LOG_WARNING("Development mode not set."); } AddToCreativeTab.initialiseTabs(); + COMPAT_IntermodStaging.preInit(); //Apparently I should do this here. Might put it in Init for a test. //Growthcraft_Handler.run(); } @@ -53,7 +54,7 @@ public class CommonProxy { COMPAT_HANDLER.registerMyModsOreDictEntries(); COMPAT_HANDLER.registerGregtechMachines(); COMPAT_HANDLER.intermodOreDictionarySupport(); - COMPAT_IntermodStaging.load(); + COMPAT_IntermodStaging.init(); } public void postInit(FMLPostInitializationEvent e) { @@ -63,6 +64,7 @@ public class CommonProxy { COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); COMPAT_HANDLER.RemoveRecipesFromOtherMods(); COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); + COMPAT_IntermodStaging.postInit(); } diff --git a/src/Java/miscutil/core/handler/COMPAT_HANDLER.java b/src/Java/miscutil/core/handler/COMPAT_HANDLER.java index 4ab66d3099..a62d7c6734 100644 --- a/src/Java/miscutil/core/handler/COMPAT_HANDLER.java +++ b/src/Java/miscutil/core/handler/COMPAT_HANDLER.java @@ -121,7 +121,7 @@ public class COMPAT_HANDLER { } if (LoadedMods.IndustrialCraft2){ COMPAT_IC2.OreDict(); - } + } } public static void RemoveRecipesFromOtherMods(){ diff --git a/src/Java/miscutil/core/handler/COMPAT_IntermodStaging.java b/src/Java/miscutil/core/handler/COMPAT_IntermodStaging.java index b3c7934c9a..668487c5b7 100644 --- a/src/Java/miscutil/core/handler/COMPAT_IntermodStaging.java +++ b/src/Java/miscutil/core/handler/COMPAT_IntermodStaging.java @@ -1,18 +1,27 @@ package miscutil.core.handler; -import growthcraft.core.GrowthCraftCore; -import miscutil.core.intermod.growthcraft.Growthcraft_Handler; -import miscutil.core.lib.LoadedMods; +import miscutil.core.intermod.growthcraft.HANDLER_Growthcraft; +import miscutil.core.intermod.thermalfoundation.HANDLER_ThermalFoundation; +import miscutil.gregtech.HANDLER_Gregtech; public class COMPAT_IntermodStaging { - public static void load(){ - if (LoadedMods.Growthcraft || GrowthCraftCore.instance != null){ - Growthcraft_Handler.run(); - } - + public static void preInit(){ + HANDLER_Growthcraft.preInit(); + HANDLER_ThermalFoundation.preInit(); + HANDLER_Gregtech.preInit(); } - - + + public static void init(){ + HANDLER_ThermalFoundation.Init(); + HANDLER_Gregtech.init(); + } + + public static void postInit(){ + HANDLER_ThermalFoundation.postInit(); + HANDLER_Gregtech.postInit(); + } + + } diff --git a/src/Java/miscutil/core/handler/registration/gregtech/GregtechSteamCondenser.java b/src/Java/miscutil/core/handler/registration/gregtech/GregtechSteamCondenser.java index afc899410b..781daccde3 100644 --- a/src/Java/miscutil/core/handler/registration/gregtech/GregtechSteamCondenser.java +++ b/src/Java/miscutil/core/handler/registration/gregtech/GregtechSteamCondenser.java @@ -3,6 +3,7 @@ package miscutil.core.handler.registration.gregtech; import miscutil.core.util.Utils; import miscutil.gregtech.api.enums.GregtechItemList; import miscutil.gregtech.api.metatileentity.implementations.GregtechMetaCondensor; +import miscutil.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityElectricBlastFurnace; import miscutil.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIronBlastFurnace; public class GregtechSteamCondenser @@ -27,6 +28,7 @@ public class GregtechSteamCondenser GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntityIronBlastFurnace(768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L)); + GregtechItemList.Machine_Electric_BlastFurnace.set(new GregtechMetaTileEntityElectricBlastFurnace(796, "electric.blastfurnace", "Electric Blast Furnace").getStackForm(1L)); //ItemUtils.recipeBuilder(slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9, resultItem); diff --git a/src/Java/miscutil/core/intermod/growthcraft/Growthcraft_Handler.java b/src/Java/miscutil/core/intermod/growthcraft/Growthcraft_Handler.java deleted file mode 100644 index 96912df9bc..0000000000 --- a/src/Java/miscutil/core/intermod/growthcraft/Growthcraft_Handler.java +++ /dev/null @@ -1,61 +0,0 @@ -package miscutil.core.intermod.growthcraft; - -import growthcraft.api.cellar.Booze; -import growthcraft.api.cellar.CellarRegistry; -import growthcraft.cellar.block.BlockFluidBooze; -import growthcraft.cellar.item.ItemBoozeBottle; -import growthcraft.cellar.item.ItemBoozeBucketDEPRECATED; -import growthcraft.cellar.item.ItemBucketBooze; -import growthcraft.cellar.utils.BoozeRegistryHelper; -import growthcraft.hops.GrowthCraftHops; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class Growthcraft_Handler { - - public static BlockFluidBooze[] jackDanielsWhiskeyFluids; - public static Item jackDaniels; - public static Item jackDanielsSeeds; - public static Item jackDanielsWhiskey; - public static Item jackDanielsWhiskeyBucket_deprecated; - public static ItemBucketBooze[] jackDanielsWhiskeyBuckets; - public static Fluid[] jackDanielsWhiskeyBooze; - //private static int internalColour = FluidRegistry.getFluid("fluidJackDaniels").getColor(); - private static int internalColour = 0000000; - - //Run me during Pre-Init - public static void run(){ - start(); - } - - private static void start(){ - jackDaniels = GrowthCraftHops.hops; - jackDanielsSeeds = GrowthCraftHops.hopSeeds; - - jackDanielsWhiskeyBooze = new Booze[5]; - jackDanielsWhiskeyFluids = new BlockFluidBooze[jackDanielsWhiskeyBooze.length]; - jackDanielsWhiskeyBuckets = new ItemBucketBooze[jackDanielsWhiskeyBooze.length]; - BoozeRegistryHelper.initializeBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, "grc.jackDanielsWhiskey", internalColour); - - jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, jackDanielsWhiskeyBooze).setColor(internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] { Potion.digSpeed.id }, new int[] { 3600 }); - jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(jackDanielsWhiskeyBooze).setColor(internalColour); - - - //GameRegistry.registerItem(jackDaniels, "grc.jackDaniels"); - //GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds"); - GameRegistry.registerItem(jackDanielsWhiskey, "grc.jackDanielsWhiskey"); - GameRegistry.registerItem(jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket"); - - BoozeRegistryHelper.registerBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, jackDanielsWhiskey, "grc.jackDanielsWhiskey", jackDanielsWhiskeyBucket_deprecated); - - CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat, jackDanielsWhiskeyBooze[4], 200, 60, 0.4F); - CellarRegistry.instance().brew().addBrewing(jackDanielsWhiskeyBooze[4], jackDaniels, jackDanielsWhiskeyBooze[0], 350, 60, 0.1F); - - - } - -} diff --git a/src/Java/miscutil/core/intermod/growthcraft/HANDLER_Growthcraft.java b/src/Java/miscutil/core/intermod/growthcraft/HANDLER_Growthcraft.java new file mode 100644 index 0000000000..9ff80c735a --- /dev/null +++ b/src/Java/miscutil/core/intermod/growthcraft/HANDLER_Growthcraft.java @@ -0,0 +1,65 @@ +package miscutil.core.intermod.growthcraft; + +import growthcraft.api.cellar.Booze; +import growthcraft.api.cellar.CellarRegistry; +import growthcraft.cellar.block.BlockFluidBooze; +import growthcraft.cellar.item.ItemBoozeBottle; +import growthcraft.cellar.item.ItemBoozeBucketDEPRECATED; +import growthcraft.cellar.item.ItemBucketBooze; +import growthcraft.cellar.utils.BoozeRegistryHelper; +import growthcraft.core.GrowthCraftCore; +import growthcraft.hops.GrowthCraftHops; +import miscutil.core.lib.LoadedMods; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.potion.Potion; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.common.registry.GameRegistry; + +public class HANDLER_Growthcraft { + + public static BlockFluidBooze[] jackDanielsWhiskeyFluids; + public static Item jackDaniels; + public static Item jackDanielsSeeds; + public static Item jackDanielsWhiskey; + public static Item jackDanielsWhiskeyBucket_deprecated; + public static ItemBucketBooze[] jackDanielsWhiskeyBuckets; + public static Fluid[] jackDanielsWhiskeyBooze; + //private static int internalColour = FluidRegistry.getFluid("fluidJackDaniels").getColor(); + private static int internalColour = 0000000; + + //Run me during Pre-Init + public static void preInit(){ + if (LoadedMods.Growthcraft || GrowthCraftCore.instance != null){ + start(); + } + } + + private static void start(){ + jackDaniels = GrowthCraftHops.hops; + jackDanielsSeeds = GrowthCraftHops.hopSeeds; + + jackDanielsWhiskeyBooze = new Booze[5]; + jackDanielsWhiskeyFluids = new BlockFluidBooze[jackDanielsWhiskeyBooze.length]; + jackDanielsWhiskeyBuckets = new ItemBucketBooze[jackDanielsWhiskeyBooze.length]; + BoozeRegistryHelper.initializeBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, "grc.jackDanielsWhiskey", internalColour); + + jackDanielsWhiskey = new ItemBoozeBottle(6, -0.5F, jackDanielsWhiskeyBooze).setColor(internalColour).setTipsy(0.7F, 900).setPotionEffects(new int[] { Potion.digSpeed.id }, new int[] { 3600 }); + jackDanielsWhiskeyBucket_deprecated = new ItemBoozeBucketDEPRECATED(jackDanielsWhiskeyBooze).setColor(internalColour); + + + //GameRegistry.registerItem(jackDaniels, "grc.jackDaniels"); + //GameRegistry.registerItem(jackDanielsSeeds, "grc.jackDanielsSeeds"); + GameRegistry.registerItem(jackDanielsWhiskey, "grc.jackDanielsWhiskey"); + GameRegistry.registerItem(jackDanielsWhiskeyBucket_deprecated, "grc.jackDanielsWhiskey_bucket"); + + BoozeRegistryHelper.registerBooze(jackDanielsWhiskeyBooze, jackDanielsWhiskeyFluids, jackDanielsWhiskeyBuckets, jackDanielsWhiskey, "grc.jackDanielsWhiskey", jackDanielsWhiskeyBucket_deprecated); + + CellarRegistry.instance().brew().addBrewing(FluidRegistry.WATER, Items.wheat, jackDanielsWhiskeyBooze[4], 200, 60, 0.4F); + CellarRegistry.instance().brew().addBrewing(jackDanielsWhiskeyBooze[4], jackDaniels, jackDanielsWhiskeyBooze[0], 350, 60, 0.1F); + + + } + +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/HANDLER_ThermalFoundation.java b/src/Java/miscutil/core/intermod/thermalfoundation/HANDLER_ThermalFoundation.java new file mode 100644 index 0000000000..e5eb609fe8 --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/HANDLER_ThermalFoundation.java @@ -0,0 +1,37 @@ +package miscutil.core.intermod.thermalfoundation; + +import miscutil.core.intermod.thermalfoundation.block.TF_Blocks; +import miscutil.core.intermod.thermalfoundation.fluid.TF_Fluids; +import miscutil.core.intermod.thermalfoundation.item.TF_Items; +import miscutil.core.intermod.thermalfoundation.recipe.TF_Gregtech_Recipes; +import miscutil.core.lib.LoadedMods; + +public class HANDLER_ThermalFoundation { + + public static void preInit(){ + if (LoadedMods.CoFHCore){ + TF_Fluids.preInit(); + TF_Items.preInit(); + TF_Blocks.preInit(); + } + } + + public static void Init(){ + if (LoadedMods.CoFHCore){ + TF_Fluids.init(); + TF_Items.init(); + TF_Blocks.init(); + } + } + + public static void postInit(){ + if (LoadedMods.CoFHCore){ + TF_Fluids.postInit(); + TF_Items.postInit(); + TF_Blocks.postInit(); + if(LoadedMods.Gregtech){ + TF_Gregtech_Recipes.run(); + } + } + } +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java new file mode 100644 index 0000000000..cc9094714e --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java @@ -0,0 +1,187 @@ +package miscutil.core.intermod.thermalfoundation.block; + +import java.util.Random; + +import miscutil.core.intermod.thermalfoundation.fluid.TF_Fluids; +import net.minecraft.block.Block; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.material.MaterialLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cofh.core.fluid.BlockFluidInteractive; +import cofh.lib.util.BlockWrapper; +import cofh.lib.util.helpers.DamageHelper; +import cofh.lib.util.helpers.ServerHelper; +import cpw.mods.fml.common.registry.GameRegistry; + +public class TF_Block_Fluid_Cryotheum + extends BlockFluidInteractive +{ + Random random = new Random(); + public static final int LEVELS = 5; + public static final Material materialFluidCryotheum = new MaterialLiquid(MapColor.iceColor); + private static boolean enableSourceFall = true; + private static boolean effect = true; + + public TF_Block_Fluid_Cryotheum() + { + super("MiscUtils", TF_Fluids.fluidCryotheum, materialFluidCryotheum, "cryotheum"); + setQuantaPerBlock(5); + setTickRate(15); + + setHardness(1000.0F); + setLightOpacity(1); + setParticleColor(0.15F, 0.7F, 1.0F); + } + + public boolean preInit() + { + GameRegistry.registerBlock(this, "FluidCryotheum"); + + addInteraction(Blocks.grass, Blocks.dirt); + addInteraction(Blocks.water, 0, Blocks.ice); + addInteraction(Blocks.water, Blocks.snow); + addInteraction(Blocks.flowing_water, 0, Blocks.ice); + addInteraction(Blocks.flowing_water, Blocks.snow); + addInteraction(Blocks.lava, 0, Blocks.obsidian); + addInteraction(Blocks.lava, Blocks.stone); + addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian); + addInteraction(Blocks.flowing_lava, Blocks.stone); + addInteraction(Blocks.leaves, Blocks.air); + addInteraction(Blocks.tallgrass, Blocks.air); + addInteraction(Blocks.fire, Blocks.air); + //addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone); + + String str1 = "Fluid.Cryotheum"; + String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold."; + effect = true; + + str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards."; + enableSourceFall = true; + + return true; + } + + public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity) + { + paramEntity.extinguish(); + if (!effect) { + return; + } + if ((paramEntity.motionY < -0.05D) || (paramEntity.motionY > 0.05D)) { + paramEntity.motionY *= 0.05D; + } + if ((paramEntity.motionZ < -0.05D) || (paramEntity.motionZ > 0.05D)) { + paramEntity.motionZ *= 0.05D; + } + if ((paramEntity.motionX < -0.05D) || (paramEntity.motionX > 0.05D)) { + paramEntity.motionX *= 0.05D; + } + if (ServerHelper.isClientWorld(paramWorld)) { + return; + } + if (paramWorld.getTotalWorldTime() % 8L != 0L) { + return; + } + if (((paramEntity instanceof EntityZombie)) || ((paramEntity instanceof EntityCreeper))) + { + EntitySnowman localEntitySnowman = new EntitySnowman(paramWorld); + localEntitySnowman.setLocationAndAngles(paramEntity.posX, paramEntity.posY, paramEntity.posZ, paramEntity.rotationYaw, paramEntity.rotationPitch); + paramWorld.spawnEntityInWorld(localEntitySnowman); + + paramEntity.setDead(); + } + else if (/*((paramEntity instanceof EntityBlizz)) ||*/((paramEntity instanceof EntitySnowman))) + { + ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 120, 0)); + ((EntityLivingBase)paramEntity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 120, 0)); + } + else if ((paramEntity instanceof EntityBlaze)) + { + paramEntity.attackEntityFrom(DamageHelper.cryotheum, 10.0F); + } + else + { + boolean bool = paramEntity.velocityChanged; + paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F); + paramEntity.velocityChanged = bool; + } + } + + public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) + { + return TF_Fluids.fluidCryotheum.getLuminosity(); + } + + public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom) + { + if (effect) { + checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3); + } + if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0)) + { + Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3); + int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3); + if ((localBlock == this) && (i != 0)) + { + paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3); + paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3); + return; + } + } + super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom); + } + + protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3) + { + if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) { + return; + } + int i = paramInt1; + int j = paramInt2; + int k = paramInt3; + for (int m = 0; m < 6; m++) + { + i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0]; + j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1]; + k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2]; + + interactWithBlock(paramWorld, i, j, k); + } + interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1); + interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1); + interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1); + interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1); + } + + protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3) + { + Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3); + if ((localBlock == Blocks.air) || (localBlock == this)) { + return; + } + int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3); + if (hasInteraction(localBlock, i)) + { + BlockWrapper localBlockWrapper = getInteraction(localBlock, i); + paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3); + } + else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3))) + { + paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.snow_layer, 0, 3); + } + } + + protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3) {} +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java new file mode 100644 index 0000000000..461f4cdbef --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java @@ -0,0 +1,180 @@ +package miscutil.core.intermod.thermalfoundation.block; + +import java.util.Random; + +import miscutil.core.intermod.thermalfoundation.fluid.TF_Fluids; +import net.minecraft.block.Block; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.material.MaterialLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cofh.core.fluid.BlockFluidInteractive; +import cofh.lib.util.BlockWrapper; +import cofh.lib.util.helpers.ServerHelper; +import cpw.mods.fml.common.registry.GameRegistry; + +public class TF_Block_Fluid_Pyrotheum + extends BlockFluidInteractive +{ + Random random = new Random(); + public static final int LEVELS = 5; + public static final Material materialFluidPyrotheum = new MaterialLiquid(MapColor.tntColor); + private static boolean effect = true; + private static boolean enableSourceFall = true; + + public TF_Block_Fluid_Pyrotheum() + { + super("MiscUtils", TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum"); + setQuantaPerBlock(5); + setTickRate(10); + + setHardness(1000.0F); + setLightOpacity(1); + setParticleColor(1.0F, 0.7F, 0.15F); + } + + public boolean preInit() + { + GameRegistry.registerBlock(this, "FluidPyrotheum"); + + addInteraction(Blocks.cobblestone, Blocks.stone); + addInteraction(Blocks.grass, Blocks.dirt); + addInteraction(Blocks.sand, Blocks.glass); + addInteraction(Blocks.water, Blocks.stone); + addInteraction(Blocks.flowing_water, Blocks.stone); + addInteraction(Blocks.clay, Blocks.hardened_clay); + addInteraction(Blocks.ice, Blocks.stone); + addInteraction(Blocks.snow, Blocks.air); + addInteraction(Blocks.snow_layer, Blocks.air); + for (int i = 0; i < 8; i++) { + addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i); + } + String str1 = "Fluid.Pyrotheum"; + String str2 = "Enable this for Fluid Pyrotheum to be worse than lava."; + effect = true; + + str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards."; + enableSourceFall = true; + + return true; + } + + public void onEntityCollidedWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Entity paramEntity) + { + if (!effect) { + return; + } + if (ServerHelper.isClientWorld(paramWorld)) { + return; + } + if (!(paramEntity instanceof EntityPlayer)) { + if ((paramEntity instanceof EntityCreeper)) + { + paramWorld.createExplosion(paramEntity, paramEntity.posX, paramEntity.posY, paramEntity.posZ, 6.0F, paramEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + paramEntity.setDead(); + } + } + } + + public int getLightValue(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) + { + return TF_Fluids.fluidPyrotheum.getLuminosity(); + } + + public int getFireSpreadSpeed(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection) + { + return effect ? 800 : 0; + } + + public int getFlammability(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection) + { + return 0; + } + + public boolean isFlammable(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection) + { + return (effect) && (paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal()) && (paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this); + } + + public boolean isFireSource(World paramWorld, int paramInt1, int paramInt2, int paramInt3, ForgeDirection paramForgeDirection) + { + return effect; + } + + public void updateTick(World paramWorld, int paramInt1, int paramInt2, int paramInt3, Random paramRandom) + { + if (effect) { + checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3); + } + if ((enableSourceFall) && (paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0)) + { + Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3); + int i = paramWorld.getBlockMetadata(paramInt1, paramInt2 + this.densityDir, paramInt3); + if (((localBlock == this) && (i != 0)) || (localBlock.isFlammable(paramWorld, paramInt1, paramInt2 + this.densityDir, paramInt3, ForgeDirection.UP))) + { + paramWorld.setBlock(paramInt1, paramInt2 + this.densityDir, paramInt3, this, 0, 3); + paramWorld.setBlockToAir(paramInt1, paramInt2, paramInt3); + return; + } + } + super.updateTick(paramWorld, paramInt1, paramInt2, paramInt3, paramRandom); + } + + protected void checkForInteraction(World paramWorld, int paramInt1, int paramInt2, int paramInt3) + { + if (paramWorld.getBlock(paramInt1, paramInt2, paramInt3) != this) { + return; + } + int i = paramInt1; + int j = paramInt2; + int k = paramInt3; + for (int m = 0; m < 6; m++) + { + i = paramInt1 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][0]; + j = paramInt2 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][1]; + k = paramInt3 + cofh.lib.util.helpers.BlockHelper.SIDE_COORD_MOD[m][2]; + + interactWithBlock(paramWorld, i, j, k); + } + interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1); + interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1); + interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1); + interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1); + } + + protected void interactWithBlock(World paramWorld, int paramInt1, int paramInt2, int paramInt3) + { + Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3); + if ((localBlock == Blocks.air) || (localBlock == this)) { + return; + } + int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3); + if (hasInteraction(localBlock, i)) + { + BlockWrapper localBlockWrapper = getInteraction(localBlock, i); + paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, 3); + triggerInteractionEffects(paramWorld, paramInt1, paramInt2, paramInt3); + } + else if (localBlock.isFlammable(paramWorld, paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) + { + paramWorld.setBlock(paramInt1, paramInt2, paramInt3, Blocks.fire); + } + else if ((paramWorld.isSideSolid(paramInt1, paramInt2, paramInt3, ForgeDirection.UP)) && (paramWorld.isAirBlock(paramInt1, paramInt2 + 1, paramInt3))) + { + paramWorld.setBlock(paramInt1, paramInt2 + 1, paramInt3, Blocks.fire, 0, 3); + } + } + + protected void triggerInteractionEffects(World paramWorld, int paramInt1, int paramInt2, int paramInt3) + { + if (this.random.nextInt(16) == 0) { + paramWorld.playSoundEffect(paramInt1 + 0.5F, paramInt2 + 0.5F, paramInt3 + 0.5F, "random.fizz", 0.5F, 2.2F + (paramWorld.rand.nextFloat() - paramWorld.rand.nextFloat()) * 0.8F); + } + } +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Blocks.java b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Blocks.java new file mode 100644 index 0000000000..4dadc4b688 --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/block/TF_Blocks.java @@ -0,0 +1,26 @@ +package miscutil.core.intermod.thermalfoundation.block; + +import cofh.core.fluid.BlockFluidCoFHBase; + +public class TF_Blocks +{ + + public static BlockFluidCoFHBase blockFluidPyrotheum; + public static BlockFluidCoFHBase blockFluidCryotheum; + + + public static void preInit() + { + blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum(); + blockFluidCryotheum = new TF_Block_Fluid_Cryotheum(); + blockFluidPyrotheum.preInit(); + blockFluidCryotheum.preInit(); + } + + public static void init() {} + + public static void postInit() + { + + } +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/fluid/TF_Fluids.java b/src/Java/miscutil/core/intermod/thermalfoundation/fluid/TF_Fluids.java new file mode 100644 index 0000000000..7554a9a594 --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/fluid/TF_Fluids.java @@ -0,0 +1,42 @@ +package miscutil.core.intermod.thermalfoundation.fluid; + +import miscutil.core.intermod.thermalfoundation.item.TF_Items; +import net.minecraft.block.BlockDispenser; +import net.minecraft.init.Items; +import net.minecraft.item.EnumRarity; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import cofh.core.util.fluid.DispenserEmptyBucketHandler; +import cofh.core.util.fluid.DispenserFilledBucketHandler; + +public class TF_Fluids +{ + public static Fluid fluidPyrotheum; + public static Fluid fluidCryotheum; + + public static void preInit() + { + fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200).setTemperature(4000).setRarity(EnumRarity.rare); + fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000).setTemperature(50).setRarity(EnumRarity.rare); + registerFluid(fluidPyrotheum, "pyrotheum"); + registerFluid(fluidCryotheum, "cryotheum"); + } + + public static void init() {} + + public static void postInit() {} + + public static void registerFluid(Fluid paramFluid, String paramString) + { + if (!FluidRegistry.isFluidRegistered(paramString)) { + FluidRegistry.registerFluid(paramFluid); + } + paramFluid = FluidRegistry.getFluid(paramString); + } + + public static void registerDispenserHandlers() + { + BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler()); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler()); + } +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/item/TF_Items.java b/src/Java/miscutil/core/intermod/thermalfoundation/item/TF_Items.java new file mode 100644 index 0000000000..0853580c6b --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/item/TF_Items.java @@ -0,0 +1,66 @@ +package miscutil.core.intermod.thermalfoundation.item; + +import miscutil.core.creative.AddToCreativeTab; +import miscutil.core.intermod.thermalfoundation.block.TF_Blocks; +import miscutil.core.intermod.thermalfoundation.fluid.TF_Fluids; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import cofh.core.item.ItemBase; +import cofh.core.item.ItemBucket; +import cofh.core.util.energy.FurnaceFuelHandler; +import cofh.core.util.fluid.BucketHandler; +import cofh.lib.util.helpers.ItemHelper; + +public class TF_Items { + + public static ItemBase itemMaterial; + public static ItemStack rodBlizz; + public static ItemStack dustBlizz; + public static ItemStack dustPyrotheum; + public static ItemStack dustCryotheum; + public static ItemBucket itemBucket; + public static ItemStack bucketPyrotheum; + public static ItemStack bucketCryotheum; + + public static void preInit(){ + + + itemBucket = (ItemBucket)new ItemBucket("MiscUtils").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc); + itemMaterial = (ItemBase)new ItemBase("MiscUtils").setUnlocalizedName("material").setCreativeTab(AddToCreativeTab.tabMisc); + + bucketPyrotheum = itemBucket.addOreDictItem(6661, "bucketPyrotheum", 2); + bucketCryotheum = itemBucket.addOreDictItem(6662, "bucketCryotheum", 2); + dustPyrotheum = itemMaterial.addOreDictItem(6663, "dustPyrotheum", 2); + dustCryotheum = itemMaterial.addOreDictItem(6664, "dustCryotheum", 2); + + FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400); + + rodBlizz = itemMaterial.addOreDictItem(6665, "rodBlizz"); + dustBlizz = itemMaterial.addOreDictItem(6666, "dustBlizz"); + + + + } + + public static void init(){ + + BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, bucketPyrotheum); + BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, bucketCryotheum); + FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, bucketPyrotheum, FluidContainerRegistry.EMPTY_BUCKET); + FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, bucketCryotheum, FluidContainerRegistry.EMPTY_BUCKET); + + + } + + public static void postInit(){ + + ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustPyrotheum, 1), new Object[] { "dustCoal", "dustSulfur", "dustRedstone", Items.blaze_powder })); + ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" })); + //ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz, 2), new Object[] { "rodBlizz" })); + + + + } + +} diff --git a/src/Java/miscutil/core/intermod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/miscutil/core/intermod/thermalfoundation/recipe/TF_Gregtech_Recipes.java new file mode 100644 index 0000000000..75f50e7634 --- /dev/null +++ b/src/Java/miscutil/core/intermod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -0,0 +1,48 @@ +package miscutil.core.intermod.thermalfoundation.recipe; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import miscutil.core.intermod.thermalfoundation.item.TF_Items; +import miscutil.core.util.Utils; +import miscutil.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class TF_Gregtech_Recipes { + + public static void run(){ + start(); + } + + private static void start(){ + //Get Items to work with + Item dust_Cryotheum = TF_Items.dustCryotheum.getItem(); + Item dust_Pyrotheum = TF_Items.dustPyrotheum.getItem(); + Item dust_Blizz = TF_Items.dustBlizz.getItem(); + Item rod_Blizz = TF_Items.rodBlizz.getItem(); + + //Gelid Cryotheum + Utils.LOG_INFO("Adding Recipes for Gelid Cryotheum"); + GT_Values.RA.addFluidExtractionRecipe(new ItemStack(dust_Cryotheum, 6664, 1), GT_Values.NI, GT_Materials.Cryotheum.getFluid(250L), 10000, 32, 2); + GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), GT_Materials.Cryotheum.getFluid(200L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 2L), GT_Values.NI, GT_Values.NI, null, 400, 2); + + //Blizz Powder + Utils.LOG_INFO("Adding Recipes for Blizz Powder"); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 1), Materials.Redstone.getFluid(200L), new ItemStack(dust_Blizz, 6666, 1), GT_Values.NI, GT_Values.NI, null, 400, 2); + + //Blizz Rod + Utils.LOG_INFO("Adding Recipes for Blizz Rod"); + GT_ModHandler.addPulverisationRecipe(new ItemStack(rod_Blizz, 6665, 1), new ItemStack(dust_Blizz, 6666, 3), new ItemStack(Items.snowball, 1), 50, false); + + + //Blazing Pyrotheum + GT_Values.RA.addFluidExtractionRecipe(new ItemStack(dust_Pyrotheum, 6663, 1), GT_Values.NI, GT_Materials.Pyrotheum.getFluid(250L), 10000, 32, 2); + Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum"); + + } + +} diff --git a/src/Java/miscutil/core/lib/LoadedMods.java b/src/Java/miscutil/core/lib/LoadedMods.java index 7e234b970b..6baa6c115a 100644 --- a/src/Java/miscutil/core/lib/LoadedMods.java +++ b/src/Java/miscutil/core/lib/LoadedMods.java @@ -22,6 +22,7 @@ public class LoadedMods { public static boolean CompactWindmills = false; public static boolean Railcraft = false; public static boolean Growthcraft = false; + public static boolean CoFHCore = false; public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper @@ -31,6 +32,7 @@ public class LoadedMods { Utils.LOG_INFO("Looking for optional mod prereqs."); if (Loader.isModLoaded("gregtech") == true ){ Gregtech = true; + Utils.LOG_INFO("Components enabled for: Gregtech"); if (Gregtech){ try { CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder(); @@ -44,54 +46,72 @@ public class LoadedMods { } if (Loader.isModLoaded("EnderIO") == true){ EnderIO = true; + Utils.LOG_INFO("Components enabled for: EnderIO"); totalMods++; } if (Loader.isModLoaded("BigReactors") == true){ Big_Reactors = true; + Utils.LOG_INFO("Components enabled for: Big Reactors"); totalMods++; } if (Loader.isModLoaded("IC2") == true){ IndustrialCraft2 = true; + Utils.LOG_INFO("Components enabled for: IndustrialCraft2"); totalMods++; } if (Loader.isModLoaded("simplyjetpacks") == true){ Simply_Jetpacks = true; + Utils.LOG_INFO("Components enabled for: Simply Jetpacks"); totalMods++; } if (Loader.isModLoaded("rftools") == true){ RFTools = true; + Utils.LOG_INFO("Components enabled for: RFTools"); totalMods++; } if (Loader.isModLoaded("Thaumcraft") == true){ Thaumcraft = true; + Utils.LOG_INFO("Components enabled for: Thaumcraft"); totalMods++; } if (Loader.isModLoaded("ExtraUtilities") == true){ Extra_Utils = true; + Utils.LOG_INFO("Components enabled for: Extra_Utils"); totalMods++; } if (Loader.isModLoaded("PneumaticCraft") == true){ PneumaticCraft = true; + Utils.LOG_INFO("Components enabled for: PneumaticCraft"); totalMods++; } if (Loader.isModLoaded("MorePlanet") == true){ MorePlanets = true; + Utils.LOG_INFO("Components enabled for: MorePlanets"); totalMods++; } if (Loader.isModLoaded("ForbiddenMagic") == true){ ForbiddenMagic = true; + Utils.LOG_INFO("Components enabled for: ForbiddenMagic"); totalMods++; } if (Loader.isModLoaded("CompactWindmills") == true){ CompactWindmills = true; + Utils.LOG_INFO("Components enabled for: CompactWindmills"); totalMods++; } if (Loader.isModLoaded("Railcraft") == true){ Railcraft = true; + Utils.LOG_INFO("Components enabled for: Railcraft"); totalMods++; } if (Loader.isModLoaded("Growthcraft") == true){ Growthcraft = true; + Utils.LOG_INFO("Components enabled for: Growthcraft"); + totalMods++; + } + if (Loader.isModLoaded("CoFHCore") == true){ + CoFHCore = true; + Utils.LOG_INFO("Components enabled for: CoFHCore"); totalMods++; } diff --git a/src/Java/miscutil/gregtech/HANDLER_Gregtech.java b/src/Java/miscutil/gregtech/HANDLER_Gregtech.java new file mode 100644 index 0000000000..7d13ff7b36 --- /dev/null +++ b/src/Java/miscutil/gregtech/HANDLER_Gregtech.java @@ -0,0 +1,26 @@ +package miscutil.gregtech; + +import gregtech.api.util.GT_Config; +import miscutil.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; +import miscutil.gregtech.common.blocks.fluid.GregtechFluidHandler; + +public class HANDLER_Gregtech { + + public static GT_Config mMaterialProperties = null; + + public static void preInit(){ + if (mMaterialProperties != null){ + GT_Materials.init(mMaterialProperties); + } + GregtechFluidHandler.run(); + } + + public static void init(){ + + } + + public static void postInit(){ + + } + +} diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java index 6db2a06be7..4dfa9c674c 100644 --- a/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/miscutil/gregtech/api/enums/GregtechItemList.java @@ -78,7 +78,10 @@ public enum GregtechItemList implements GregtechItemContainer { Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, - Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; + Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM, + + //Blast Furnace Test + Machine_Electric_BlastFurnace; public static final GregtechItemList[] DYE_ONLY_ITEMS = { diff --git a/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java b/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java index 305f248345..76ca8c71fa 100644 --- a/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/Java/miscutil/gregtech/api/enums/GregtechOrePrefixes.java @@ -34,8 +34,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; public enum GregtechOrePrefixes { - /* Electric Components. - * + /* Electric Components. + * * usual Materials for this are: * Primitive (Tier 1) * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery @@ -47,241 +47,253 @@ public enum GregtechOrePrefixes { * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb * Infinite (Cheaty) */ - batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), - battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia - circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia - chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft - computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A whole Computer. "computerMaster" = ComputerCube - - //public static volatile int VERSION = 508; - - public final ArrayList mPrefixedItems = new ArrayList(); - public final short mTextureIndex; - public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; - public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; - public final List mAspects = new ArrayList(); - public final Collection mFamiliarPrefixes = new HashSet(); - /** - * Used to determine the amount of Material this Prefix contains. - * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot. - * 0 = Null - * Negative = Undefined Amount - */ - public final long mMaterialAmount; - private final Collection mNotGeneratedItems = new HashSet(), mIgnoredMaterials = new HashSet(), mGeneratedItems = new HashSet(); - private final ArrayList mOreProcessing = new ArrayList(); - public ItemStack mContainerItem = null; - public ICondition mCondition = null; - public byte mDefaultStackSize = 64; - public MaterialStack mSecondaryMaterial = null; - public GregtechOrePrefixes mPrefixInto = this; - public float mHeatDamage = 0.0F; // Negative for Frost Damage - /** - * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. - */ - public int mMaterialGenerationBits = 0; - private GregtechOrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { - mIsUnificatable = aIsUnificatable; - mIsMaterialBased = aIsMaterialBased; - mIsSelfReferencing = aIsSelfReferencing; - mIsContainer = aIsContainer; - mDontUnificateActively = aDontUnificateActively; - mIsUsedForBlocks = aIsUsedForBlocks; - mAllowNormalRecycling = aAllowNormalRecycling; - mGenerateDefaultItem = aGenerateDefaultItem; - mIsEnchantable = aIsEnchantable; - mIsUsedForOreProcessing = aIsUsedForOreProcessing; - mMaterialGenerationBits = aMaterialGenerationBits; - mMaterialAmount = aMaterialAmount; - mRegularLocalName = aRegularLocalName; - mLocalizedMaterialPre = aLocalizedMaterialPre; - mLocalizedMaterialPost = aLocalizedMaterialPost; - mDefaultStackSize = (byte) aDefaultStackSize; - mTextureIndex = (short) aTextureindex; - - if (name().startsWith("ore")) { - new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); - } else if (name().startsWith("wire") || name().startsWith("cable")) { - new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); - } else if (name().startsWith("dust")) { - new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects); - } else if (name().startsWith("crushed")) { - new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects); - } else if (name().startsWith("ingot") || name().startsWith("nugget")) { - new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects); - } else if (name().startsWith("armor")) { - new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects); - } else if (name().startsWith("stone")) { - new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); - } else if (name().startsWith("pipe")) { - new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects); - } else if (name().startsWith("gear")) { - new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects); - new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects); - } else if (name().startsWith("frame") || name().startsWith("plate")) { - new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects); - } else if (name().startsWith("tool")) { - new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects); - } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) { - new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects); - } else if (name().startsWith("crate")) { - new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects); - } else if (name().startsWith("circuit")) { - new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects); - } else if (name().startsWith("computer")) { - new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects); - } else if (name().startsWith("battery")) { - new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); - } - } - - public static GregtechOrePrefixes getOrePrefix(String aOre) { - for (GregtechOrePrefixes tPrefix : values()) - if (aOre.startsWith(tPrefix.toString())) { - return tPrefix; - } - return null; - } - - public static String stripPrefix(String aOre) { - for (GregtechOrePrefixes tPrefix : values()) { - if (aOre.startsWith(tPrefix.toString())) { - return aOre.replaceFirst(tPrefix.toString(), ""); - } - } - return aOre; - } - - public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) { - for (GregtechOrePrefixes tPrefix : values()) { - if (aOre.startsWith(tPrefix.toString())) { - return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString()); - } - } - return ""; - } - - public static GregtechOrePrefixes getPrefix(String aPrefixName) { - return getPrefix(aPrefixName, null); - } - - public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) { - Object tObject = GT_Utility.getFieldContent(GregtechOrePrefixes.class, aPrefixName, false, false); - if (tObject != null && tObject instanceof GregtechOrePrefixes) return (GregtechOrePrefixes) tObject; - return aReplacement; - } - - public static Materials getMaterial(String aOre) { - return Materials.get(stripPrefix(aOre)); - } - - public static Materials getMaterial(String aOre, GregtechOrePrefixes aPrefix) { - return Materials.get(aOre.replaceFirst(aPrefix.toString(), "")); - } - - public static Materials getRealMaterial(String aOre, GregtechOrePrefixes aPrefix) { - return Materials.getRealMaterial(aOre.replaceFirst(aPrefix.toString(), "")); - } - - public static boolean isInstanceOf(String aName, GregtechOrePrefixes aPrefix) { - return aName == null ? false : aName.startsWith(aPrefix.toString()); - } - - public boolean add(ItemStack aStack) { - if (aStack == null) return false; - if (!contains(aStack)) mPrefixedItems.add(aStack); - while (mPrefixedItems.contains(null)) mPrefixedItems.remove(null); - return true; - } - - public boolean contains(ItemStack aStack) { - if (aStack == null) return false; - for (ItemStack tStack : mPrefixedItems) - if (GT_Utility.areStacksEqual(aStack, tStack, !tStack.hasTagCompound())) return true; - return false; - } - - public boolean doGenerateItem(Materials aMaterial) { - return aMaterial != null && aMaterial != Materials._NULL && ((aMaterial.mTypes & mMaterialGenerationBits) != 0 || mGeneratedItems.contains(aMaterial)) && !mNotGeneratedItems.contains(aMaterial) && (mCondition == null || mCondition.isTrue(aMaterial)); - } - - public boolean ignoreMaterials(Materials... aMaterials) { - for (Materials tMaterial : aMaterials) if (tMaterial != null) mIgnoredMaterials.add(tMaterial); - return true; - } - - public boolean isIgnored(Materials aMaterial) { - if (aMaterial != null && (!aMaterial.mUnificatable || aMaterial != aMaterial.mMaterialInto)) return true; - return mIgnoredMaterials.contains(aMaterial); - } - - public boolean addFamiliarPrefix(GregtechOrePrefixes aPrefix) { - if (aPrefix == null || mFamiliarPrefixes.contains(aPrefix) || aPrefix == this) return false; - return mFamiliarPrefixes.add(aPrefix); - } - - public boolean add(Interface_OreRecipeRegistrator aRegistrator) { - if (aRegistrator == null) return false; - return mOreProcessing.add(aRegistrator); - } - - public void processOre(Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if (aMaterial != null && (aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) && GT_Utility.isStackValid(aStack)) - for (Interface_OreRecipeRegistrator tRegistrator : mOreProcessing) { - if (D2) - GT_Log.ore.println("Processing '" + aOreDictName + "' with the Prefix '" + name() + "' and the Material '" + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); - tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); - } - } - - public Object get(Object aMaterial) { - if (aMaterial instanceof Materials) return new GregtechItemData(this, (Materials) aMaterial); - return name() + aMaterial; - } - - @SuppressWarnings("incomplete-switch") - public String getDefaultLocalNameForItem(Materials aMaterial) { - - - // Use Standard Localization - return mLocalizedMaterialPre + aMaterial.mDefaultLocalName + mLocalizedMaterialPost; - } - - public enum GT_Materials implements IColorModulationContainer, ISubTagContainer { - - - - /** - * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen. - *

- * Mainly for preventing NullPointer Exceptions and providing Default Values. - */ - _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, Element._NULL, Arrays.asList(new TC_AspectStack(TC_Aspects.VACUOS, 1))), - - - /** - * Circuitry, Batteries and other Technical things - */ - Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 4), new TC_AspectStack(TC_Aspects.MACHINA, 4))), - Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 6), new TC_AspectStack(TC_Aspects.MACHINA, 6))), - Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 8), new TC_AspectStack(TC_Aspects.MACHINA, 8))); - - /*Advanced(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "Advanced", 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeLightGray, Arrays.asList(new TC_AspectStack(TC_Aspects.MACHINA, 4))), + batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), + battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia + circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Calclavia + chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced by Buildcraft + computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1); // A whole Computer. "computerMaster" = ComputerCube + + //public static volatile int VERSION = 508; + + public final ArrayList mPrefixedItems = new ArrayList(); + public final short mTextureIndex; + public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; + public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; + public final List mAspects = new ArrayList(); + public final Collection mFamiliarPrefixes = new HashSet(); + /** + * Used to determine the amount of Material this Prefix contains. + * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot. + * 0 = Null + * Negative = Undefined Amount + */ + public final long mMaterialAmount; + private final Collection mNotGeneratedItems = new HashSet(), mIgnoredMaterials = new HashSet(), mGeneratedItems = new HashSet(); + private final ArrayList mOreProcessing = new ArrayList(); + public ItemStack mContainerItem = null; + public ICondition mCondition = null; + public byte mDefaultStackSize = 64; + public MaterialStack mSecondaryMaterial = null; + public GregtechOrePrefixes mPrefixInto = this; + public float mHeatDamage = 0.0F; // Negative for Frost Damage + /** + * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. + */ + public int mMaterialGenerationBits = 0; + private GregtechOrePrefixes(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { + mIsUnificatable = aIsUnificatable; + mIsMaterialBased = aIsMaterialBased; + mIsSelfReferencing = aIsSelfReferencing; + mIsContainer = aIsContainer; + mDontUnificateActively = aDontUnificateActively; + mIsUsedForBlocks = aIsUsedForBlocks; + mAllowNormalRecycling = aAllowNormalRecycling; + mGenerateDefaultItem = aGenerateDefaultItem; + mIsEnchantable = aIsEnchantable; + mIsUsedForOreProcessing = aIsUsedForOreProcessing; + mMaterialGenerationBits = aMaterialGenerationBits; + mMaterialAmount = aMaterialAmount; + mRegularLocalName = aRegularLocalName; + mLocalizedMaterialPre = aLocalizedMaterialPre; + mLocalizedMaterialPost = aLocalizedMaterialPost; + mDefaultStackSize = (byte) aDefaultStackSize; + mTextureIndex = (short) aTextureindex; + + if (name().startsWith("ore")) { + new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + } else if (name().startsWith("wire") || name().startsWith("cable")) { + new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + } else if (name().startsWith("dust")) { + new TC_AspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects); + } else if (name().startsWith("crushed")) { + new TC_AspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects); + } else if (name().startsWith("ingot") || name().startsWith("nugget")) { + new TC_AspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects); + } else if (name().startsWith("armor")) { + new TC_AspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects); + } else if (name().startsWith("stone")) { + new TC_AspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects); + } else if (name().startsWith("pipe")) { + new TC_AspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects); + } else if (name().startsWith("gear")) { + new TC_AspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects); + new TC_AspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects); + } else if (name().startsWith("frame") || name().startsWith("plate")) { + new TC_AspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects); + } else if (name().startsWith("tool")) { + new TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects); + } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) { + new TC_AspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects); + } else if (name().startsWith("crate")) { + new TC_AspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects); + } else if (name().startsWith("circuit")) { + new TC_AspectStack(TC_Aspects.COGNITIO, 1).addToAspectList(mAspects); + } else if (name().startsWith("computer")) { + new TC_AspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects); + } else if (name().startsWith("battery")) { + new TC_AspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects); + } + } + + public static GregtechOrePrefixes getOrePrefix(String aOre) { + for (GregtechOrePrefixes tPrefix : values()) + if (aOre.startsWith(tPrefix.toString())) { + return tPrefix; + } + return null; + } + + public static String stripPrefix(String aOre) { + for (GregtechOrePrefixes tPrefix : values()) { + if (aOre.startsWith(tPrefix.toString())) { + return aOre.replaceFirst(tPrefix.toString(), ""); + } + } + return aOre; + } + + public static String replacePrefix(String aOre, GregtechOrePrefixes aPrefix) { + for (GregtechOrePrefixes tPrefix : values()) { + if (aOre.startsWith(tPrefix.toString())) { + return aOre.replaceFirst(tPrefix.toString(), aPrefix.toString()); + } + } + return ""; + } + + public static GregtechOrePrefixes getPrefix(String aPrefixName) { + return getPrefix(aPrefixName, null); + } + + public static GregtechOrePrefixes getPrefix(String aPrefixName, GregtechOrePrefixes aReplacement) {