diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java
index 0fd96c134..31611173c 100644
--- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java
+++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileDandelifeon.java
@@ -29,7 +29,7 @@ public class SubTileDandelifeon extends SubTileGenerating {
private static final int RANGE = 12;
private static final int SPEED = 10;
private static final int MAX_GENERATIONS = 60;
- private static final int MANA_PER_GEN = 80;
+ private static final int MANA_PER_GEN = 50;
private static final int[][] ADJACENT_BLOCKS = new int[][] {
{ -1, -1 },
@@ -69,9 +69,12 @@ public class SubTileDandelifeon extends SubTileGenerating {
newVal = gen + 1;
}
- if(Math.abs(i - RANGE) <= 1 && Math.abs(j - RANGE) <= 1 && newVal > -1) {
+ int xdist = Math.abs(i - RANGE);
+ int zdist = Math.abs(j - RANGE);
+ int allowDist = newVal == 1 ? 2 : 1;
+ if(xdist <= allowDist && zdist <= allowDist && newVal > -1) {
gen = newVal;
- newVal = -2;
+ newVal = gen == 1 ? -1 : -2;
}
if(newVal != gen)
@@ -162,10 +165,10 @@ public class SubTileDandelifeon extends SubTileGenerating {
} else if(blockAt == ModBlocks.cellBlock) {
if(gen < 0 || gen > MAX_GENERATIONS)
world.setBlockToAir(x, y, z);
- else ((TileCell) world.getTileEntity(x, y, z)).setGeneration(gen);
+ else ((TileCell) world.getTileEntity(x, y, z)).setGeneration(supertile, gen);
} else if(gen >= 0 && blockAt.isAir(supertile.getWorldObj(), x, y, z)) {
world.setBlock(x, y, z, ModBlocks.cellBlock);
- ((TileCell) world.getTileEntity(x, y, z)).setGeneration(gen);
+ ((TileCell) world.getTileEntity(x, y, z)).setGeneration(supertile, gen);
}
}
diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCell.java b/src/main/java/vazkii/botania/common/block/tile/TileCell.java
index a9f73fb69..ef7d844e0 100644
--- a/src/main/java/vazkii/botania/common/block/tile/TileCell.java
+++ b/src/main/java/vazkii/botania/common/block/tile/TileCell.java
@@ -11,20 +11,46 @@
package vazkii.botania.common.block.tile;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChunkCoordinates;
public class TileCell extends TileMod {
private static final String TAG_GENERATION = "generation";
+ private static final String TAG_TICKED = "ticked";
+ private static final String TAG_FLOWER_X = "flowerX";
+ private static final String TAG_FLOWER_Y = "flowerY";
+ private static final String TAG_FLOWER_Z = "flowerZ";
+ private static final String TAG_VALID_X = "validX";
+ private static final String TAG_VALID_Y = "validY";
+ private static final String TAG_VALID_Z = "validZ";
private int generation;
+ private boolean ticked;
+ private ChunkCoordinates flowerCoords = new ChunkCoordinates();
+ private ChunkCoordinates validCoords = new ChunkCoordinates();
@Override
public boolean canUpdate() {
return false;
}
- public void setGeneration(int gen) {
+ public void setGeneration(TileEntity flower, int gen) {
generation = gen;
+ if(!ticked) {
+ flowerCoords.posX = flower.xCoord;
+ flowerCoords.posY = flower.yCoord;
+ flowerCoords.posZ = flower.zCoord;
+ validCoords.posX = xCoord;
+ validCoords.posY = yCoord;
+ validCoords.posZ = zCoord;
+ ticked = true;
+ } else if(!matchCoords(validCoords, this) || !matchCoords(flowerCoords, flower))
+ worldObj.setBlockToAir(xCoord, yCoord, zCoord);
+ }
+
+ private boolean matchCoords(ChunkCoordinates coords, TileEntity tile) {
+ return coords.posX == tile.xCoord && coords.posY == tile.yCoord && coords.posZ == tile.zCoord;
}
public int getGeneration() {
@@ -34,11 +60,29 @@ public class TileCell extends TileMod {
@Override
public void writeCustomNBT(NBTTagCompound cmp) {
cmp.setInteger(TAG_GENERATION, generation);
+ cmp.setBoolean(TAG_TICKED, ticked);
+ if(ticked) {
+ cmp.setInteger(TAG_FLOWER_X, flowerCoords.posX);
+ cmp.setInteger(TAG_FLOWER_Y, flowerCoords.posY);
+ cmp.setInteger(TAG_FLOWER_Z, flowerCoords.posZ);
+ cmp.setInteger(TAG_VALID_X, validCoords.posX);
+ cmp.setInteger(TAG_VALID_Y, validCoords.posY);
+ cmp.setInteger(TAG_VALID_Z, validCoords.posZ);
+ }
}
@Override
public void readCustomNBT(NBTTagCompound cmp) {
generation = cmp.getInteger(TAG_GENERATION);
+ ticked = cmp.getBoolean(TAG_TICKED);
+ if(ticked) {
+ flowerCoords.posX = cmp.getInteger(TAG_FLOWER_X);
+ flowerCoords.posY = cmp.getInteger(TAG_FLOWER_Y);
+ flowerCoords.posZ = cmp.getInteger(TAG_FLOWER_Z);
+ validCoords.posX = cmp.getInteger(TAG_VALID_X);
+ validCoords.posY = cmp.getInteger(TAG_VALID_Y);
+ validCoords.posZ = cmp.getInteger(TAG_VALID_Z);
+ }
}
}
diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
index 8033bc3b5..c7562b381 100644
--- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
+++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java
@@ -566,7 +566,7 @@ public final class LexiconData {
spectrolus.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.spectrolusRecipe));
dandelifeon = new ALexiconEntry(LibLexicon.GFLOWER_DANDELIFEON, categoryGenerationFlowers);
- dandelifeon.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock));
+ dandelifeon.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageText("10"), new PageText("7"), new PagePetalRecipe("8", ModPetalRecipes.dandelifeonRecipe), new PageCraftingRecipe("9", ModCraftingRecipes.recipeCellBlock));
// DEVICES ENTRIES
pylon = new BLexiconEntry(LibLexicon.DEVICE_PYLON, categoryDevices);
diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang
index 85e40027d..22a4c47bf 100644
--- a/src/main/resources/assets/botania/lang/en_US.lang
+++ b/src/main/resources/assets/botania/lang/en_US.lang
@@ -2393,6 +2393,7 @@ botania.page.dandelifeon3=Every step of the game, the following transitions migh
botania.page.dandelifeon4=All of the transitions happen at the same time.
Aside from those, a few aditional rules not present in a typical simulation of &4Conway's Game of Life&0 are also present in the &1Dadelifeon&0 procedures, listed in the following pages.
botania.page.dandelifeon5=All cells have an age, starting at zero. Whenever a cell lives on, by having two or three neighbours, its age inreases by one. Whenever a dead cell becomes a live cell, the age of the new live cell is equal to the age of the oldest neighbour, plus one. Any cells older than sixty generations will die during the next step.
botania.page.dandelifeon6=Second off, the 3x3 zone centered around the &1Dandelifeon&0 itself is not habitable by cells. Any live cells that would exist in that area are turned into &4Mana&0 instead. The older the cell that would be created, the more &4Mana&0 it makes. Age zero cells produce no &4Mana&0.
+botania.page.dandelifeon10=The 5x5 zone centered around the &1Dandelifeon&0, exclusing the 3x3 zone mentioned in the previous page can also not be habited by Age zero cells.
A few other restrictions apply to cells, having two different &1Dandelifeon&0 flowers affect the same cell will kill it. Lastly, any cell will die if moved by any other means than the &1Dandelifeon&0 itself.
botania.page.dandelifeon7=&1Cellular Blocks&0 are crafted with &1Cactus&0, and are extremely fragile, they may not be picked once placed down or moved by &1Pistons&0 and may not be created (through having 3 live neighbours on a dead cell) on any block that isn't air.
If not within the range of a &1Dandelifeon&0 they work as normal building blocks.
botania.page.dandelifeon8=&oCellCraft^2&r.
botania.page.dandelifeon9=Creating &1Cellular Blocks&0