From 366b7e1c9a0a71356cfecd2875c075121e991d6a Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Mon, 2 Feb 2015 21:27:31 +0000 Subject: [PATCH] Thermalily rebalance. --- .../generating/SubTileHydroangeas.java | 46 +++++++++++++++++-- .../subtile/generating/SubTileThermalily.java | 14 +++--- .../common/core/handler/ConfigHandler.java | 4 -- .../common/crafting/ModPetalRecipes.java | 2 +- .../botania/common/lexicon/LexiconData.java | 4 +- .../resources/assets/botania/lang/en_US.lang | 3 +- 6 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index 555311636..572b8a56f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -10,25 +10,39 @@ */ package vazkii.botania.common.block.subtile.generating; +import java.util.ArrayList; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.SubTileGenerating; import vazkii.botania.common.Botania; +import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.lexicon.LexiconData; public class SubTileHydroangeas extends SubTileGenerating { private static final String TAG_BURN_TIME = "burnTime"; - int burnTime = 0; + private static final String TAG_COOLDOWN = "cooldown"; + + int burnTime, cooldown; @Override public void onUpdate() { super.onUpdate(); + if(cooldown > 0) { + cooldown--; + for(int i = 0; i < 3; i++) + Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); + return; + } + boolean didSomething = false; if(burnTime == 0) { @@ -59,15 +73,19 @@ public class SubTileHydroangeas extends SubTileGenerating { burnTime += getBurnTime(); playSound(); } - - if(didSomething) - sync(); } } else { if(supertile.getWorldObj().rand.nextInt(8) == 0) doBurnParticles(); burnTime--; + if(burnTime == 0) { + cooldown = getCooldown(); + didSomething = true; + } } + + if(didSomething) + sync(); } @Override @@ -115,6 +133,7 @@ public class SubTileHydroangeas extends SubTileGenerating { super.writeToPacketNBT(cmp); cmp.setInteger(TAG_BURN_TIME, burnTime); + cmp.setInteger(TAG_COOLDOWN, cooldown); } @Override @@ -122,8 +141,23 @@ public class SubTileHydroangeas extends SubTileGenerating { super.readFromPacketNBT(cmp); burnTime = cmp.getInteger(TAG_BURN_TIME); + cooldown = cmp.getInteger(TAG_COOLDOWN); } + @Override + public ArrayList getDrops(ArrayList list) { + ArrayList drops = super.getDrops(list); + if(cooldown > 0) + ItemNBTHelper.setInt(drops.get(0), TAG_COOLDOWN, getCooldown()); + return drops; + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { + super.onBlockPlacedBy(world, x, y, z, entity, stack); + cooldown = ItemNBTHelper.getInt(stack, TAG_COOLDOWN, 0); + } + @Override public boolean canGeneratePassively() { return burnTime > 0; @@ -134,5 +168,9 @@ public class SubTileHydroangeas extends SubTileGenerating { boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering()); return rain ? 3 : 4; } + + public int getCooldown() { + return 0; + } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java index d185c7d10..b0d941bdd 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java @@ -44,11 +44,6 @@ public class SubTileThermalily extends SubTileHydroangeas { return Blocks.lava; } - @Override - public Block getBlockToSearchBelow() { - return ConfigHandler.thermalilyObsidian ? Blocks.obsidian : null; - } - @Override public void playSound() { supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F); @@ -61,17 +56,22 @@ public class SubTileThermalily extends SubTileHydroangeas { @Override public int getBurnTime() { - return 3500; + return 875; } @Override public int getValueForPassiveGeneration() { - return 2; + return 12; } @Override public int getMaxMana() { return 250; } + + @Override + public int getCooldown() { + return 9600; + } } diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 6996ed022..829dc4665 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -50,7 +50,6 @@ public final class ConfigHandler { public static int spreaderPositionShift = 1; public static boolean flowerForceCheck = true; public static boolean enderPickpocketEnabled = true; - public static boolean thermalilyObsidian = false; public static int hardcorePassiveGeneration = -1; public static boolean fallenKanadeEnabled = true; @@ -144,9 +143,6 @@ public final class ConfigHandler { desc = "Set to false to disable the ability for the Hand of Ender to pickpocket other players' ender chests."; enderPickpocketEnabled = loadPropBool("enderPickpocket.enabled", desc, enderPickpocketEnabled); - desc = "Set to true to only allow the Thermalily to absorb Lava if there's Obsidian below it. Another config option for the Blood Magic balance freaks."; - thermalilyObsidian = loadPropBool("thermalily.obsidian", desc, thermalilyObsidian); - desc = "Set to anything other than -1 for passive generation flowers (dayblooms, nightshades, hydroangeas) to die after a specific amount of ticks. 24000 is 2 minecraft days, that's a recomended value."; hardcorePassiveGeneration = loadPropInt("passiveWither.time", desc, hardcorePassiveGeneration); diff --git a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java index c8fff0bc7..c3676f0c2 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -77,7 +77,7 @@ public final class ModPetalRecipes { nightshadeRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_NIGHTSHADE), black, black, purple, gray); endoflameRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENDOFLAME), brown, red, redMana, brownMana, lightGray); hydroangeasRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HYDROANGEAS), blueMana, blue, pink, cyan, cyan, cyanMana); - thermalilyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_THERMALILY), red, orangeMana, orange, runeEarth, runeFire, pixieDust); + thermalilyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_THERMALILY), red, orangeMana, orange, runeEarth, runeFire); arcaneRoseRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ARCANE_ROSE), pink, pinkMana, pinkMana, lime, purple, purpleMana, runeMana); munchdewRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MUNCHDEW), lime, limeMana, green, red, redMana, white, whiteMana, runeGluttony); entropinnyumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENTROPINNYUM), red, redMana, gray, grayMana, white, whiteMana, runeWrath, runeFire); diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 1b76785d1..998c5df47 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -420,8 +420,8 @@ public final class LexiconData { hydroangeas = new BLexiconEntry(LibLexicon.GFLOWER_HYDROANGEAS, categoryGenerationFlowers); hydroangeas.setLexiconPages(new PageText(ConfigHandler.hardcorePassiveGeneration > 0 ? "0a" : "0"), new PageImage("2", LibResources.ENTRY_HYDROANGEAS), new PagePetalRecipe("1", ModPetalRecipes.hydroangeasRecipe)); - thermalily = new ALexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers); - thermalily.setLexiconPages(new PageText(ConfigHandler.thermalilyObsidian ? "0a" : "0"), new PagePetalRecipe("1", ModPetalRecipes.thermalilyRecipe)); + thermalily = new BLexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers); + thermalily.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.thermalilyRecipe)); arcaneRose = new BLexiconEntry(LibLexicon.GFLOWER_ARCANE_ROSE, categoryGenerationFlowers); arcaneRose.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.arcaneRoseRecipe)); diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index af82f4817..1cdce7150 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1439,8 +1439,7 @@ botania.page.hydroangeas1=&oFrom some Hyperdimension&r? # -- THERMALILY botania.entry.thermalily=Thermalily -botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0. -botania.page.thermalily0a=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0.
Due to the heat the &1Lava&0 produces, there must be a block of &1Obsidian&0 below it for it to be absorbed. +botania.page.thermalily0=There comes a point where slow generating power, like the &1Hydroangeas&0 or the &1Endoflame&0 is not enough. An answer to that is the &1Thermalily&0, which works similarly to the &1Hydroangeas&0, except with &1Lava&0, it'll produce a very large amount of &1Mana&0 at a spurt when it consumes &1Lava&0, doing this heats up the flower, and it'll need some time to cool down before it can begin the cycle anew. botania.page.thermalily1=&o0108 Style&r. # -- ROSA ARCANA