diff --git a/MODSRC/vazkii/botania/api/package-info.java b/MODSRC/vazkii/botania/api/package-info.java
index 5499a2b4f..d4eba1dab 100644
--- a/MODSRC/vazkii/botania/api/package-info.java
+++ b/MODSRC/vazkii/botania/api/package-info.java
@@ -1,4 +1,4 @@
-@API(owner = "Botania", apiVersion = "11", provides = "BotaniaAPI")
+@API(owner = "Botania", apiVersion = "12", provides = "BotaniaAPI")
package vazkii.botania.api;
import cpw.mods.fml.common.API;
diff --git a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java
index 4d867760f..bd63a88ac 100644
--- a/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java
+++ b/MODSRC/vazkii/botania/api/subtile/SubTileGenerating.java
@@ -13,6 +13,7 @@ package vazkii.botania.api.subtile;
import java.awt.Color;
+import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
@@ -24,6 +25,7 @@ import net.minecraft.util.StatCollector;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaNetwork;
import vazkii.botania.api.mana.IManaCollector;
+import vazkii.botania.common.core.handler.ConfigHandler;
/**
* The basic class for a Generating Flower.
@@ -31,13 +33,15 @@ import vazkii.botania.api.mana.IManaCollector;
public class SubTileGenerating extends SubTileEntity {
private static final String TAG_MANA = "mana";
-
+ private static final String TAG_TICKS_EXISTED = "ticksExisted";
+
private static final String TAG_COLLECTOR_X = "collectorX";
private static final String TAG_COLLECTOR_Y = "collectorY";
private static final String TAG_COLLECTOR_Z = "collectorZ";
protected int mana;
+ int ticksExisted = 0;
int sizeLastCheck = -1;
protected TileEntity linkedCollector = null;
public int knownMana = -1;
@@ -71,6 +75,14 @@ public class SubTileGenerating extends SubTileEntity {
if(Math.random() > particleChance)
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
}
+
+ if(!supertile.getWorldObj().isRemote) {
+ ++ticksExisted;
+ if(isPassiveFlower() && ConfigHandler.hardcorePassiveGeneration > 0 && ticksExisted > ConfigHandler.hardcorePassiveGeneration) {
+ supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType()));
+ supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
+ }
+ }
}
public void linkCollector() {
@@ -125,6 +137,10 @@ public class SubTileGenerating extends SubTileEntity {
}
}
+ public boolean isPassiveFlower() {
+ return false;
+ }
+
public boolean shouldSyncPassiveGeneration() {
return false;
}
@@ -166,7 +182,9 @@ public class SubTileGenerating extends SubTileEntity {
@Override
public void readFromPacketNBT(NBTTagCompound cmp) {
mana = cmp.getInteger(TAG_MANA);
-
+ if(!cmp.hasKey(TAG_TICKS_EXISTED))
+ ticksExisted = cmp.getInteger(TAG_TICKS_EXISTED);
+
int x = cmp.getInteger(TAG_COLLECTOR_X);
int y = cmp.getInteger(TAG_COLLECTOR_Y);
int z = cmp.getInteger(TAG_COLLECTOR_Z);
@@ -177,7 +195,8 @@ public class SubTileGenerating extends SubTileEntity {
@Override
public void writeToPacketNBT(NBTTagCompound cmp) {
cmp.setInteger(TAG_MANA, mana);
-
+ cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted);
+
int x = linkedCollector == null ? 0 : linkedCollector.xCoord;
int y = linkedCollector == null ? -1 : linkedCollector.yCoord;
int z = linkedCollector == null ? 0 : linkedCollector.zCoord;
diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java
index 7118fb650..618c83f64 100644
--- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java
+++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileDaybloom.java
@@ -40,6 +40,11 @@ public class SubTileDaybloom extends SubTileGenerating {
public int getDelayBetweenPassiveGeneration() {
return 30 + (int) (getSurroundingFlowers() * 7.5);
}
+
+ @Override
+ public boolean isPassiveFlower() {
+ return true;
+ }
public int getSurroundingFlowers() {
int flowers = 0;
diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java
index da0ee744b..e1968fca7 100644
--- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java
+++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java
@@ -70,6 +70,11 @@ public class SubTileHydroangeas extends SubTileGenerating {
}
}
+ @Override
+ public boolean isPassiveFlower() {
+ return true;
+ }
+
public void doBurnParticles() {
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
}
diff --git a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java
index bf90a703e..20141745e 100644
--- a/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java
+++ b/MODSRC/vazkii/botania/common/block/subtile/generating/SubTileThermalily.java
@@ -34,6 +34,11 @@ public class SubTileThermalily extends SubTileHydroangeas {
public void doBurnParticles() {
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
}
+
+ @Override
+ public boolean isPassiveFlower() {
+ return false;
+ }
@Override
public Block getBlockToSearchFor() {
diff --git a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java
index c5fffbc50..5bf07edc3 100644
--- a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java
+++ b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java
@@ -47,6 +47,7 @@ public final class ConfigHandler {
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;
public static boolean darkQuartzEnabled = true;
@@ -130,6 +131,9 @@ public final class ConfigHandler {
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);
+
desc = "Set to false to disable the Fallen Kanade flower (gives Regeneration). This config option is here for those using Blood Magic. Note: Turning this off will not remove ones already in the world, it'll simply prevent the crafting.";
fallenKanadeEnabled = loadPropBool("fallenKanade.enabled", desc, fallenKanadeEnabled);
diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java
index 3221a7588..16dfbc641 100644
--- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java
+++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java
@@ -357,16 +357,16 @@ public final class LexiconData {
generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
daybloom = new BLexiconEntry(LibLexicon.GFLOWER_DAYBLOOM, categoryGenerationFlowers);
- daybloom.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageImage("3", LibResources.ENTRY_DIMINISHING_RETURNS), new PagePetalRecipe("2", ModPetalRecipes.daybloomRecipe));
+ daybloom.setPriority().setLexiconPages(new PageText("0"), new PageText(ConfigHandler.hardcorePassiveGeneration > 0 ? "1a" : "1"), new PageImage("3", LibResources.ENTRY_DIMINISHING_RETURNS), new PagePetalRecipe("2", ModPetalRecipes.daybloomRecipe));
nightshade = new BLexiconEntry(LibLexicon.GFLOWER_NIGHTSHADE, categoryGenerationFlowers);
- nightshade.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.nightshadeRecipe));
+ nightshade.setLexiconPages(new PageText(ConfigHandler.hardcorePassiveGeneration > 0 ? "0a" :"0"), new PagePetalRecipe("1", ModPetalRecipes.nightshadeRecipe));
endoflame = new BLexiconEntry(LibLexicon.GFLOWER_ENDOFLAME, categoryGenerationFlowers);
endoflame.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.endoflameRecipe));
hydroangeas = new BLexiconEntry(LibLexicon.GFLOWER_HYDROANGEAS, categoryGenerationFlowers);
- hydroangeas.setLexiconPages(new PageText("0"), new PageImage("2", LibResources.ENTRY_HYDROANGEAS), new PagePetalRecipe("1", ModPetalRecipes.hydroangeasRecipe));
+ hydroangeas.setLexiconPages(new PageText(ConfigHandler.hardcorePassiveGeneration > 0 ? "0a" : "0"), new PageImage("2", LibResources.ENTRY_HYDROANGEAS), new PagePetalRecipe("1", ModPetalRecipes.hydroangeasRecipe));
thermalily = new BLexiconEntry(LibLexicon.GFLOWER_THERMALILY, categoryGenerationFlowers);
thermalily.setLexiconPages(new PageText(ConfigHandler.thermalilyObsidian ? "0a" : "0"), new PagePetalRecipe("1", ModPetalRecipes.thermalilyRecipe));
diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang
index e8ce3ff11..14c099eb5 100644
--- a/resources/assets/botania/lang/en_US.lang
+++ b/resources/assets/botania/lang/en_US.lang
@@ -122,6 +122,7 @@ manaEnchanter.enabled=Enable Mana Enchanter
flower.forceCheck=Flower Force Checking
enderPickpocket.enabled=Enable Ender Pickpocketting
thermalily.obsidian=Thermalily Needs Obsidian
+passiveWither.time=Passive Wither Time
flowerParticles.frequency=Flower Particle Frequency
lexicon.enable.rotatingItems=Lexicon Rotating Items
lexicon.render.3D=3D Lexicon Render
@@ -1048,12 +1049,14 @@ botania.page.gIntro2=It is important to keep in mind that these flowers memorize
botania.entry.daybloom=Daybloom
botania.page.daybloom0=The &1Daybloom&0 is the most basic and rudimentary &4Generating Flower&0. Simply put, it performs a modified photosynthesis process, in order to transform sunlight into &4Mana&0.
The process is rather slow, about ten or a dozen of these should get the job done, for now.
botania.page.daybloom1=An interesting thing to take in note is that these flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production.
+botania.page.daybloom1a=An interesting thing to take in note is that these flowers tend to compete among themselves for what sunlight hits an area, thus having any other of the same type adjacent to it on any of the four cardinal directions will result in diminishing returns of &4Mana&0 production.
These flowers are not very resistant, and after some time they'll wither and die off.
botania.page.daybloom3=Diminishing Returns
botania.page.daybloom2=&oStarting up a brand new day&r.
# -- NIGHTSHADE
botania.entry.nightshade=Nightshade
botania.page.nightshade0=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, albeit at half the speed.
Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent.
+botania.page.nightshade0a=The &1Nightshade&0 is the dark counterpart of the &1Daybloom&0, as it generates &4Mana&0 passively in any situation the &1Daybloom&0 can not, albeit at half the speed.
Similarly to their shining counterpart, they suffer diminishing returns from having any adjacent.
Similarly to the &1Daybloom&0, these flowers are not very resistant, and after some time they'll wither and die off.
botania.page.nightshade1=&oThe shadow of the day&r.
# -- ENDOFLAME
@@ -1064,7 +1067,8 @@ botania.page.endoflame2=&oNot nitor&r.
# -- HYDROANGEAS
botania.entry.hydroangeas=Hydroangeas
-botania.page.hydroangeas0=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it.
It also seems to function faster during &4Rain&0, who'd have thought?
+botania.page.hydroangeas0=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought?
+botania.page.hydroangeas0a=While passive &4Mana&0 generation can be easily achieved through &1Dayblooms&0, different means of doing so might come in handy. The &1Hydroangeas&0 will suck up any &1Still Water&0 in a 3x3 area around it, on the same height, creating &4Mana&0 from it. They also seem to function faster during &4Rain&0, who'd have thought?
Similarly to the &1Daybloom&0, these flowers are not very resistant, and after some time they'll wither and die off.
botania.page.hydroangeas2=A simple &1Hydroangeas&0 system
botania.page.hydroangeas1=&oFrom some Hyperdimension&r?