diff options
author | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
---|---|---|
committer | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
commit | 0669f5eb9d5029a8b94ec552171b0837605f7747 (patch) | |
tree | 6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/thermalfoundation | |
parent | 3654052fb63a571c5eaca7f20714b87c17f7e966 (diff) | |
download | GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2 GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip |
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/thermalfoundation')
7 files changed, 484 insertions, 476 deletions
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java index 6804737ebf..36cac34040 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java @@ -6,32 +6,32 @@ import gtPlusPlus.xmod.thermalfoundation.fluid.TF_Fluids; import gtPlusPlus.xmod.thermalfoundation.item.TF_Items; import gtPlusPlus.xmod.thermalfoundation.recipe.TF_Gregtech_Recipes; -public class HANDLER_TF{ +public class HANDLER_TF { - public static void preInit(){ - if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){ - TF_Fluids.preInit(); - TF_Items.preInit(); - TF_Blocks.preInit(); - } - } - - public static void init(){ - if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){ + public static void init() { + if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) { TF_Fluids.init(); - TF_Blocks.init(); + TF_Blocks.init(); TF_Items.init(); - } + } } - public static void postInit(){ - if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation){ + public static void postInit() { + if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) { TF_Fluids.postInit(); TF_Items.postInit(); TF_Blocks.postInit(); - if(LoadedMods.Gregtech){ + if (LoadedMods.Gregtech) { TF_Gregtech_Recipes.run(); - } - } - } + } + } + } + + public static void preInit() { + if (LoadedMods.CoFHCore && !LoadedMods.ThermalFoundation) { + TF_Fluids.preInit(); + TF_Items.preInit(); + TF_Blocks.preInit(); + } + } } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java index 2ced241f98..3e8bbbc64b 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java @@ -21,163 +21,160 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -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(CORE.MODID, 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) {} +public class TF_Block_Fluid_Cryotheum extends BlockFluidInteractive { + 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; + Random random = new Random(); + + public TF_Block_Fluid_Cryotheum() { + super(CORE.MODID, TF_Fluids.fluidCryotheum, TF_Block_Fluid_Cryotheum.materialFluidCryotheum, "cryotheum"); + this.setQuantaPerBlock(5); + this.setTickRate(15); + + this.setHardness(1000.0F); + this.setLightOpacity(1); + this.setParticleColor(0.15F, 0.7F, 1.0F); + } + + protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2, + final 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]; + + this.interactWithBlock(paramWorld, i, j, k); + } + this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1); + this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1); + this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1); + this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1); + } + + @Override + public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, + final int paramInt3) { + return TF_Fluids.fluidCryotheum.getLuminosity(); + } + + protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, + final int paramInt3) { + final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3); + if (localBlock == Blocks.air || localBlock == this) { + return; + } + final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3); + if (this.hasInteraction(localBlock, i)) { + final BlockWrapper localBlockWrapper = this.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); + } + } + + @Override + public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, + final int paramInt3, final Entity paramEntity) { + paramEntity.extinguish(); + if (!TF_Block_Fluid_Cryotheum.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) { + final 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 { + final boolean bool = paramEntity.velocityChanged; + paramEntity.attackEntityFrom(DamageHelper.cryotheum, 2.0F); + paramEntity.velocityChanged = bool; + } + } + + @Override + public boolean preInit() { + GameRegistry.registerBlock(this, "FluidCryotheum"); + + this.addInteraction(Blocks.grass, Blocks.dirt); + this.addInteraction(Blocks.water, 0, Blocks.ice); + this.addInteraction(Blocks.water, Blocks.snow); + this.addInteraction(Blocks.flowing_water, 0, Blocks.ice); + this.addInteraction(Blocks.flowing_water, Blocks.snow); + this.addInteraction(Blocks.lava, 0, Blocks.obsidian); + this.addInteraction(Blocks.lava, Blocks.stone); + this.addInteraction(Blocks.flowing_lava, 0, Blocks.obsidian); + this.addInteraction(Blocks.flowing_lava, Blocks.stone); + this.addInteraction(Blocks.leaves, Blocks.air); + this.addInteraction(Blocks.tallgrass, Blocks.air); + this.addInteraction(Blocks.fire, Blocks.air); + // addInteraction(TFBlocks.blockFluidGlowstone, 0, Blocks.glowstone); + + final String str1 = "Fluid.Cryotheum"; + String str2 = "Enable this for Fluid Cryotheum to be worse than lava, except cold."; + TF_Block_Fluid_Cryotheum.effect = true; + + str2 = "Enable this for Fluid Cryotheum Source blocks to gradually fall downwards."; + TF_Block_Fluid_Cryotheum.enableSourceFall = true; + + return true; + } + + protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2, + final int paramInt3) { + } + + @Override + public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, + final Random paramRandom) { + if (TF_Block_Fluid_Cryotheum.effect) { + this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3); + } + if (TF_Block_Fluid_Cryotheum.enableSourceFall + && paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0) { + final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3); + final 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); + } } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java index 3e8c749370..72fd99f181 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java @@ -18,162 +18,166 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -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(CORE.MODID, 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); - } - } +public class TF_Block_Fluid_Pyrotheum extends BlockFluidInteractive { + 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; + Random random = new Random(); + + public TF_Block_Fluid_Pyrotheum() { + super(CORE.MODID, TF_Fluids.fluidPyrotheum, Material.lava, "pyrotheum"); + this.setQuantaPerBlock(5); + this.setTickRate(10); + + this.setHardness(1000.0F); + this.setLightOpacity(1); + this.setParticleColor(1.0F, 0.7F, 0.15F); + } + + protected void checkForInteraction(final World paramWorld, final int paramInt1, final int paramInt2, + final 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]; + + this.interactWithBlock(paramWorld, i, j, k); + } + this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 - 1); + this.interactWithBlock(paramWorld, paramInt1 - 1, paramInt2, paramInt3 + 1); + this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 - 1); + this.interactWithBlock(paramWorld, paramInt1 + 1, paramInt2, paramInt3 + 1); + } + + @Override + public int getFireSpreadSpeed(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, + final int paramInt3, final ForgeDirection paramForgeDirection) { + return TF_Block_Fluid_Pyrotheum.effect ? 800 : 0; + } + + @Override + public int getFlammability(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, + final int paramInt3, final ForgeDirection paramForgeDirection) { + return 0; + } + + @Override + public int getLightValue(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, + final int paramInt3) { + return TF_Fluids.fluidPyrotheum.getLuminosity(); + } + + protected void interactWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, + final int paramInt3) { + final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2, paramInt3); + if (localBlock == Blocks.air || localBlock == this) { + return; + } + final int i = paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3); + if (this.hasInteraction(localBlock, i)) { + final BlockWrapper localBlockWrapper = this.getInteraction(localBlock, i); + paramWorld.setBlock(paramInt1, paramInt2, paramInt3, localBlockWrapper.block, localBlockWrapper.metadata, + 3); + this.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); + } + } + + @Override + public boolean isFireSource(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, + final ForgeDirection paramForgeDirection) { + return TF_Block_Fluid_Pyrotheum.effect; + } + + @Override + public boolean isFlammable(final IBlockAccess paramIBlockAccess, final int paramInt1, final int paramInt2, + final int paramInt3, final ForgeDirection paramForgeDirection) { + return TF_Block_Fluid_Pyrotheum.effect && paramForgeDirection.ordinal() > ForgeDirection.UP.ordinal() + && paramIBlockAccess.getBlock(paramInt1, paramInt2 - 1, paramInt3) != this; + } + + @Override + public void onEntityCollidedWithBlock(final World paramWorld, final int paramInt1, final int paramInt2, + final int paramInt3, final Entity paramEntity) { + if (!TF_Block_Fluid_Pyrotheum.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(); + } + } + } + + @Override + public boolean preInit() { + GameRegistry.registerBlock(this, "FluidPyrotheum"); + + this.addInteraction(Blocks.cobblestone, Blocks.stone); + this.addInteraction(Blocks.grass, Blocks.dirt); + this.addInteraction(Blocks.sand, Blocks.glass); + this.addInteraction(Blocks.water, Blocks.stone); + this.addInteraction(Blocks.flowing_water, Blocks.stone); + this.addInteraction(Blocks.clay, Blocks.hardened_clay); + this.addInteraction(Blocks.ice, Blocks.stone); + this.addInteraction(Blocks.snow, Blocks.air); + this.addInteraction(Blocks.snow_layer, Blocks.air); + for (int i = 0; i < 8; i++) { + this.addInteraction(Blocks.stone_stairs, i, Blocks.stone_brick_stairs, i); + } + final String str1 = "Fluid.Pyrotheum"; + String str2 = "Enable this for Fluid Pyrotheum to be worse than lava."; + TF_Block_Fluid_Pyrotheum.effect = true; + + str2 = "Enable this for Fluid Pyrotheum Source blocks to gradually fall downwards."; + TF_Block_Fluid_Pyrotheum.enableSourceFall = true; + + return true; + } + + protected void triggerInteractionEffects(final World paramWorld, final int paramInt1, final int paramInt2, + final 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); + } + } + + @Override + public void updateTick(final World paramWorld, final int paramInt1, final int paramInt2, final int paramInt3, + final Random paramRandom) { + if (TF_Block_Fluid_Pyrotheum.effect) { + this.checkForInteraction(paramWorld, paramInt1, paramInt2, paramInt3); + } + if (TF_Block_Fluid_Pyrotheum.enableSourceFall + && paramWorld.getBlockMetadata(paramInt1, paramInt2, paramInt3) == 0) { + final Block localBlock = paramWorld.getBlock(paramInt1, paramInt2 + this.densityDir, paramInt3); + final 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); + } } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java index 867f8c7f7d..1fccf3bb8c 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java @@ -2,25 +2,22 @@ package gtPlusPlus.xmod.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() - { - - } +public class TF_Blocks { + + public static BlockFluidCoFHBase blockFluidPyrotheum; + public static BlockFluidCoFHBase blockFluidCryotheum; + + public static void init() { + } + + public static void postInit() { + + } + + public static void preInit() { + TF_Blocks.blockFluidPyrotheum = new TF_Block_Fluid_Pyrotheum(); + TF_Blocks.blockFluidCryotheum = new TF_Block_Fluid_Cryotheum(); + TF_Blocks.blockFluidPyrotheum.preInit(); + TF_Blocks.blockFluidCryotheum.preInit(); + } } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java index 0647deb1dd..1472d0d1f0 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java @@ -11,57 +11,57 @@ import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -public class TF_Fluids -{ - public static Fluid fluidPyrotheum; - public static Fluid fluidCryotheum; +public class TF_Fluids { + public static Fluid fluidPyrotheum; + public static Fluid fluidCryotheum; - public static void preInit() - { - if (!LoadedMods.ThermalFoundation){ - Utils.LOG_INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT"); - Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum"); - Fluid cryotheum = FluidRegistry.getFluid("cryotheum"); - - if (pyrotheum == null){ - Utils.LOG_INFO("Registering Blazing Pyrotheum as it does not exist."); - fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200).setTemperature(4000).setRarity(EnumRarity.rare); - registerFluid(fluidPyrotheum, "pyrotheum"); - } - else { - Utils.LOG_INFO("Registering Blazing Pyrotheum as it is an already existing Fluid."); - fluidPyrotheum = pyrotheum; - } - if (cryotheum == null){ - Utils.LOG_INFO("Registering Gelid Cryotheum as it does not exist."); - fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000).setTemperature(50).setRarity(EnumRarity.rare); - registerFluid(fluidCryotheum, "cryotheum"); - } - else { - Utils.LOG_INFO("Registering Gelid Cryotheum as it is an already existing Fluid."); - fluidCryotheum = cryotheum; - } + public static void init() { + } + + public static void postInit() { + } + + public static void preInit() { + if (!LoadedMods.ThermalFoundation) { + Utils.LOG_INFO("Adding in our own versions of Thermal Foundation Fluids - Non-GT"); + final Fluid pyrotheum = FluidRegistry.getFluid("pyrotheum"); + final Fluid cryotheum = FluidRegistry.getFluid("cryotheum"); + + if (pyrotheum == null) { + Utils.LOG_INFO("Registering Blazing Pyrotheum as it does not exist."); + TF_Fluids.fluidPyrotheum = new Fluid("pyrotheum").setLuminosity(15).setDensity(2000).setViscosity(1200) + .setTemperature(4000).setRarity(EnumRarity.rare); + TF_Fluids.registerFluid(TF_Fluids.fluidPyrotheum, "pyrotheum"); + } + else { + Utils.LOG_INFO("Registering Blazing Pyrotheum as it is an already existing Fluid."); + TF_Fluids.fluidPyrotheum = pyrotheum; + } + if (cryotheum == null) { + Utils.LOG_INFO("Registering Gelid Cryotheum as it does not exist."); + TF_Fluids.fluidCryotheum = new Fluid("cryotheum").setLuminosity(0).setDensity(4000).setViscosity(3000) + .setTemperature(50).setRarity(EnumRarity.rare); + TF_Fluids.registerFluid(TF_Fluids.fluidCryotheum, "cryotheum"); + } + else { + Utils.LOG_INFO("Registering Gelid Cryotheum as it is an already existing Fluid."); + TF_Fluids.fluidCryotheum = cryotheum; + } } else { Utils.LOG_INFO("Thermal Foundation is already loaded, no need to add our own Cryotheum/Pyrotheum."); } } - public static void init() {} - - public static void postInit() {} + public static void registerDispenserHandlers() { + BlockDispenser.dispenseBehaviorRegistry.putObject(TF_Items.itemBucket, new DispenserFilledBucketHandler()); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new DispenserEmptyBucketHandler()); + } - public static void registerFluid(Fluid paramFluid, String paramString) - { + public static void registerFluid(Fluid paramFluid, final 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/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java index 89a6b12ccc..5d5d3d12f2 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java @@ -15,64 +15,67 @@ import net.minecraftforge.fluids.FluidContainerRegistry; 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 ItemStack itemDustBlizz; - public static ItemStack itemDustPyrotheum; - public static ItemStack itemDustCryotheum; - public static ItemStack itemRodBlizz; - - 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(1, "bucketPyrotheum"); - bucketCryotheum = itemBucket.addOreDictItem(2, "bucketCryotheum"); - rodBlizz = itemMaterial.addOreDictItem(1, "rodBlizz"); - dustBlizz = itemMaterial.addOreDictItem(2, "dustBlizz"); - dustPyrotheum = itemMaterial.addOreDictItem(3, "dustPyrotheum"); - dustCryotheum = itemMaterial.addOreDictItem(4, "dustCryotheum"); - - FurnaceFuelHandler.registerFuel(dustPyrotheum, 2400); - - - itemRodBlizz = ItemUtils.simpleMetaStack(itemMaterial, 1, 1); - itemDustBlizz = ItemUtils.simpleMetaStack(itemMaterial, 2, 1); - itemDustPyrotheum = ItemUtils.simpleMetaStack(itemMaterial, 3, 1); - itemDustCryotheum = ItemUtils.simpleMetaStack(itemMaterial, 4, 1); - - + 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 ItemStack itemDustBlizz; + public static ItemStack itemDustPyrotheum; + public static ItemStack itemDustCryotheum; + public static ItemStack itemRodBlizz; + + public static void init() { + + BucketHandler.registerBucket(TF_Blocks.blockFluidPyrotheum, 0, TF_Items.bucketPyrotheum); + BucketHandler.registerBucket(TF_Blocks.blockFluidCryotheum, 0, TF_Items.bucketCryotheum); + FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidPyrotheum, TF_Items.bucketPyrotheum, + FluidContainerRegistry.EMPTY_BUCKET); + FluidContainerRegistry.registerFluidContainer(TF_Fluids.fluidCryotheum, TF_Items.bucketCryotheum, + FluidContainerRegistry.EMPTY_BUCKET); } - 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(TF_Items.dustPyrotheum, 1), new Object[] { + "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze" + })); + ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(TF_Items.dustCryotheum, 1), new Object[] { + Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" + })); + ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(TF_Items.dustCryotheum, 1), new Object[] { + Items.snowball, "dustNitor", "dustRedstone", "dustBlizz" + })); + // ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz, + // 2), new Object[] { "rodBlizz" })); } - public static void postInit(){ + public static void preInit() { + + TF_Items.itemBucket = (ItemBucket) new ItemBucket("MiscUtils").setUnlocalizedName("bucket") + .setCreativeTab(AddToCreativeTab.tabMisc); + TF_Items.itemMaterial = (ItemBase) new ItemBase("MiscUtils").setUnlocalizedName("material") + .setCreativeTab(AddToCreativeTab.tabMisc); - ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustPyrotheum, 1), new Object[] { "dustCoal", "dustSulfur", "dustRedstone", "dustBlaze" })); - ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustSaltpeter", "dustRedstone", "dustBlizz" })); - ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustCryotheum, 1), new Object[] { Items.snowball, "dustNitor", "dustRedstone", "dustBlizz" })); - //ItemHelper.addRecipe(ItemHelper.ShapelessRecipe(ItemHelper.cloneStack(dustBlizz, 2), new Object[] { "rodBlizz" })); + TF_Items.bucketPyrotheum = TF_Items.itemBucket.addOreDictItem(1, "bucketPyrotheum"); + TF_Items.bucketCryotheum = TF_Items.itemBucket.addOreDictItem(2, "bucketCryotheum"); + TF_Items.rodBlizz = TF_Items.itemMaterial.addOreDictItem(1, "rodBlizz"); + TF_Items.dustBlizz = TF_Items.itemMaterial.addOreDictItem(2, "dustBlizz"); + TF_Items.dustPyrotheum = TF_Items.itemMaterial.addOreDictItem(3, "dustPyrotheum"); + TF_Items.dustCryotheum = TF_Items.itemMaterial.addOreDictItem(4, "dustCryotheum"); + FurnaceFuelHandler.registerFuel(TF_Items.dustPyrotheum, 2400); + TF_Items.itemRodBlizz = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 1, 1); + TF_Items.itemDustBlizz = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 1); + TF_Items.itemDustPyrotheum = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 3, 1); + TF_Items.itemDustCryotheum = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 4, 1); } diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java index 5bce19d85a..2d3facb543 100644 --- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java @@ -13,47 +13,54 @@ import net.minecraftforge.fluids.FluidStack; public class TF_Gregtech_Recipes { - public static void run(){ - start(); + private static FluidStack getFluidStack(final String fluidName, final int amount) { + Utils.LOG_WARNING("Trying to get a fluid stack of " + fluidName); + try { + return FluidRegistry.getFluidStack(fluidName, amount); + } + catch (final Throwable e) { + return null; + } + + } + + public static void run() { + TF_Gregtech_Recipes.start(); } - private static void start(){ - //Get Items to work with - ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy(); - ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy(); - ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy(); - ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3); - ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy(); - FluidStack moltenRedstone = getFluidStack("molten.redstone", 250); + private static void start() { + // Get Items to work with + final ItemStack dust_Cryotheum = TF_Items.itemDustCryotheum.copy(); + final ItemStack dust_Pyrotheum = TF_Items.itemDustPyrotheum.copy(); + final ItemStack dust_Blizz = TF_Items.itemDustBlizz.copy(); + final ItemStack dust_Blizz3 = ItemUtils.simpleMetaStack(TF_Items.itemMaterial, 2, 3); + final ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy(); + final FluidStack moltenRedstone = TF_Gregtech_Recipes.getFluidStack("molten.redstone", 250); - //Gelid Cryotheum + // Gelid Cryotheum Utils.LOG_INFO("Adding Recipes for Gelid Cryotheum"); - GT_Values.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 10000, 200, 240); - GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 200), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30); + GT_Values.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, + TF_Gregtech_Recipes.getFluidStack("cryotheum", 250), 10000, 200, 240); + GT_Values.RA.addChemicalBathRecipe(GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L), + TF_Gregtech_Recipes.getFluidStack("cryotheum", 200), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, + 400, 30); - //Blizz Powder + // Blizz Powder Utils.LOG_INFO("Adding Recipes for Blizz Powder"); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenRedstone, dust_Blizz, GT_Values.NI, GT_Values.NI, null, 400, 240); + GT_Values.RA.addChemicalBathRecipe(new ItemStack(Items.snowball, 4), moltenRedstone, dust_Blizz, GT_Values.NI, + GT_Values.NI, null, 400, 240); - //Blizz Rod + // Blizz Rod Utils.LOG_INFO("Adding Recipes for Blizz Rod"); - GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, (int) Math.max((Materials.Blaze.getMass()*4) * 3L, 1L)); + GT_Values.RA.addVacuumFreezerRecipe(new ItemStack(Items.blaze_rod), rod_Blizz, + (int) Math.max(Materials.Blaze.getMass() * 4 * 3L, 1L)); GT_ModHandler.addPulverisationRecipe(rod_Blizz, dust_Blizz3, new ItemStack(Items.snowball, 1), 50, false); - //Blazing Pyrotheum - Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum"); - GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 10000, 200, 240); - - } - - private static FluidStack getFluidStack(String fluidName, int amount){ - Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName); - try { - return FluidRegistry.getFluidStack(fluidName, amount); - } - catch (Throwable e){ - return null; - } + // Blazing Pyrotheum + Utils.LOG_INFO("Adding Recipes for Blazing Pyrotheum"); + GT_Values.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, + TF_Gregtech_Recipes.getFluidStack("pyrotheum", 250), 10000, 200, 240); } |