From 24a41aefa99595afaae9730b910ec0ff03345c21 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Thu, 7 Apr 2016 09:49:57 +1000 Subject: [PATCH] Cleaned up stone formation code --- .../common/block/BlockBOPStoneFormations.java | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java index 38f75b50d..4b8c04c46 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPStoneFormations.java @@ -104,14 +104,38 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB FormationPosition position; position = FormationPosition.STALAGMITE_SMALL; - if (groundAbove && groundBelow && !formationAbove && !formationBelow) {position = FormationPosition.STAL_SINGLE;} - if (!groundAbove && !groundBelow && formationAbove && formationBelow) {position = FormationPosition.STAL_CONNECTOR;} - if (!groundAbove && groundBelow && !formationAbove && !formationBelow) {position = FormationPosition.STALAGMITE_SMALL;} - if (!groundAbove && groundBelow && formationAbove && !formationBelow) {position = FormationPosition.STALAGMITE_MEDIUM;} - if (groundAbove && !groundBelow && !formationAbove && !formationBelow) {position = FormationPosition.STALACTITE_SMALL;} - if (groundAbove && !groundBelow && !formationAbove && formationBelow) {position = FormationPosition.STALACTITE_MEDIUM;} - if (!groundAbove && !groundBelow && !formationAbove && formationBelow) {position = FormationPosition.STALAGMITE_TOP;} - if (!groundAbove && !groundBelow && formationAbove && !formationBelow) {position = FormationPosition.STALACTITE_BOTTOM;} + if (groundAbove && !formationAbove) + { + if (groundBelow && !formationBelow) + { + position = FormationPosition.STAL_SINGLE; + } + else if (!groundBelow) + { + if (formationBelow) position = FormationPosition.STALACTITE_MEDIUM; + else position = FormationPosition.STALACTITE_SMALL; + } + } + else if (!groundAbove) + { + if (!groundBelow) + { + if (formationAbove) + { + if (formationBelow) {position = FormationPosition.STAL_CONNECTOR;} + else {position = FormationPosition.STALACTITE_BOTTOM;} + } + else if (formationBelow) + { + position = FormationPosition.STALAGMITE_TOP; + } + } + else + { + if (!formationAbove && !formationBelow) {position = FormationPosition.STALAGMITE_SMALL;} + else if (formationAbove && !formationBelow) {position = FormationPosition.STALAGMITE_MEDIUM;} + } + } return state.withProperty(POSITION, position); }