mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 22:44:25 +00:00
Adding sanity checking to Node Empowering effect. Fixes #107
This commit is contained in:
1 parent
eacb9f2609
commit
3fde6fb08c
2 files changed
+3
-2
No files matched your search
@@ -32,7 +32,7 @@ public class AlleleEffectEmpowering extends AlleleEffect {
|
||||
int xCoord = housing.getXCoord();
|
||||
int yCoord = housing.getYCoord();
|
||||
int zCoord = housing.getZCoord();
|
||||
int range = (int)Math.ceil(genome.getTerritory()[0] * housing.getTerritoryModifier(genome, 1f));
|
||||
int range = (int)Math.max(Math.ceil(genome.getTerritory()[0] * housing.getTerritoryModifier(genome, 1f)), 1);
|
||||
List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, xCoord, zCoord, range);
|
||||
|
||||
if (NodeHelper.growNodeInRange(chunks, world, xCoord, yCoord, zCoord, range)) {
|
||||
|
||||
@@ -102,7 +102,8 @@ public class NodeHelper {
|
||||
if (node != null) {
|
||||
++attemptedNodes;
|
||||
AspectList aspectsBase = node.getAspectsBase();
|
||||
if (world.rand.nextInt(aspectsBase.visSize()) < 120) {
|
||||
int randBase = Math.max(aspectsBase.visSize(), 1);
|
||||
if (world.rand.nextInt(randBase) < 120) {
|
||||
Aspect aspectToAdd;
|
||||
int rollAttempts = 0;
|
||||
do {
|
||||
|
||||
Reference in new issue
Block a user