mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Fixed the Dandelifeon being able to generate mana from cells ticked by other Dandelifeons. Closes #1511
This commit is contained in:
1 parent
2d8c3fa2e2
commit
dbf5ea0d0d
2 files changed
+7
-1
No files matched your search
+3
-1
@@ -166,7 +166,9 @@ public class SubTileDandelifeon extends SubTileGenerating {
|
||||
Block blockAt = world.getBlock(x, y, z);
|
||||
if(gen == -2) {
|
||||
int val = prevGen * MANA_PER_GEN;
|
||||
mana = Math.min(getMaxMana(), mana + val);
|
||||
if(((TileCell) world.getTileEntity(x, y, z)).isSameFlower(supertile))
|
||||
mana = Math.min(getMaxMana(), mana + val);
|
||||
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else if(blockAt == ModBlocks.cellBlock) {
|
||||
if(gen < 0 || gen > MAX_GENERATIONS)
|
||||
|
||||
@@ -49,6 +49,10 @@ public class TileCell extends TileMod {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public boolean isSameFlower(TileEntity flower) {
|
||||
return matchCoords(validCoords, this) && matchCoords(flowerCoords, flower);
|
||||
}
|
||||
|
||||
private boolean matchCoords(ChunkCoordinates coords, TileEntity tile) {
|
||||
return coords.posX == tile.xCoord && coords.posY == tile.yCoord && coords.posZ == tile.zCoord;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user