From 72a502ada827ad073f70b231876c2e7f55469dac Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Wed, 14 Dec 2016 01:48:10 +0000 Subject: [PATCH 01/22] Removed biome patching from SaplingGrowTreeRTG. --- src/main/java/rtg/event/EventManagerRTG.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/rtg/event/EventManagerRTG.java b/src/main/java/rtg/event/EventManagerRTG.java index 024e416fb..40f7f501a 100644 --- a/src/main/java/rtg/event/EventManagerRTG.java +++ b/src/main/java/rtg/event/EventManagerRTG.java @@ -30,7 +30,6 @@ import rtg.world.WorldTypeRTG; import rtg.world.biome.BiomeProviderRTG; import rtg.world.biome.realistic.RealisticBiomeBase; -import rtg.world.biome.realistic.RealisticBiomePatcher; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.genlayer.RiverRemover; @@ -220,11 +219,10 @@ public void saplingGrowTreeRTG(SaplingGrowTreeEvent event) { Biome bgg = event.getWorld().getBiome(event.getPos()); RealisticBiomeBase rb = RealisticBiomeBase.getBiome(Biome.getIdForBiome(bgg)); - // Do we need to patch the biome? + // Instead of patching the biome, we should just return early here to allow vanilla logic to kick in. if (rb == null) { - RealisticBiomePatcher biomePatcher = new RealisticBiomePatcher(); - rb = biomePatcher.getPatchedRealisticBiome( - "NULL biome (" + Biome.getIdForBiome(bgg) + ") found when growing an RTG sapling."); + Logger.debug("NULL biome (%d) found when trying to grow an RTG tree from a sapling.", Biome.getIdForBiome(bgg)); + return; } ArrayList biomeTrees = rb.rtgTrees; From b9e7b9bf102eb6b287a7311ced9fdf49beba0f1a Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Wed, 14 Dec 2016 16:23:11 +0000 Subject: [PATCH 02/22] Fixed overloaded constructor in DecoTree. --- src/main/java/rtg/world/biome/deco/DecoTree.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index 62e0e4acd..cf605995a 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -94,9 +94,11 @@ public DecoTree(DecoTree source) { this.strengthNoiseFactorXForLoops = source.strengthNoiseFactorXForLoops; this.treeType = source.treeType; this.tree = source.tree; + this.worldGen = source.worldGen; this.distribution = source.distribution; this.treeCondition = source.treeCondition; this.treeConditionNoise = source.treeConditionNoise; + this.treeConditionFloat = source.treeConditionFloat; this.treeConditionChance = source.treeConditionChance; this.minY = source.minY; this.maxY = source.maxY; From ac694da0b4811a6bf0e6481ac898c311fbd8d7e5 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Fri, 16 Dec 2016 22:08:36 +0000 Subject: [PATCH 03/22] New forest decorations. --- .../java/rtg/world/biome/deco/DecoTree.java | 14 +- .../deco/collection/DecoCollectionForest.java | 153 ++++++++++++++---- 2 files changed, 133 insertions(+), 34 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index cf605995a..c31d18e8e 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -11,11 +11,11 @@ import net.minecraftforge.fml.common.eventhandler.Event; import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE; -import rtg.util.DecoUtil; import rtg.api.util.RandomUtil; import rtg.api.util.WorldUtil; import rtg.api.world.RTGWorld; import rtg.event.terraingen.DecorateBiomeEventRTG; +import rtg.util.DecoUtil; import rtg.world.biome.realistic.RealisticBiomeBase; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -34,6 +34,7 @@ public class DecoTree extends DecoBase { public DecoTree.Distribution distribution; // Parameter object for noise calculations. public TreeCondition treeCondition; // Enum for the various conditions/chances for tree gen. public float treeConditionNoise; // Only applies to a noise-related TreeCondition. + public float treeConditionNoise2; // Only applies to a noise-related TreeCondition. public int treeConditionChance; // Only applies to a chance-related TreeCondition. public float treeConditionFloat; // Multi-purpose float. public int minY; // Lower height restriction. @@ -67,6 +68,7 @@ public DecoTree() { this.distribution = new DecoTree.Distribution(100f, 5f, 0.8f); this.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; this.treeConditionNoise = 0f; + this.treeConditionNoise2 = 0f; this.treeConditionFloat = 0f; this.treeConditionChance = 1; this.minY = 63; // No underwater trees by default. @@ -98,6 +100,7 @@ public DecoTree(DecoTree source) { this.distribution = source.distribution; this.treeCondition = source.treeCondition; this.treeConditionNoise = source.treeConditionNoise; + this.treeConditionNoise2 = source.treeConditionNoise2; this.treeConditionFloat = source.treeConditionFloat; this.treeConditionChance = source.treeConditionChance; this.minY = source.minY; @@ -198,10 +201,13 @@ rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), TREE, loopCount DecoBase.tweakTreeLeaves(this, false, true); for (int i = 0; i < loopCount; i++) { + int intX = scatter.get(rand, worldX); // + 8; int intZ = scatter.get(rand, worldZ); // + 8; int intY = rtgWorld.world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + //Logger.info("noise = %f", noise); + if (intY <= this.maxY && intY >= this.minY && isValidTreeCondition(noise, rand, strength)) { // If we're in a village, check to make sure the tree has extra room to grow to avoid corrupting the village. @@ -215,6 +221,8 @@ rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), TREE, loopCount case RTG_TREE: + //this.logBlock = strength < 0.2f ? BlockUtil.getStateLog(2) : this.logBlock; + this.tree.setLogBlock(this.logBlock); this.tree.setLeavesBlock(this.leavesBlock); this.tree.setTrunkSize(RandomUtil.getRandomInt(rand, this.minTrunkSize, this.maxTrunkSize)); @@ -255,6 +263,9 @@ public boolean isValidTreeCondition(float noise, Random rand, float strength) { case NOISE_LESSER_AND_RANDOM_CHANCE: return (noise < this.treeConditionNoise && rand.nextInt(this.treeConditionChance) == 0); + case NOISE_BETWEEN_AND_RANDOM_CHANCE: + return (noise > this.treeConditionNoise && noise < this.treeConditionNoise2 && rand.nextInt(this.treeConditionChance) == 0); + case RANDOM_CHANCE: return rand.nextInt(this.treeConditionChance) == 0; @@ -275,6 +286,7 @@ public enum TreeCondition { ALWAYS_GENERATE, NOISE_GREATER_AND_RANDOM_CHANCE, NOISE_LESSER_AND_RANDOM_CHANCE, + NOISE_BETWEEN_AND_RANDOM_CHANCE, RANDOM_CHANCE, X_DIVIDED_BY_STRENGTH; } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java index 114b9a642..90b3c2ca1 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java @@ -21,53 +21,141 @@ */ public class DecoCollectionForest extends DecoCollectionBase { - public DecoCollectionForest(boolean fallenTrees) { + // Tends to return values between -3f to 5f, with some overflow. + private DecoTree.Distribution forestDistribution = new DecoTree.Distribution(100f, 6f, 0.8f); - // Trees first. + private float short1Min = -3f; + private float short1Max = -1f; + private float tallMin = -1f; + private float tallMax = 3f; + private float short2Min = 3f; + private float short2Max = 5f; - TreeRTG ponderosaOakTree = new TreeRTGPinusPonderosa(); - ponderosaOakTree.logBlock = Blocks.LOG.getDefaultState(); - ponderosaOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaOakTree.minTrunkSize = 11; - ponderosaOakTree.maxTrunkSize = 21; - ponderosaOakTree.minCrownSize = 15; - ponderosaOakTree.maxCrownSize = 29; - this.addTree(ponderosaOakTree); + public DecoCollectionForest(boolean fallenTrees) { - DecoTree oakPines = new DecoTree(ponderosaOakTree); + // Tall trees first. + + TreeRTG ponderosaOakTreeTall = new TreeRTGPinusPonderosa(); + ponderosaOakTreeTall.logBlock = Blocks.LOG.getDefaultState(); + ponderosaOakTreeTall.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTreeTall.minTrunkSize = 11; + ponderosaOakTreeTall.maxTrunkSize = 21; + ponderosaOakTreeTall.minCrownSize = 15; + ponderosaOakTreeTall.maxCrownSize = 29; + this.addTree(ponderosaOakTreeTall); + DecoTree oakPines = new DecoTree(ponderosaOakTreeTall); oakPines.strengthFactorForLoops = 8f; oakPines.treeType = TreeType.RTG_TREE; - oakPines.distribution.noiseDivisor = 100f; - oakPines.distribution.noiseFactor = 6f; - oakPines.distribution.noiseAddend = 0.8f; - oakPines.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - oakPines.treeConditionNoise = 0f; + oakPines.distribution = forestDistribution; + oakPines.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + oakPines.treeConditionNoise = tallMin; + oakPines.treeConditionNoise2 = tallMax; oakPines.treeConditionChance = 1; oakPines.maxY = 85; - TreeRTG ponderosaSpruceTree = new TreeRTGPinusPonderosa(); - ponderosaSpruceTree.logBlock = BlockUtil.getStateLog(1); - ponderosaSpruceTree.leavesBlock = BlockUtil.getStateLeaf(1); - ponderosaSpruceTree.minTrunkSize = 11; - ponderosaSpruceTree.maxTrunkSize = 21; - ponderosaSpruceTree.minCrownSize = 15; - ponderosaSpruceTree.maxCrownSize = 29; - this.addTree(ponderosaSpruceTree); - - DecoTree sprucePines = new DecoTree(ponderosaSpruceTree); + TreeRTG ponderosaSpruceTreeTall = new TreeRTGPinusPonderosa(); + ponderosaSpruceTreeTall.logBlock = BlockUtil.getStateLog(1); + ponderosaSpruceTreeTall.leavesBlock = BlockUtil.getStateLeaf(1); + ponderosaSpruceTreeTall.minTrunkSize = 11; + ponderosaSpruceTreeTall.maxTrunkSize = 21; + ponderosaSpruceTreeTall.minCrownSize = 15; + ponderosaSpruceTreeTall.maxCrownSize = 29; + this.addTree(ponderosaSpruceTreeTall); + DecoTree sprucePines = new DecoTree(ponderosaSpruceTreeTall); sprucePines.strengthFactorForLoops = 8f; sprucePines.treeType = TreeType.RTG_TREE; - sprucePines.distribution.noiseDivisor = 100f; - sprucePines.distribution.noiseFactor = 6f; - sprucePines.distribution.noiseAddend = 0.8f; - sprucePines.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - sprucePines.treeConditionNoise = 0f; + sprucePines.distribution = forestDistribution; + sprucePines.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + sprucePines.treeConditionNoise = tallMin; + sprucePines.treeConditionNoise2 = tallMax; sprucePines.treeConditionChance = 1; sprucePines.maxY = 85; DecoHelper5050 decoPines = new DecoHelper5050(oakPines, sprucePines); this.addDeco(decoPines); + // Short trees next. + + TreeRTG ponderosaOakTreeShort1 = new TreeRTGPiceaSitchensis(); + ponderosaOakTreeShort1.logBlock = Blocks.LOG.getDefaultState(); + ponderosaOakTreeShort1.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTreeShort1.minTrunkSize = 4; + ponderosaOakTreeShort1.maxTrunkSize = 10; + ponderosaOakTreeShort1.minCrownSize = 6; + ponderosaOakTreeShort1.maxCrownSize = 14; + this.addTree(ponderosaOakTreeShort1); + DecoTree oakPinesShort1 = new DecoTree(ponderosaOakTreeShort1); + oakPinesShort1.strengthFactorForLoops = 8f; + oakPinesShort1.treeType = TreeType.RTG_TREE; + oakPinesShort1.distribution = forestDistribution; + oakPinesShort1.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + oakPinesShort1.treeConditionNoise = short1Min; + oakPinesShort1.treeConditionNoise2 = short1Max; + oakPinesShort1.treeConditionChance = 1; + oakPinesShort1.maxY = 85; + + TreeRTG ponderosaSpruceTreeShort1 = new TreeRTGPiceaSitchensis(); + ponderosaSpruceTreeShort1.logBlock = BlockUtil.getStateLog(1); + ponderosaSpruceTreeShort1.leavesBlock = BlockUtil.getStateLeaf(1); + ponderosaSpruceTreeShort1.minTrunkSize = 4; + ponderosaSpruceTreeShort1.maxTrunkSize = 10; + ponderosaSpruceTreeShort1.minCrownSize = 6; + ponderosaSpruceTreeShort1.maxCrownSize = 14; + this.addTree(ponderosaSpruceTreeShort1); + DecoTree sprucePinesShort1 = new DecoTree(ponderosaSpruceTreeShort1); + sprucePinesShort1.strengthFactorForLoops = 8f; + sprucePinesShort1.treeType = TreeType.RTG_TREE; + sprucePinesShort1.distribution = forestDistribution; + sprucePinesShort1.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + sprucePinesShort1.treeConditionNoise = short1Min; + sprucePinesShort1.treeConditionNoise2 = short1Max; + sprucePinesShort1.treeConditionChance = 1; + sprucePinesShort1.maxY = 85; + + DecoHelper5050 decoPinesShort1 = new DecoHelper5050(oakPinesShort1, sprucePinesShort1); + this.addDeco(decoPinesShort1); + + // Short trees next on the other 'side' of the noise spectrum. + + TreeRTG ponderosaOakTreeShort2 = new TreeRTGPiceaSitchensis(); + ponderosaOakTreeShort2.logBlock = Blocks.LOG.getDefaultState(); + ponderosaOakTreeShort2.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTreeShort2.minTrunkSize = 4; + ponderosaOakTreeShort2.maxTrunkSize = 10; + ponderosaOakTreeShort2.minCrownSize = 6; + ponderosaOakTreeShort2.maxCrownSize = 14; + this.addTree(ponderosaOakTreeShort2); + DecoTree oakPinesShort2 = new DecoTree(ponderosaOakTreeShort2); + oakPinesShort2.strengthFactorForLoops = 8f; + oakPinesShort2.treeType = TreeType.RTG_TREE; + oakPinesShort2.distribution = forestDistribution; + oakPinesShort2.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + oakPinesShort2.treeConditionNoise = short2Min; + oakPinesShort2.treeConditionNoise2 = short2Max; + oakPinesShort2.treeConditionChance = 1; + oakPinesShort2.maxY = 85; + + TreeRTG ponderosaSpruceTreeShort2 = new TreeRTGPiceaSitchensis(); + ponderosaSpruceTreeShort2.logBlock = BlockUtil.getStateLog(1); + ponderosaSpruceTreeShort2.leavesBlock = BlockUtil.getStateLeaf(1); + ponderosaSpruceTreeShort2.minTrunkSize = 4; + ponderosaSpruceTreeShort2.maxTrunkSize = 10; + ponderosaSpruceTreeShort2.minCrownSize = 6; + ponderosaSpruceTreeShort2.maxCrownSize = 14; + this.addTree(ponderosaSpruceTreeShort2); + DecoTree sprucePinesShort2 = new DecoTree(ponderosaSpruceTreeShort2); + sprucePinesShort2.strengthFactorForLoops = 8f; + sprucePinesShort2.treeType = TreeType.RTG_TREE; + sprucePinesShort2.distribution = forestDistribution; + sprucePinesShort2.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; + sprucePinesShort2.treeConditionNoise = short2Min; + sprucePinesShort2.treeConditionNoise2 = short2Max; + sprucePinesShort2.treeConditionChance = 1; + sprucePinesShort2.maxY = 85; + + DecoHelper5050 decoPinesShort2 = new DecoHelper5050(oakPinesShort2, sprucePinesShort2); + this.addDeco(decoPinesShort2); + // More trees. TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); @@ -78,7 +166,6 @@ public DecoCollectionForest(boolean fallenTrees) { sitchensisTree.minCrownSize = 6; sitchensisTree.maxCrownSize = 14; this.addTree(sitchensisTree); - DecoTree oakPine = new DecoTree(sitchensisTree); oakPine.strengthFactorForLoops = 3f; oakPine.treeType = TreeType.RTG_TREE; @@ -91,7 +178,7 @@ public DecoCollectionForest(boolean fallenTrees) { vanillaTrees.strengthFactorForLoops = 3f; vanillaTrees.treeType = TreeType.WORLDGEN; vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; - vanillaTrees.treeConditionChance = 4; + vanillaTrees.treeConditionChance = 3; vanillaTrees.maxY = 120; DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); From 17d5afa823b33e6973af61def0598397a8bdf313 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 02:41:01 +0000 Subject: [PATCH 04/22] Better vines. --- .../java/rtg/world/biome/deco/DecoVines.java | 191 ++++++++++++++++++ .../world/gen/feature/WorldGenVinesRTG.java | 66 +++++- 2 files changed, 249 insertions(+), 8 deletions(-) create mode 100644 src/main/java/rtg/world/biome/deco/DecoVines.java diff --git a/src/main/java/rtg/world/biome/deco/DecoVines.java b/src/main/java/rtg/world/biome/deco/DecoVines.java new file mode 100644 index 000000000..1001aa385 --- /dev/null +++ b/src/main/java/rtg/world/biome/deco/DecoVines.java @@ -0,0 +1,191 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockVine; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +import rtg.api.world.RTGWorld; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenVinesRTG; + +/** + * @author WhichOnesPink + */ +public class DecoVines extends DecoBase { + + public int loops; + public float strengthFactor; + public Block vineBlock; + public int minY; + public int maxY; + public PropertyBool propNorth; + public PropertyBool propEast; + public PropertyBool propSouth; + public PropertyBool propWest; + + protected WorldGenerator worldGenerator; + + public DecoVines() { + + super(); + + this.loops = 1; + this.strengthFactor = 0f; + this.minY = 63; + this.maxY = 200; + this.vineBlock = Blocks.VINE; + this.propNorth = BlockVine.NORTH; + this.propEast = BlockVine.EAST; + this.propSouth = BlockVine.SOUTH; + this.propWest = BlockVine.WEST; + + this.addDecoTypes(DecoType.VINE); + } + + @Override + public boolean properlyDefined() { + + try { + IBlockState vineTest = this.vineBlock.getDefaultState() + .withProperty(this.propNorth, true) + .withProperty(this.propEast, false) + .withProperty(this.propSouth, false) + .withProperty(this.propWest, false); + } + catch (Exception e) { + return false; + } + + return true; + } + + @Override + public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, int worldX, int worldZ, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), GRASS)) { + + this.worldGenerator = new WorldGenVinesRTG(this.vineBlock, this.maxY, this.propNorth, this.propEast, this.propSouth, this.propWest); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + + int intX = worldX + rand.nextInt(16);// + 8; + int intZ = worldZ + rand.nextInt(16);// + 8; + int intY = this.minY; + + worldGenerator.generate(rtgWorld.world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + + public int getLoops() { + + return loops; + } + + public DecoVines setLoops(int loops) { + + this.loops = loops; + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoVines setStrengthFactor(float strengthFactor) { + + this.strengthFactor = strengthFactor; + return this; + } + + public Block getVineBlock() { + + return vineBlock; + } + + public DecoVines setVineBlock(Block vineBlock) { + + this.vineBlock = vineBlock; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoVines setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoVines setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public PropertyBool getPropNorth() { + + return propNorth; + } + + public DecoVines setPropNorth(PropertyBool propNorth) { + + this.propNorth = propNorth; + return this; + } + + public PropertyBool getPropEast() { + + return propEast; + } + + public DecoVines setPropEast(PropertyBool propEast) { + + this.propEast = propEast; + return this; + } + + public PropertyBool getPropSouth() { + + return propSouth; + } + + public DecoVines setPropSouth(PropertyBool propSouth) { + + this.propSouth = propSouth; + return this; + } + + public PropertyBool getPropWest() { + + return propWest; + } + + public DecoVines setPropWest(PropertyBool propWest) { + + this.propWest = propWest; + return this; + } +} diff --git a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java index c9488851f..bcca2997a 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -2,7 +2,9 @@ import java.util.Random; +import net.minecraft.block.Block; import net.minecraft.block.BlockVine; +import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.EnumFacing; @@ -12,18 +14,47 @@ public class WorldGenVinesRTG extends WorldGenerator { + protected Block vineBlock; + protected int maxY; + protected PropertyBool propNorth; + protected PropertyBool propEast; + protected PropertyBool propSouth; + protected PropertyBool propWest; + + public WorldGenVinesRTG() { + + this.vineBlock = Blocks.VINE; + this.maxY = 254; + this.propNorth = BlockVine.NORTH; + this.propEast = BlockVine.EAST; + this.propSouth = BlockVine.SOUTH; + this.propWest = BlockVine.WEST; + } + + public WorldGenVinesRTG(Block vineBlock, int maxY, PropertyBool propNorth, PropertyBool propEast, PropertyBool propSouth, PropertyBool propWest) { + + this(); + + this.vineBlock = vineBlock; + this.maxY = maxY; + this.propNorth = propNorth; + this.propEast = propEast; + this.propSouth = propSouth; + this.propWest = propWest; + } + + @Override public boolean generate(World worldIn, Random rand, BlockPos position) { - for (; position.getY() < 128; position = position.up()) { + for (; position.getY() < this.maxY; position = position.up()) { + if (worldIn.isAirBlock(position)) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) { - if (Blocks.VINE.canPlaceBlockOnSide(worldIn, position, enumfacing)) { - IBlockState iblockstate = Blocks.VINE.getDefaultState() - .withProperty(BlockVine.NORTH, enumfacing == EnumFacing.SOUTH) - .withProperty(BlockVine.EAST, enumfacing == EnumFacing.WEST) - .withProperty(BlockVine.SOUTH, enumfacing == EnumFacing.NORTH) - .withProperty(BlockVine.WEST, enumfacing == EnumFacing.EAST); - worldIn.setBlockState(position, iblockstate, 2); + + if (this.vineBlock.canPlaceBlockOnSide(worldIn, position, enumfacing)) { + + this.addVine(worldIn, rand, position, enumfacing); break; } } @@ -35,4 +66,23 @@ public boolean generate(World worldIn, Random rand, BlockPos position) { return true; } + + protected void addVine(World worldIn, Random rand, BlockPos pos, EnumFacing enumfacing) + { + IBlockState iblockstate = this.vineBlock.getDefaultState() + .withProperty(this.propNorth, enumfacing == EnumFacing.SOUTH) + .withProperty(this.propEast, enumfacing == EnumFacing.WEST) + .withProperty(this.propSouth, enumfacing == EnumFacing.NORTH) + .withProperty(this.propWest, enumfacing == EnumFacing.EAST); + + this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate); + + int i = rand.nextInt(4) + 1; + + for (pos = pos.down(); worldIn.isAirBlock(pos) && i > 0; --i) + { + this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate); + pos = pos.down(); + } + } } \ No newline at end of file From 867a8258845d023430551e08d890e5fe2149f69e Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 02:46:20 +0000 Subject: [PATCH 05/22] Added getters and setters to various Decos. --- .../rtg/world/biome/deco/DecoFallenTree.java | 121 ++++++++ .../rtg/world/biome/deco/DecoFlowersRTG.java | 88 ++++++ .../java/rtg/world/biome/deco/DecoGrass.java | 93 +++++- .../java/rtg/world/biome/deco/DecoShrub.java | 165 +++++++++++ .../java/rtg/world/biome/deco/DecoTree.java | 275 ++++++++++++++++++ .../deco/collection/DecoCollectionBase.java | 6 +- .../deco/helper/DecoHelperRandomSplit.java | 22 ++ .../world/gen/feature/tree/rtg/TreeRTG.java | 188 +++++++++--- 8 files changed, 917 insertions(+), 41 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java index 73c0f7753..7f1d0c001 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java @@ -174,4 +174,125 @@ public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { this.noiseAddend = noiseAddend; } } + + public int getLoops() { + + return loops; + } + + public DecoFallenTree setLoops(int loops) { + + this.loops = loops; + return this; + } + + public Distribution getDistribution() { + + return distribution; + } + + public DecoFallenTree setDistribution(Distribution distribution) { + + this.distribution = distribution; + return this; + } + + public LogCondition getLogCondition() { + + return logCondition; + } + + public DecoFallenTree setLogCondition(LogCondition logCondition) { + + this.logCondition = logCondition; + return this; + } + + public float getLogConditionNoise() { + + return logConditionNoise; + } + + public DecoFallenTree setLogConditionNoise(float logConditionNoise) { + + this.logConditionNoise = logConditionNoise; + return this; + } + + public int getLogConditionChance() { + + return logConditionChance; + } + + public DecoFallenTree setLogConditionChance(int logConditionChance) { + + this.logConditionChance = logConditionChance; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoFallenTree setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public IBlockState getLogBlock() { + + return logBlock; + } + + public DecoFallenTree setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public IBlockState getLeavesBlock() { + + return leavesBlock; + } + + public DecoFallenTree setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } + + public int getMinSize() { + + return minSize; + } + + public DecoFallenTree setMinSize(int minSize) { + + this.minSize = minSize; + return this; + } + + public int getMaxSize() { + + return maxSize; + } + + public DecoFallenTree setMaxSize(int maxSize) { + + this.maxSize = maxSize; + return this; + } + + public IBlockState[] getRandomLogBlocks() { + + return randomLogBlocks; + } + + public DecoFallenTree setRandomLogBlocks(IBlockState[] randomLogBlocks) { + + this.randomLogBlocks = randomLogBlocks; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java index 17cab3fb0..6abb9ebe9 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java +++ b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java @@ -120,4 +120,92 @@ public enum HeightType { NEXT_INT, GET_HEIGHT_VALUE; } + + public int[] getFlowers() { + + return flowers; + } + + public DecoFlowersRTG setFlowers(int[] flowers) { + + this.flowers = flowers; + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoFlowersRTG setStrengthFactor(float strengthFactor) { + + this.strengthFactor = strengthFactor; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoFlowersRTG setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoFlowersRTG setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public HeightType getHeightType() { + + return heightType; + } + + public DecoFlowersRTG setHeightType(HeightType heightType) { + + this.heightType = heightType; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoFlowersRTG setChance(int chance) { + + this.chance = chance; + return this; + } + + public int getNotEqualsZeroChance() { + + return notEqualsZeroChance; + } + + public DecoFlowersRTG setNotEqualsZeroChance(int notEqualsZeroChance) { + + this.notEqualsZeroChance = notEqualsZeroChance; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoFlowersRTG setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoGrass.java b/src/main/java/rtg/world/biome/deco/DecoGrass.java index 2516b7b58..f417b70a5 100644 --- a/src/main/java/rtg/world/biome/deco/DecoGrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoGrass.java @@ -18,8 +18,6 @@ */ public class DecoGrass extends DecoBase { - protected static final int MAX_LOOPS = 10; - public float strengthFactor; public int minY; public int maxY; @@ -28,7 +26,10 @@ public class DecoGrass extends DecoBase { public int notEqualsZerochance; public IBlockState[] randomGrassBlocks; public byte[] randomGrassMetas; + protected boolean useRandomGrass; + protected static final int MAX_LOOPS = 10; + private IBlockState block; private int meta; private WorldGenGrass grassGenerator; @@ -119,4 +120,92 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoGrass setStrengthFactor(float strengthFactor) { + + this.strengthFactor = strengthFactor; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoGrass setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoGrass setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoGrass setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoGrass setChance(int chance) { + + this.chance = chance; + return this; + } + + public int getNotEqualsZerochance() { + + return notEqualsZerochance; + } + + public DecoGrass setNotEqualsZerochance(int notEqualsZerochance) { + + this.notEqualsZerochance = notEqualsZerochance; + return this; + } + + public IBlockState[] getRandomGrassBlocks() { + + return randomGrassBlocks; + } + + public DecoGrass setRandomGrassBlocks(IBlockState[] randomGrassBlocks) { + + this.randomGrassBlocks = randomGrassBlocks; + return this; + } + + public byte[] getRandomGrassMetas() { + + return randomGrassMetas; + } + + public DecoGrass setRandomGrassMetas(byte[] randomGrassMetas) { + + this.randomGrassMetas = randomGrassMetas; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoShrub.java b/src/main/java/rtg/world/biome/deco/DecoShrub.java index ba9affa6e..da2596b0c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoShrub.java +++ b/src/main/java/rtg/world/biome/deco/DecoShrub.java @@ -127,4 +127,169 @@ private boolean generateWorldGenerator(WorldGenerator worldGenerator, WorldUtil return worldGenerator.generate(world, rand, new BlockPos(x, y, z)); } + + public int getSize() { + + return size; + } + + public DecoShrub setSize(int size) { + + this.size = size; + return this; + } + + public boolean isUseDefaultRandom() { + + return useDefaultRandom; + } + + public DecoShrub setUseDefaultRandom(boolean useDefaultRandom) { + + this.useDefaultRandom = useDefaultRandom; + return this; + } + + public boolean isSand() { + + return Sand; + } + + public DecoShrub setSand(boolean sand) { + + Sand = sand; + return this; + } + + public IBlockState[] getRandomLogBlocks() { + + return randomLogBlocks; + } + + public DecoShrub setRandomLogBlocks(IBlockState[] randomLogBlocks) { + + this.randomLogBlocks = randomLogBlocks; + return this; + } + + public IBlockState[] getRandomLeavesBlocks() { + + return randomLeavesBlocks; + } + + public DecoShrub setRandomLeavesBlocks(IBlockState[] randomLeavesBlocks) { + + this.randomLeavesBlocks = randomLeavesBlocks; + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoShrub setStrengthFactor(float strengthFactor) { + + this.strengthFactor = strengthFactor; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoShrub setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoShrub setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoShrub setChance(int chance) { + + this.chance = chance; + return this; + } + + public int getNotEqualsZerochance() { + + return notEqualsZerochance; + } + + public DecoShrub setNotEqualsZerochance(int notEqualsZerochance) { + + this.notEqualsZerochance = notEqualsZerochance; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoShrub setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getMinSize() { + + return minSize; + } + + public DecoShrub setMinSize(int minSize) { + + this.minSize = minSize; + return this; + } + + public int getMaxSize() { + + return maxSize; + } + + public DecoShrub setMaxSize(int maxSize) { + + this.maxSize = maxSize; + return this; + } + + public IBlockState getLogBlock() { + + return logBlock; + } + + public DecoShrub setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public IBlockState getLeavesBlock() { + + return leavesBlock; + } + + public DecoShrub setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index c31d18e8e..3e5b56b0f 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -332,4 +332,279 @@ public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { this.noiseAddend = noiseAddend; } } + + public int getLoops() { + + return loops; + } + + public DecoTree setLoops(int loops) { + + this.loops = loops; + return this; + } + + public float getStrengthFactorForLoops() { + + return strengthFactorForLoops; + } + + public DecoTree setStrengthFactorForLoops(float strengthFactorForLoops) { + + this.strengthFactorForLoops = strengthFactorForLoops; + return this; + } + + public boolean isStrengthNoiseFactorForLoops() { + + return strengthNoiseFactorForLoops; + } + + public DecoTree setStrengthNoiseFactorForLoops(boolean strengthNoiseFactorForLoops) { + + this.strengthNoiseFactorForLoops = strengthNoiseFactorForLoops; + return this; + } + + public boolean isStrengthNoiseFactorXForLoops() { + + return strengthNoiseFactorXForLoops; + } + + public DecoTree setStrengthNoiseFactorXForLoops(boolean strengthNoiseFactorXForLoops) { + + this.strengthNoiseFactorXForLoops = strengthNoiseFactorXForLoops; + return this; + } + + public TreeType getTreeType() { + + return treeType; + } + + public DecoTree setTreeType(TreeType treeType) { + + this.treeType = treeType; + return this; + } + + public TreeRTG getTree() { + + return tree; + } + + public DecoTree setTree(TreeRTG tree) { + + this.tree = tree; + return this; + } + + public WorldGenerator getWorldGen() { + + return worldGen; + } + + public DecoTree setWorldGen(WorldGenerator worldGen) { + + this.worldGen = worldGen; + return this; + } + + public Distribution getDistribution() { + + return distribution; + } + + public DecoTree setDistribution(Distribution distribution) { + + this.distribution = distribution; + return this; + } + + public TreeCondition getTreeCondition() { + + return treeCondition; + } + + public DecoTree setTreeCondition(TreeCondition treeCondition) { + + this.treeCondition = treeCondition; + return this; + } + + public float getTreeConditionNoise() { + + return treeConditionNoise; + } + + public DecoTree setTreeConditionNoise(float treeConditionNoise) { + + this.treeConditionNoise = treeConditionNoise; + return this; + } + + public float getTreeConditionNoise2() { + + return treeConditionNoise2; + } + + public DecoTree setTreeConditionNoise2(float treeConditionNoise2) { + + this.treeConditionNoise2 = treeConditionNoise2; + return this; + } + + public int getTreeConditionChance() { + + return treeConditionChance; + } + + public DecoTree setTreeConditionChance(int treeConditionChance) { + + this.treeConditionChance = treeConditionChance; + return this; + } + + public float getTreeConditionFloat() { + + return treeConditionFloat; + } + + public DecoTree setTreeConditionFloat(float treeConditionFloat) { + + this.treeConditionFloat = treeConditionFloat; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoTree setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoTree setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public IBlockState getLogBlock() { + + return logBlock; + } + + public DecoTree setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public IBlockState getLeavesBlock() { + + return leavesBlock; + } + + public DecoTree setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } + + public int getMinSize() { + + return minSize; + } + + public DecoTree setMinSize(int minSize) { + + this.minSize = minSize; + return this; + } + + public int getMaxSize() { + + return maxSize; + } + + public DecoTree setMaxSize(int maxSize) { + + this.maxSize = maxSize; + return this; + } + + public int getMinTrunkSize() { + + return minTrunkSize; + } + + public DecoTree setMinTrunkSize(int minTrunkSize) { + + this.minTrunkSize = minTrunkSize; + return this; + } + + public int getMaxTrunkSize() { + + return maxTrunkSize; + } + + public DecoTree setMaxTrunkSize(int maxTrunkSize) { + + this.maxTrunkSize = maxTrunkSize; + return this; + } + + public int getMinCrownSize() { + + return minCrownSize; + } + + public DecoTree setMinCrownSize(int minCrownSize) { + + this.minCrownSize = minCrownSize; + return this; + } + + public int getMaxCrownSize() { + + return maxCrownSize; + } + + public DecoTree setMaxCrownSize(int maxCrownSize) { + + this.maxCrownSize = maxCrownSize; + return this; + } + + public boolean isNoLeaves() { + + return noLeaves; + } + + public DecoTree setNoLeaves(boolean noLeaves) { + + this.noLeaves = noLeaves; + return this; + } + + public Scatter getScatter() { + + return scatter; + } + + public DecoTree setScatter(Scatter scatter) { + + this.scatter = scatter; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionBase.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionBase.java index e9f6a4c0d..4c63e8161 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionBase.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionBase.java @@ -19,15 +19,16 @@ public DecoCollectionBase() { this.rtgTrees = new ArrayList(); } - public void addDeco(DecoBase deco) { + public DecoCollectionBase addDeco(DecoBase deco) { if (!deco.properlyDefined()) { throw new RuntimeException(); } this.decos.add(deco); + return this; } - public void addDeco(DecoBase deco, boolean allowed) { + public DecoCollectionBase addDeco(DecoBase deco, boolean allowed) { if (allowed) { if (!deco.properlyDefined()) { @@ -35,6 +36,7 @@ public void addDeco(DecoBase deco, boolean allowed) { } this.decos.add(deco); } + return this; } /** diff --git a/src/main/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java b/src/main/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java index 071b564d1..18b7a60d6 100644 --- a/src/main/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java +++ b/src/main/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java @@ -60,4 +60,26 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public DecoBase[] getDecos() { + + return decos; + } + + public DecoHelperRandomSplit setDecos(DecoBase[] decos) { + + this.decos = decos; + return this; + } + + public int[] getChances() { + + return chances; + } + + public DecoHelperRandomSplit setChances(int[] chances) { + + this.chances = chances; + return this; + } } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java index fc5507922..86255413a 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java @@ -26,7 +26,6 @@ */ public class TreeRTG extends WorldGenAbstractTree { - protected RTGConfig rtgConfig = RTGAPI.config(); public IBlockState logBlock; public IBlockState leavesBlock; public int trunkSize; @@ -42,10 +41,11 @@ public class TreeRTG extends WorldGenAbstractTree { public int minCrownSize; public int maxCrownSize; - public boolean allowBarkCoveredLogs; - public ArrayList validGroundBlocks; + protected RTGConfig rtgConfig = RTGAPI.config(); + private boolean allowBarkCoveredLogs; + public TreeRTG(boolean notify) { super(notify); @@ -108,36 +108,6 @@ public void buildLeaves(World world, Random rand, int x, int y, int z, int size) } - public TreeRTG setLogBlock(IBlockState logBlock) { - - this.logBlock = logBlock; - return this; - } - - public TreeRTG setLeavesBlock(IBlockState leavesBlock) { - - this.leavesBlock = leavesBlock; - return this; - } - - public TreeRTG setTrunkSize(int trunkSize) { - - this.trunkSize = trunkSize; - return this; - } - - public TreeRTG setCrownSize(int crownSize) { - - this.crownSize = crownSize; - return this; - } - - public TreeRTG setNoLeaves(boolean noLeaves) { - - this.noLeaves = noLeaves; - return this; - } - protected boolean isGroundValid(World world, BlockPos trunkPos) { return this.isGroundValid(world, trunkPos, rtgConfig.ALLOW_TREES_TO_GENERATE_ON_SAND.get()); @@ -190,8 +160,8 @@ protected void placeLeavesBlock(World world, BlockPos pos, IBlockState leavesBlo } @Override - public boolean isReplaceable(World world, BlockPos pos) - { + public boolean isReplaceable(World world, BlockPos pos) { + IBlockState state = world.getBlockState(pos); return state.getBlock().isAir(state, world, pos) @@ -201,8 +171,8 @@ public boolean isReplaceable(World world, BlockPos pos) } @Override - protected boolean canGrowInto(Block blockType) - { + protected boolean canGrowInto(Block blockType) { + Material material = blockType.getDefaultState().getMaterial(); return material == Material.AIR @@ -214,6 +184,7 @@ protected boolean canGrowInto(Block blockType) || material == Material.VINE || material == Material.SNOW; } + public boolean hasSpaceToGrow(World world, Random rand, BlockPos pos, int treeHeight) { WorldUtil worldUtil = new WorldUtil(world); @@ -252,4 +223,147 @@ public IBlockState getTrunkLog(IBlockState defaultLog) { return trunkLog; } + + public IBlockState getLogBlock() { + + return logBlock; + } + + public TreeRTG setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public IBlockState getLeavesBlock() { + + return leavesBlock; + } + + public TreeRTG setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } + + public int getTrunkSize() { + + return trunkSize; + } + + public TreeRTG setTrunkSize(int trunkSize) { + + this.trunkSize = trunkSize; + return this; + } + + public int getCrownSize() { + + return crownSize; + } + + public TreeRTG setCrownSize(int crownSize) { + + this.crownSize = crownSize; + return this; + } + + public boolean getNoLeaves() { + + return noLeaves; + } + + public TreeRTG setNoLeaves(boolean noLeaves) { + + this.noLeaves = noLeaves; + return this; + } + + public IBlockState getSaplingBlock() { + + return saplingBlock; + } + + public TreeRTG setSaplingBlock(IBlockState saplingBlock) { + + this.saplingBlock = saplingBlock; + return this; + } + + public int getGenerateFlag() { + + return generateFlag; + } + + public TreeRTG setGenerateFlag(int generateFlag) { + + this.generateFlag = generateFlag; + return this; + } + + public int getMinTrunkSize() { + + return minTrunkSize; + } + + public TreeRTG setMinTrunkSize(int minTrunkSize) { + + this.minTrunkSize = minTrunkSize; + return this; + } + + public int getMaxTrunkSize() { + + return maxTrunkSize; + } + + public TreeRTG setMaxTrunkSize(int maxTrunkSize) { + + this.maxTrunkSize = maxTrunkSize; + return this; + } + + public int getMinCrownSize() { + + return minCrownSize; + } + + public TreeRTG setMinCrownSize(int minCrownSize) { + + this.minCrownSize = minCrownSize; + return this; + } + + public int getMaxCrownSize() { + + return maxCrownSize; + } + + public TreeRTG setMaxCrownSize(int maxCrownSize) { + + this.maxCrownSize = maxCrownSize; + return this; + } + + public boolean isAllowBarkCoveredLogs() { + + return allowBarkCoveredLogs; + } + + public TreeRTG setAllowBarkCoveredLogs(boolean allowBarkCoveredLogs) { + + this.allowBarkCoveredLogs = allowBarkCoveredLogs; + return this; + } + + public ArrayList getValidGroundBlocks() { + + return validGroundBlocks; + } + + public TreeRTG setValidGroundBlocks(ArrayList validGroundBlocks) { + + this.validGroundBlocks = validGroundBlocks; + return this; + } } From 5ba74eba4ada70aefc3143cff8b50ca64bf6dd0d Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 03:01:54 +0000 Subject: [PATCH 06/22] Removed embedded thumbnails in tree Javadocs. --- .../tree/rtg/TreeRTGAcaciaAbyssinica.java | 2 -- .../tree/rtg/TreeRTGAcaciaBucheri.java | 2 -- .../tree/rtg/TreeRTGBetulaPapyrifera.java | 2 -- .../tree/rtg/TreeRTGCeibaPentandra.java | 27 ------------------- .../feature/tree/rtg/TreeRTGCeibaRosea.java | 27 ------------------- .../tree/rtg/TreeRTGCocosNucifera.java | 2 -- .../rtg/TreeRTGCupressusSempervirens.java | 2 -- .../feature/tree/rtg/TreeRTGPiceaPungens.java | 2 -- .../tree/rtg/TreeRTGPiceaSitchensis.java | 2 -- .../tree/rtg/TreeRTGPinusMonticola.java | 2 -- .../feature/tree/rtg/TreeRTGPinusNigra.java | 2 -- .../tree/rtg/TreeRTGPinusPonderosa.java | 2 -- .../feature/tree/rtg/TreeRTGQuercusRobur.java | 2 -- .../tree/rtg/TreeRTGRhizophoraMucronata.java | 2 -- .../tree/rtg/TreeRTGSalixMyrtilloides.java | 2 -- 15 files changed, 80 deletions(-) diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java index d21d9041b..b27a520dd 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java @@ -31,8 +31,6 @@ public class TreeRTGAcaciaAbyssinica extends TreeRTG { * decoTree.maxTrunkSize = 16;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGAcaciaAbyssinica() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java index 739230c83..cfb883f52 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java @@ -31,8 +31,6 @@ public class TreeRTGAcaciaBucheri extends TreeRTG { * decoTree.maxTrunkSize = 16;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGAcaciaBucheri() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java index e99cf84ea..8f2acb946 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java @@ -33,8 +33,6 @@ public class TreeRTGBetulaPapyrifera extends TreeRTG { * decoTree.maxCrownSize = 24;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGBetulaPapyrifera() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java index 71df30566..72e89a2eb 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java @@ -39,8 +39,6 @@ public class TreeRTGCeibaPentandra extends TreeRTG { * decoTree.maxCrownSize = 24;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGCeibaPentandra() { @@ -52,31 +50,6 @@ public TreeRTGCeibaPentandra() { this.verRand = 0.1f; } - /** - * Ceiba Pentandra (White Silk-Cotton Tree)

- * Relevant variables:
- * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
- * length, branch, verStart, verRand

- * DecoTree example:
- * DecoTree decoTree = new DecoTree(new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f));
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
- * decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
- * decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 4;
- * decoTree.minCrownSize = 10;
- * decoTree.maxCrownSize = 24;
- * decoTree.noLeaves = false;
- * this.addDeco(decoTree); - *

- * - */ public TreeRTGCeibaPentandra(float length, int branch, float verStart, float verRand) { this(); diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java index 215caa7ae..e97aa1f7e 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java @@ -40,8 +40,6 @@ public class TreeRTGCeibaRosea extends TreeRTG { * decoTree.maxCrownSize = 24;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGCeibaRosea() { @@ -53,31 +51,6 @@ public TreeRTGCeibaRosea() { verRand = 0.1f; } - /** - * Ceiba Rosea (Spanish Pochote)

- * Relevant variables:
- * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
- * length, branch, verStart, verRand

- * DecoTree example:
- * DecoTree decoTree = new DecoTree(new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f));
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
- * decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
- * decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 4;
- * decoTree.minCrownSize = 10;
- * decoTree.maxCrownSize = 24;
- * decoTree.noLeaves = false;
- * this.addDeco(decoTree); - *

- * - */ public TreeRTGCeibaRosea(float length, int branch, float verStart, float verRand) { this(); diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java index 0195e5840..86e330347 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java @@ -94,8 +94,6 @@ public class TreeRTGCocosNucifera extends TreeRTG { * decoTree.maxCrownSize = 10;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGCocosNucifera() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java index fe8a11711..9a600b4f1 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java @@ -31,8 +31,6 @@ public class TreeRTGCupressusSempervirens extends TreeRTG { * decoTree.maxCrownSize = 10;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGCupressusSempervirens() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java index 8e7393450..3e7b9c50e 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java @@ -31,8 +31,6 @@ public class TreeRTGPiceaPungens extends TreeRTG { * decoTree.maxCrownSize = 17;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGPiceaPungens() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java index f77a06216..5e33a0f51 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java @@ -33,8 +33,6 @@ public class TreeRTGPiceaSitchensis extends TreeRTG { * decoTree.maxCrownSize = 14;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGPiceaSitchensis() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java index 5473676e6..ea8674744 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java @@ -41,8 +41,6 @@ public class TreeRTGPinusMonticola extends TreeRTG { * decoTree.maxCrownSize = 12;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGPinusMonticola() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java index 0f72a9870..e89f3ee32 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java @@ -35,8 +35,6 @@ public class TreeRTGPinusNigra extends TreeRTG { * decoTree.maxCrownSize = 10;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGPinusNigra() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java index 15bf4d4b6..37113a1f5 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java @@ -36,8 +36,6 @@ public class TreeRTGPinusPonderosa extends TreeRTG { * decoTree.maxCrownSize = 29;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGPinusPonderosa() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java index a4bfd7e11..e032630dc 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java @@ -52,8 +52,6 @@ public class TreeRTGQuercusRobur extends TreeRTG { * decoTree.leavesMeta = (byte)0;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGQuercusRobur() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java index 0ec70e081..650ebba26 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java @@ -41,8 +41,6 @@ public class TreeRTGRhizophoraMucronata extends TreeRTG { * decoTree.maxCrownSize = 27;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGRhizophoraMucronata(int minBranches, int maxBranches, float branchLength, float verStart, float verRand) { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java index 61d34053f..2b63a8228 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java @@ -33,8 +33,6 @@ public class TreeRTGSalixMyrtilloides extends TreeRTG { * decoTree.leavesMeta = (byte)0;
* decoTree.noLeaves = false;
* this.addDeco(decoTree); - *

- * */ public TreeRTGSalixMyrtilloides() { From 6ac73232cb7b0e000cb2ce215bf1e67a2a22007e Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 12:45:37 +0000 Subject: [PATCH 07/22] DecoFlowersRTG now uses getters & setters. --- .../rtg/world/biome/deco/DecoFlowersRTG.java | 16 ++++++++-------- .../RealisticBiomeBOPFlowerField.java | 14 +++++++------- .../biomesoplenty/RealisticBiomeBOPGrove.java | 6 +++--- .../RealisticBiomeMFMithwoodForest.java | 14 +++++++------- .../RealisticBiomeVanillaBirchForest.java | 6 +++--- .../RealisticBiomeVanillaBirchForestHills.java | 6 +++--- .../RealisticBiomeVanillaBirchForestHillsM.java | 6 +++--- .../RealisticBiomeVanillaExtremeHillsPlus.java | 6 +++--- .../RealisticBiomeVanillaFlowerForest.java | 14 +++++++------- .../vanilla/RealisticBiomeVanillaJungle.java | 8 ++++---- .../RealisticBiomeVanillaJungleHills.java | 8 ++++---- .../vanilla/RealisticBiomeVanillaJungleM.java | 8 ++++---- .../vanilla/RealisticBiomeVanillaPlains.java | 6 +++--- 13 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java index 6abb9ebe9..4dbe39062 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java +++ b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java @@ -18,14 +18,14 @@ */ public class DecoFlowersRTG extends DecoBase { - public int[] flowers; // Integer array of flower IDs. - public float strengthFactor; // Higher = more flowers. - public int minY; // Height restriction. - public int maxY; // Height restriction. - public HeightType heightType; // How we determine the Y coord. - public int chance; // Higher = more rare. - public int notEqualsZeroChance; - public int loops; + private int[] flowers; // Integer array of flower IDs. + private float strengthFactor; // Higher = more flowers. + private int minY; // Height restriction. + private int maxY; // Height restriction. + private HeightType heightType; // How we determine the Y coord. + private int chance; // Higher = more rare. + private int notEqualsZeroChance; + private int loops; /* * FLOWER LIST: diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java index 30b8faaec..d5813f255 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java @@ -172,16 +172,16 @@ public void initDecos() { // Flowers are the most aesthetically important feature of this biome, so let's add those next. DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); - decoFlowers1.flowers = new int[]{0, 1, 2, 3, 8, 9}; //Only colourful 1-block-tall flowers. No tulips as BOP has those covered. - decoFlowers1.strengthFactor = 12f; // Lots and lots of flowers! - decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + decoFlowers1.setFlowers(new int[]{0, 1, 2, 3, 8, 9}); //Only colourful 1-block-tall flowers. No tulips as BOP has those covered. + decoFlowers1.setStrengthFactor(12f); // Lots and lots of flowers! + decoFlowers1.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); // We're only bothered about surface flowers here. this.addDeco(decoFlowers1); DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); - decoFlowers2.flowers = new int[]{10, 11, 14, 15}; //Only 2-block-tall flowers. - decoFlowers2.strengthFactor = 2f; // Not as many of these. - decoFlowers2.chance = 3; - decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + decoFlowers2.setFlowers(new int[]{10, 11, 14, 15}); //Only 2-block-tall flowers. + decoFlowers2.setStrengthFactor(2f); // Not as many of these. + decoFlowers2.setChance(3); + decoFlowers2.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); // We're only bothered about surface flowers here. this.addDeco(decoFlowers2); // Not much free space left, so let's give some space to the base biome. diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java index 1a95c32b3..5028cf3e2 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java @@ -216,9 +216,9 @@ public void initDecos() { this.addDeco(decoHelperHelper50502); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 2f; + decoFlowersRTG.setFlowers(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setStrengthFactor(2f); this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); diff --git a/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java b/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java index ac3bc60de..06ead579b 100644 --- a/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java +++ b/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java @@ -272,16 +272,16 @@ public void initDecos() { this.addDeco(decoShrub); DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); - decoFlowers1.flowers = new int[]{1, 2, 3, 6, 7, 8}; - decoFlowers1.strengthFactor = 2f; - decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; + decoFlowers1.setFlowers(new int[]{1, 2, 3, 6, 7, 8}); + decoFlowers1.setStrengthFactor(2f); + decoFlowers1.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); this.addDeco(decoFlowers1); DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); - decoFlowers2.flowers = new int[]{11, 12, 13, 14}; - decoFlowers2.strengthFactor = 1f; - decoFlowers2.chance = 1; - decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; + decoFlowers2.setFlowers(new int[]{11, 12, 13, 14}); + decoFlowers2.setStrengthFactor(1f); + decoFlowers2.setChance(1); + decoFlowers2.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); this.addDeco(decoFlowers2); DecoBoulder decoBoulder = new DecoBoulder(); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java index b21409921..dae909e37 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java @@ -237,9 +237,9 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{3, 6}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 12f; + decoFlowersRTG.setFlowers(new int[]{3, 6}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setStrengthFactor(12f); this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java index 64b87b7c9..20b782a45 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java @@ -243,9 +243,9 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{3, 6}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 12f; + decoFlowersRTG.setFlowers(new int[]{3, 6}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setStrengthFactor(12f); this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java index 8adecf36c..cf91395c1 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java @@ -183,9 +183,9 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{3, 6}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 12f; + decoFlowersRTG.setFlowers(new int[]{3, 6}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setStrengthFactor(12f); this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java index e95d38fb2..5221e05c4 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java @@ -246,9 +246,9 @@ public void initDecos() { this.addDeco(decoPumpkin); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.loops = 3; + decoFlowersRTG.setFlowers(new int[]{9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setLoops(3); this.addDeco(decoFlowersRTG); DecoLargeFernDoubleTallgrass decoDoublePlants = new DecoLargeFernDoubleTallgrass(); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java index dac2e2b00..234259787 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java @@ -178,16 +178,16 @@ public void initDecos() { // Flowers are the most aesthetically important feature of this biome, so let's add those next. DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); - decoFlowers1.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; //Only colourful 1-block-tall flowers. - decoFlowers1.strengthFactor = 12f; // Lots and lots of flowers! - decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + decoFlowers1.setFlowers(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}); //Only colourful 1-block-tall flowers. + decoFlowers1.setStrengthFactor(12f); // Lots and lots of flowers! + decoFlowers1.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); // We're only bothered about surface flowers here. this.addDeco(decoFlowers1); DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); - decoFlowers2.flowers = new int[]{10, 11, 14, 15}; //Only 2-block-tall flowers. - decoFlowers2.strengthFactor = 2f; // Not as many of these. - decoFlowers2.chance = 3; - decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + decoFlowers2.setFlowers(new int[]{10, 11, 14, 15}); //Only 2-block-tall flowers. + decoFlowers2.setStrengthFactor(2f); // Not as many of these. + decoFlowers2.setChance(3); + decoFlowers2.setHeightType(DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE); // We're only bothered about surface flowers here. this.addDeco(decoFlowers2); // Trees first. diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java index bf731c433..200ea4d6c 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java @@ -261,10 +261,10 @@ public void initDecos() { // Flowers. DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. - decoFlowersRTG.chance = 4; - decoFlowersRTG.maxY = 120; - decoFlowersRTG.strengthFactor = 2f; + decoFlowersRTG.setFlowers(new int[]{5}); // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.setChance(4); + decoFlowersRTG.setMaxY(120); + decoFlowersRTG.setStrengthFactor(2f); this.addDeco(decoFlowersRTG); // Tall cacti on red sand - matches the colour scheme nicely. diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java index 549355b94..74a50b049 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java @@ -257,10 +257,10 @@ public void initDecos() { // Flowers. DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. - decoFlowersRTG.chance = 4; - decoFlowersRTG.maxY = 120; - decoFlowersRTG.strengthFactor = 2f; + decoFlowersRTG.setFlowers(new int[]{5}); // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.setChance(4); + decoFlowersRTG.setMaxY(120); + decoFlowersRTG.setStrengthFactor(2f); this.addDeco(decoFlowersRTG); // Tall cacti on red sand - matches the colour scheme nicely. diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java index 116b073d6..2e3943f4f 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java @@ -208,10 +208,10 @@ public void initDecos() { // Flowers. DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. - decoFlowersRTG.chance = 4; - decoFlowersRTG.maxY = 120; - decoFlowersRTG.strengthFactor = 2f; + decoFlowersRTG.setFlowers(new int[]{5}); // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.setChance(4); + decoFlowersRTG.setMaxY(120); + decoFlowersRTG.setStrengthFactor(2f); this.addDeco(decoFlowersRTG); // Tall cacti on red sand - matches the colour scheme nicely. diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java index 5a36e500c..d59cc0b0e 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java @@ -142,9 +142,9 @@ public void initDecos() { // The occasional flower. DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{0, 2, 3, 4, 5, 6, 7, 8, 9}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 2f; + decoFlowersRTG.setFlowers(new int[]{0, 2, 3, 4, 5, 6, 7, 8, 9}); + decoFlowersRTG.setMaxY(128); + decoFlowersRTG.setStrengthFactor(2f); this.addDeco(decoFlowersRTG); // Lots of grass, but not as much as vanilla. From 9b14d3b74018e98a40dc8ef6d6deb6acc6063a61 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 12:45:56 +0000 Subject: [PATCH 08/22] Re-decorated vanilla Forest biome variants. --- .../deco/collection/DecoCollectionForest.java | 376 ++++++++---------- 1 file changed, 173 insertions(+), 203 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java index 90b3c2ca1..7c17db14e 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java @@ -1,5 +1,6 @@ package rtg.world.biome.deco.collection; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; @@ -12,6 +13,7 @@ import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaPungens; import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; @@ -33,208 +35,176 @@ public class DecoCollectionForest extends DecoCollectionBase { public DecoCollectionForest(boolean fallenTrees) { - // Tall trees first. - - TreeRTG ponderosaOakTreeTall = new TreeRTGPinusPonderosa(); - ponderosaOakTreeTall.logBlock = Blocks.LOG.getDefaultState(); - ponderosaOakTreeTall.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaOakTreeTall.minTrunkSize = 11; - ponderosaOakTreeTall.maxTrunkSize = 21; - ponderosaOakTreeTall.minCrownSize = 15; - ponderosaOakTreeTall.maxCrownSize = 29; - this.addTree(ponderosaOakTreeTall); - DecoTree oakPines = new DecoTree(ponderosaOakTreeTall); - oakPines.strengthFactorForLoops = 8f; - oakPines.treeType = TreeType.RTG_TREE; - oakPines.distribution = forestDistribution; - oakPines.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - oakPines.treeConditionNoise = tallMin; - oakPines.treeConditionNoise2 = tallMax; - oakPines.treeConditionChance = 1; - oakPines.maxY = 85; - - TreeRTG ponderosaSpruceTreeTall = new TreeRTGPinusPonderosa(); - ponderosaSpruceTreeTall.logBlock = BlockUtil.getStateLog(1); - ponderosaSpruceTreeTall.leavesBlock = BlockUtil.getStateLeaf(1); - ponderosaSpruceTreeTall.minTrunkSize = 11; - ponderosaSpruceTreeTall.maxTrunkSize = 21; - ponderosaSpruceTreeTall.minCrownSize = 15; - ponderosaSpruceTreeTall.maxCrownSize = 29; - this.addTree(ponderosaSpruceTreeTall); - DecoTree sprucePines = new DecoTree(ponderosaSpruceTreeTall); - sprucePines.strengthFactorForLoops = 8f; - sprucePines.treeType = TreeType.RTG_TREE; - sprucePines.distribution = forestDistribution; - sprucePines.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - sprucePines.treeConditionNoise = tallMin; - sprucePines.treeConditionNoise2 = tallMax; - sprucePines.treeConditionChance = 1; - sprucePines.maxY = 85; - - DecoHelper5050 decoPines = new DecoHelper5050(oakPines, sprucePines); - this.addDeco(decoPines); - - // Short trees next. - - TreeRTG ponderosaOakTreeShort1 = new TreeRTGPiceaSitchensis(); - ponderosaOakTreeShort1.logBlock = Blocks.LOG.getDefaultState(); - ponderosaOakTreeShort1.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaOakTreeShort1.minTrunkSize = 4; - ponderosaOakTreeShort1.maxTrunkSize = 10; - ponderosaOakTreeShort1.minCrownSize = 6; - ponderosaOakTreeShort1.maxCrownSize = 14; - this.addTree(ponderosaOakTreeShort1); - DecoTree oakPinesShort1 = new DecoTree(ponderosaOakTreeShort1); - oakPinesShort1.strengthFactorForLoops = 8f; - oakPinesShort1.treeType = TreeType.RTG_TREE; - oakPinesShort1.distribution = forestDistribution; - oakPinesShort1.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - oakPinesShort1.treeConditionNoise = short1Min; - oakPinesShort1.treeConditionNoise2 = short1Max; - oakPinesShort1.treeConditionChance = 1; - oakPinesShort1.maxY = 85; - - TreeRTG ponderosaSpruceTreeShort1 = new TreeRTGPiceaSitchensis(); - ponderosaSpruceTreeShort1.logBlock = BlockUtil.getStateLog(1); - ponderosaSpruceTreeShort1.leavesBlock = BlockUtil.getStateLeaf(1); - ponderosaSpruceTreeShort1.minTrunkSize = 4; - ponderosaSpruceTreeShort1.maxTrunkSize = 10; - ponderosaSpruceTreeShort1.minCrownSize = 6; - ponderosaSpruceTreeShort1.maxCrownSize = 14; - this.addTree(ponderosaSpruceTreeShort1); - DecoTree sprucePinesShort1 = new DecoTree(ponderosaSpruceTreeShort1); - sprucePinesShort1.strengthFactorForLoops = 8f; - sprucePinesShort1.treeType = TreeType.RTG_TREE; - sprucePinesShort1.distribution = forestDistribution; - sprucePinesShort1.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - sprucePinesShort1.treeConditionNoise = short1Min; - sprucePinesShort1.treeConditionNoise2 = short1Max; - sprucePinesShort1.treeConditionChance = 1; - sprucePinesShort1.maxY = 85; - - DecoHelper5050 decoPinesShort1 = new DecoHelper5050(oakPinesShort1, sprucePinesShort1); - this.addDeco(decoPinesShort1); - - // Short trees next on the other 'side' of the noise spectrum. - - TreeRTG ponderosaOakTreeShort2 = new TreeRTGPiceaSitchensis(); - ponderosaOakTreeShort2.logBlock = Blocks.LOG.getDefaultState(); - ponderosaOakTreeShort2.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaOakTreeShort2.minTrunkSize = 4; - ponderosaOakTreeShort2.maxTrunkSize = 10; - ponderosaOakTreeShort2.minCrownSize = 6; - ponderosaOakTreeShort2.maxCrownSize = 14; - this.addTree(ponderosaOakTreeShort2); - DecoTree oakPinesShort2 = new DecoTree(ponderosaOakTreeShort2); - oakPinesShort2.strengthFactorForLoops = 8f; - oakPinesShort2.treeType = TreeType.RTG_TREE; - oakPinesShort2.distribution = forestDistribution; - oakPinesShort2.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - oakPinesShort2.treeConditionNoise = short2Min; - oakPinesShort2.treeConditionNoise2 = short2Max; - oakPinesShort2.treeConditionChance = 1; - oakPinesShort2.maxY = 85; - - TreeRTG ponderosaSpruceTreeShort2 = new TreeRTGPiceaSitchensis(); - ponderosaSpruceTreeShort2.logBlock = BlockUtil.getStateLog(1); - ponderosaSpruceTreeShort2.leavesBlock = BlockUtil.getStateLeaf(1); - ponderosaSpruceTreeShort2.minTrunkSize = 4; - ponderosaSpruceTreeShort2.maxTrunkSize = 10; - ponderosaSpruceTreeShort2.minCrownSize = 6; - ponderosaSpruceTreeShort2.maxCrownSize = 14; - this.addTree(ponderosaSpruceTreeShort2); - DecoTree sprucePinesShort2 = new DecoTree(ponderosaSpruceTreeShort2); - sprucePinesShort2.strengthFactorForLoops = 8f; - sprucePinesShort2.treeType = TreeType.RTG_TREE; - sprucePinesShort2.distribution = forestDistribution; - sprucePinesShort2.treeCondition = TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE; - sprucePinesShort2.treeConditionNoise = short2Min; - sprucePinesShort2.treeConditionNoise2 = short2Max; - sprucePinesShort2.treeConditionChance = 1; - sprucePinesShort2.maxY = 85; - - DecoHelper5050 decoPinesShort2 = new DecoHelper5050(oakPinesShort2, sprucePinesShort2); - this.addDeco(decoPinesShort2); - - // More trees. - - TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); - sitchensisTree.logBlock = Blocks.LOG.getDefaultState(); - sitchensisTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - sitchensisTree.minTrunkSize = 4; - sitchensisTree.maxTrunkSize = 10; - sitchensisTree.minCrownSize = 6; - sitchensisTree.maxCrownSize = 14; - this.addTree(sitchensisTree); - DecoTree oakPine = new DecoTree(sitchensisTree); - oakPine.strengthFactorForLoops = 3f; - oakPine.treeType = TreeType.RTG_TREE; - oakPine.treeCondition = TreeCondition.RANDOM_CHANCE; - oakPine.treeConditionChance = 4; - oakPine.maxY = 100; - - WorldGenerator vanillaTreeDefinition = new WorldGenTrees(false); - DecoTree vanillaTrees = new DecoTree(vanillaTreeDefinition); - vanillaTrees.strengthFactorForLoops = 3f; - vanillaTrees.treeType = TreeType.WORLDGEN; - vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; - vanillaTrees.treeConditionChance = 3; - vanillaTrees.maxY = 120; - - DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); - decoHelperRandomSplit.decos = new DecoBase[]{oakPine, vanillaTrees}; - decoHelperRandomSplit.chances = new int[]{8, 4}; - this.addDeco(decoHelperRandomSplit); - - // Add some fallen trees of the oak and spruce variety (50/50 distribution). - DecoFallenTree decoFallenOak = new DecoFallenTree(); - decoFallenOak.logCondition = LogCondition.RANDOM_CHANCE; - decoFallenOak.logConditionChance = 16; - decoFallenOak.maxY = 80; - decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); - decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenOak.minSize = 3; - decoFallenOak.maxSize = 6; - - DecoFallenTree decoFallenSpruce = new DecoFallenTree(); - decoFallenSpruce.logCondition = LogCondition.RANDOM_CHANCE; - decoFallenSpruce.logConditionChance = 24; - decoFallenSpruce.maxY = 80; - decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); - decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenSpruce.minSize = 3; - decoFallenSpruce.maxSize = 6; - - DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenOak, decoFallenSpruce); - this.addDeco(decoFallenTree, fallenTrees); - - // Shrubs to fill in the blanks. - DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.maxY = 140; - decoShrubOak.strengthFactor = 4f; - decoShrubOak.chance = 3; - this.addDeco(decoShrubOak); - - DecoShrub decoShrubSpruce = new DecoShrub(); - decoShrubSpruce.logBlock = BlockUtil.getStateLog(1); - decoShrubSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - decoShrubSpruce.maxY = 140; - decoShrubSpruce.strengthFactor = 4f; - decoShrubSpruce.chance = 9; - this.addDeco(decoShrubSpruce); - - // Only 1-block tall flowers so we can see the trees better. - DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); - decoFlowersRTG.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - decoFlowersRTG.maxY = 128; - decoFlowersRTG.strengthFactor = 6f; - this.addDeco(decoFlowersRTG); - - // Grass filler. - DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 60; - decoGrass.maxY = 128; - decoGrass.loops = 8; - this.addDeco(decoGrass); + this + .addDeco(tallTrees(tallMin, tallMax)) // Tall trees first. + .addDeco(vines()) // Some vines. + .addDeco(shortTrees(short1Min, short1Max)) // Short trees next. + .addDeco(shortTrees(short2Min, short2Max)) // More short trees (on the other 'side' of the noise spectrum). + .addDeco(randomTrees()) // More trees. + .addDeco(logs(), fallenTrees) // Add some fallen trees of the oak and spruce variety (50/50 distribution). + .addDeco(shrubsOak()) // Shrubs to fill in the blanks. + .addDeco(shrubsSpruce()) // Fewer spruce shrubs than oak. + .addDeco(flowers()) // Only 1-block tall flowers so we can see the trees better. + .addDeco(grass()) // Grass filler. + ; + } + + private DecoHelper5050 tallTrees(float noiseMin, float noiseMax) { + return new DecoHelper5050( + tallPineTrees(Blocks.LOG.getDefaultState(), Blocks.LEAVES.getDefaultState(), noiseMin, noiseMax), + tallPineTrees(BlockUtil.getStateLog(1), BlockUtil.getStateLeaf(1), noiseMin, noiseMax) + ); + } + + private DecoTree tallPineTrees(IBlockState log, IBlockState leaves, float noiseMin, float noiseMax) { + + TreeRTG pinusPonderosa = new TreeRTGPinusPonderosa(); + pinusPonderosa.logBlock = log; + pinusPonderosa.leavesBlock = leaves; + pinusPonderosa.minTrunkSize = 11; + pinusPonderosa.maxTrunkSize = 21; + pinusPonderosa.minCrownSize = 15; + pinusPonderosa.maxCrownSize = 29; + + this.addTree(pinusPonderosa); + + return new DecoTree(pinusPonderosa) + .setStrengthFactorForLoops(8f) + .setTreeType(TreeType.RTG_TREE) + .setDistribution(forestDistribution) + .setTreeCondition(TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE) + .setTreeConditionNoise(noiseMin) + .setTreeConditionNoise2(noiseMax) + .setTreeConditionChance(1) + .setMaxY(85); + } + + private DecoHelper5050 shortTrees(float noiseMin, float noiseMax) { + return new DecoHelper5050( + shortPineTrees(Blocks.LOG.getDefaultState(), Blocks.LEAVES.getDefaultState(), noiseMin, noiseMax), + shortPineTrees(BlockUtil.getStateLog(1), BlockUtil.getStateLeaf(1), noiseMin, noiseMax) + ); + } + + private DecoTree shortPineTrees(IBlockState log, IBlockState leaves, float noiseMin, float noiseMax) { + + TreeRTG piceaSitchensis = new TreeRTGPiceaSitchensis() + .setLogBlock(log) + .setLeavesBlock(leaves) + .setMinTrunkSize(4) + .setMaxTrunkSize(10) + .setMinCrownSize(6) + .setMaxCrownSize(14); + + this.addTree(piceaSitchensis); + + return new DecoTree(piceaSitchensis) + .setStrengthFactorForLoops(6f) + .setTreeType(TreeType.RTG_TREE) + .setDistribution(forestDistribution) + .setTreeCondition(TreeCondition.NOISE_BETWEEN_AND_RANDOM_CHANCE) + .setTreeConditionNoise(noiseMin) + .setTreeConditionNoise2(noiseMax) + .setTreeConditionChance(1) + .setMaxY(85); + } + + private DecoHelperRandomSplit randomTrees() { + return new DecoHelperRandomSplit() + .setDecos(new DecoBase[]{randomPungensTrees(), randomVanillaTrees()}) + .setChances(new int[]{8, 4}); + } + + private DecoTree randomPungensTrees() { + + TreeRTG piceaPungens = new TreeRTGPiceaPungens() + .setLogBlock(Blocks.LOG.getDefaultState()) + .setLeavesBlock(Blocks.LEAVES.getDefaultState()) + .setMinTrunkSize(2) + .setMaxTrunkSize(4) + .setMinCrownSize(5) + .setMaxCrownSize(8); + + this.addTree(piceaPungens); + + return new DecoTree(piceaPungens) + .setStrengthFactorForLoops(3f) + .setTreeType(TreeType.RTG_TREE) + .setTreeCondition(TreeCondition.RANDOM_CHANCE) + .setTreeConditionChance(5) + .setMaxY(100); + } + + private DecoTree randomVanillaTrees() { + + WorldGenerator worldGenTrees = new WorldGenTrees(false); + + return new DecoTree(worldGenTrees) + .setStrengthFactorForLoops(3f) + .setTreeType(TreeType.WORLDGEN) + .setTreeCondition(TreeCondition.RANDOM_CHANCE) + .setTreeConditionChance(3) + .setMaxY(120); + } + + private DecoVines vines() { + return new DecoVines() + .setStrengthFactor(6f); + } + + private DecoHelper5050 logs() { + return new DecoHelper5050(oakLogs(), spruceLogs()); + } + + private DecoFallenTree oakLogs() { + return new DecoFallenTree() + .setLogCondition(LogCondition.RANDOM_CHANCE) + .setLogConditionChance(16) + .setMaxY(80) + .setLogBlock(Blocks.LOG.getDefaultState()) + .setLeavesBlock(Blocks.LEAVES.getDefaultState()) + .setMinSize(3) + .setMaxSize(6); + } + + private DecoFallenTree spruceLogs() { + return new DecoFallenTree() + .setLogCondition(LogCondition.RANDOM_CHANCE) + .setLogConditionChance(24) + .setMaxY(80) + .setLogBlock(BlockUtil.getStateLog(1)) + .setLeavesBlock(BlockUtil.getStateLeaf(1)) + .setMinSize(3) + .setMaxSize(6); + } + + private DecoShrub shrubsOak() { + return new DecoShrub() + .setMaxY(140) + .setStrengthFactor(4f) + .setChance(3); + } + + private DecoShrub shrubsSpruce() { + return new DecoShrub() + .setLogBlock(BlockUtil.getStateLog(1)) + .setLeavesBlock(BlockUtil.getStateLeaf(1)) + .setMaxY(140) + .setStrengthFactor(4f) + .setChance(9); + } + + private DecoFlowersRTG flowers() { + return new DecoFlowersRTG() + .setFlowers(new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) + .setMaxY(128) + .setStrengthFactor(6f); + } + + private DecoGrass grass() { + return new DecoGrass() + .setMinY(60) + .setMaxY(128) + .setLoops(8); } } From 589cb07d92a307b6e3069bc9202b39979b5ade6f Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 14:37:33 +0000 Subject: [PATCH 09/22] Bumped to 4.1.2.1 --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 729c6b3b9..4f2d749f7 100644 --- a/build.properties +++ b/build.properties @@ -3,7 +3,7 @@ mod_id=RTG mod_name=Realistic Terrain Generation mod_desc=Adds a new world type which generates realistic terrain for Overworld biomes. -mod_version=4.1.2.0 +mod_version=4.1.2.1 mc_version=1.10.2 mod_url=https://github.com/Team-RTG/Realistic-Terrain-Generation mod_author="Team RTG" From 1ac57d6e9a468ef675b795301d498be3537b48f0 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sun, 18 Dec 2016 19:42:45 +0000 Subject: [PATCH 10/22] Added DecoForgeEvent. --- .../rtg/world/biome/deco/DecoForgeEvent.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/main/java/rtg/world/biome/deco/DecoForgeEvent.java diff --git a/src/main/java/rtg/world/biome/deco/DecoForgeEvent.java b/src/main/java/rtg/world/biome/deco/DecoForgeEvent.java new file mode 100644 index 000000000..46b42db84 --- /dev/null +++ b/src/main/java/rtg/world/biome/deco/DecoForgeEvent.java @@ -0,0 +1,52 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; + +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import rtg.api.world.RTGWorld; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoForgeEvent extends DecoBase { + + private DecorateBiomeEvent.Decorate.EventType event; + + public DecoForgeEvent(DecorateBiomeEvent.Decorate.EventType event) { + + super(); + + this.event = event; + } + + @Override + public boolean properlyDefined() { + + try { + if (this.event != null) { + return true; + } + } + catch (Exception e) { + return false; + } + + return false; + } + + @Override + public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, int worldX, int worldZ, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), this.event)) { + ; + } + } + } +} From 299b82b261dfcf6d7a65e9068f945a38dc21f174 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Mon, 19 Dec 2016 09:31:31 +0000 Subject: [PATCH 11/22] Removed rivers from BOP Alps & Tropical Rainforest. --- .../biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java | 1 + .../biomesoplenty/RealisticBiomeBOPTropicalRainforest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java index 92a6f99af..bde32fdbe 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java @@ -30,6 +30,7 @@ public RealisticBiomeBOPAlps() { this.generatesEmeralds = true; this.noLakes = true; + this.noWaterFeatures = true; } @Override diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java index 1fcbb3d2f..32c735331 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java @@ -26,6 +26,9 @@ public class RealisticBiomeBOPTropicalRainforest extends RealisticBiomeBOPBase { public RealisticBiomeBOPTropicalRainforest() { super(biome, river); + + this.noLakes = true; + this.noWaterFeatures = true; } @Override From feea2689376f492ac9d1da551356ea01464e8d3a Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Tue, 20 Dec 2016 01:02:17 +0000 Subject: [PATCH 12/22] Fixed incorrect default STRONGHOLD_COUNT in config comments. --- src/main/java/rtg/api/config/RTGConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/rtg/api/config/RTGConfig.java b/src/main/java/rtg/api/config/RTGConfig.java index ce76ddf5d..17c24bf0f 100644 --- a/src/main/java/rtg/api/config/RTGConfig.java +++ b/src/main/java/rtg/api/config/RTGConfig.java @@ -1048,7 +1048,7 @@ public RTGConfig() { "Strongholds", "This setting is the number of strongholds that exist per world." + Configuration.NEW_LINE + - "HIGHER values = MORE strongholds & MORE lag. (3 = Vanilla)", + "HIGHER values = MORE strongholds & MORE lag. (128 = Vanilla)", 128, 1, Integer.MAX_VALUE ); this.addProperty(STRONGHOLD_COUNT); From e5d0a10cbdc12a39a121cfbe2d2f3222f875b2e3 Mon Sep 17 00:00:00 2001 From: srs-bsns Date: Tue, 20 Dec 2016 17:50:08 -0500 Subject: [PATCH 13/22] proper check of AbyssalCraft biome registration before Instantiating Realistic classes Closes #1086 --- .../abyssalcraft/RealisticBiomeACBase.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java index 3a1e85139..b70a1ea14 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java @@ -2,6 +2,7 @@ import net.minecraft.world.biome.Biome; +import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.fml.common.Loader; import com.shinoow.abyssalcraft.api.biome.ACBiomes; @@ -36,22 +37,22 @@ public static void addBiomes() { if (Loader.isModLoaded("abyssalcraft")) { - if (null != ACBiomes.coralium_infested_swamp) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.coralium_infested_swamp)) { acCoraliumInfestedSwamp = new RealisticBiomeACCoraliumInfestedSwamp(); } - if (null != ACBiomes.darklands) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.darklands)) { acDarklands = new RealisticBiomeACDarklands(); } - if (null != ACBiomes.darklands_forest) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.darklands_forest)) { acDarklandsForest = new RealisticBiomeACDarklandsForest(); } - if (null != ACBiomes.darklands_hills) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.darklands_hills)) { acDarklandsHighland = new RealisticBiomeACDarklandsHighland(); } - if (null != ACBiomes.darklands_mountains) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.darklands_mountains)) { acDarklandsMountains = new RealisticBiomeACDarklandsMountains(); } - if (null != ACBiomes.darklands_plains) { + if (BiomeDictionary.isBiomeRegistered(ACBiomes.darklands_plains)) { acDarklandsPlains = new RealisticBiomeACDarklandsPlains(); } } From 1db5ae7dbbb1039d574689cadf8c91abff49345f Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Fri, 23 Dec 2016 12:33:06 +0000 Subject: [PATCH 14/22] More getter/setter conversion in decoration system. --- src/main/java/rtg/event/EventManagerRTG.java | 24 +- .../biome/deco/DecoAbyssalCraftTree.java | 38 +-- .../java/rtg/world/biome/deco/DecoBase.java | 75 +++++- .../biome/deco/DecoBaseBiomeDecorations.java | 75 +++++- .../rtg/world/biome/deco/DecoBoulder.java | 88 +++++- .../java/rtg/world/biome/deco/DecoCactus.java | 90 ++++++- .../rtg/world/biome/deco/DecoCobwebs.java | 90 ++++++- .../java/rtg/world/biome/deco/DecoCrop.java | 125 ++++++++- .../rtg/world/biome/deco/DecoDeadBush.java | 60 ++++- .../rtg/world/biome/deco/DecoDesertWell.java | 62 ++++- .../rtg/world/biome/deco/DecoDoubleGrass.java | 47 +++- .../rtg/world/biome/deco/DecoFallenTree.java | 123 +++++---- .../rtg/world/biome/deco/DecoFlowersRTG.java | 26 +- .../java/rtg/world/biome/deco/DecoGrass.java | 52 ++-- .../biome/deco/DecoGrassDoubleTallgrass.java | 75 +++++- .../rtg/world/biome/deco/DecoJungleCacti.java | 75 +++++- .../deco/DecoLargeFernDoubleTallgrass.java | 63 ++++- .../java/rtg/world/biome/deco/DecoLayer.java | 161 +++++++++-- .../rtg/world/biome/deco/DecoMushrooms.java | 96 +++++-- .../java/rtg/world/biome/deco/DecoPond.java | 52 +++- .../rtg/world/biome/deco/DecoPumpkin.java | 96 +++++-- .../java/rtg/world/biome/deco/DecoReed.java | 47 +++- .../java/rtg/world/biome/deco/DecoShrub.java | 84 +++--- .../java/rtg/world/biome/deco/DecoTree.java | 239 +++++++++------- .../java/rtg/world/biome/deco/DecoVines.java | 36 +-- .../deco/collection/DecoCollectionDesert.java | 18 +- .../collection/DecoCollectionDesertRiver.java | 60 ++--- .../deco/collection/DecoCollectionForest.java | 12 +- .../collection/DecoCollectionMegaTaiga.java | 72 ++--- .../collection/DecoCollectionSavanna.java | 70 ++--- .../DecoCollectionSmallPineTreesForest.java | 32 +-- .../deco/collection/DecoCollectionTaiga.java | 254 +++++++++--------- .../deco/helper/DecoHelperThisOrThat.java | 28 +- .../biome/realistic/RealisticBiomeBase.java | 8 +- ...RealisticBiomeACCoraliumInfestedSwamp.java | 4 +- .../RealisticBiomeACDarklands.java | 27 +- .../RealisticBiomeACDarklandsForest.java | 49 ++-- .../RealisticBiomeACDarklandsHighland.java | 4 +- .../RealisticBiomeACDarklandsMountains.java | 4 +- .../RealisticBiomeACDarklandsPlains.java | 4 +- .../realistic/abyssalcraft/SurfaceACBase.java | 2 +- .../RealisticBiomeARBambooGrove.java | 4 +- .../RealisticBiomeARCoralReef.java | 4 +- .../RealisticBiomeARDeepReef.java | 2 +- .../RealisticBiomeARKelpForest.java | 4 +- .../RealisticBiomeAROrchard.java | 4 +- .../RealisticBiomeARTropicalHills.java | 4 +- .../RealisticBiomeBAFarmlandBiome.java | 105 ++++---- .../biomesoplenty/RealisticBiomeBOPAlps.java | 4 +- .../RealisticBiomeBOPBambooForest.java | 4 +- .../biomesoplenty/RealisticBiomeBOPBayou.java | 95 +++---- .../biomesoplenty/RealisticBiomeBOPBog.java | 2 +- .../RealisticBiomeBOPBorealForest.java | 4 +- .../RealisticBiomeBOPBrushland.java | 4 +- .../RealisticBiomeBOPChaparral.java | 4 +- .../RealisticBiomeBOPCherryBlossomGrove.java | 55 ++-- .../RealisticBiomeBOPColdDesert.java | 4 +- .../RealisticBiomeBOPConiferousForest.java | 39 +-- .../RealisticBiomeBOPCoralReef.java | 2 +- .../biomesoplenty/RealisticBiomeBOPCrag.java | 6 +- .../RealisticBiomeBOPDeadForest.java | 61 ++--- .../RealisticBiomeBOPDeadSwamp.java | 2 +- .../RealisticBiomeBOPEucalyptusForest.java | 41 +-- .../biomesoplenty/RealisticBiomeBOPFen.java | 63 ++--- .../RealisticBiomeBOPFlowerField.java | 16 +- .../RealisticBiomeBOPFlowerIsland.java | 2 +- .../RealisticBiomeBOPGlacier.java | 4 +- .../RealisticBiomeBOPGrassland.java | 2 +- .../RealisticBiomeBOPGravelBeach.java | 4 +- .../biomesoplenty/RealisticBiomeBOPGrove.java | 69 ++--- .../RealisticBiomeBOPHeathland.java | 23 +- .../RealisticBiomeBOPHighland.java | 2 +- .../RealisticBiomeBOPKelpForest.java | 2 +- .../RealisticBiomeBOPLandOfLakes.java | 95 +++---- .../RealisticBiomeBOPLavenderFields.java | 14 +- .../RealisticBiomeBOPLushDesert.java | 35 +-- .../RealisticBiomeBOPLushSwamp.java | 29 +- .../RealisticBiomeBOPMangrove.java | 2 +- .../RealisticBiomeBOPMapleWoods.java | 21 +- .../biomesoplenty/RealisticBiomeBOPMarsh.java | 2 +- .../RealisticBiomeBOPMeadow.java | 2 +- .../biomesoplenty/RealisticBiomeBOPMoor.java | 2 +- .../RealisticBiomeBOPMountainFoothills.java | 4 +- .../RealisticBiomeBOPMountainPeaks.java | 43 +-- .../RealisticBiomeBOPMysticGrove.java | 19 +- .../biomesoplenty/RealisticBiomeBOPOasis.java | 23 +- .../RealisticBiomeBOPOminousWoods.java | 19 +- .../RealisticBiomeBOPOrchard.java | 21 +- .../RealisticBiomeBOPOriginIsland.java | 2 +- .../RealisticBiomeBOPOutback.java | 4 +- .../RealisticBiomeBOPOvergrownCliffs.java | 4 +- .../RealisticBiomeBOPPrairie.java | 2 +- .../RealisticBiomeBOPQuagmire.java | 2 +- .../RealisticBiomeBOPRainforest.java | 4 +- .../RealisticBiomeBOPRedwoodForest.java | 39 +-- .../RealisticBiomeBOPSacredSprings.java | 2 +- .../RealisticBiomeBOPSeasonalForest.java | 29 +- .../RealisticBiomeBOPShield.java | 55 ++-- .../RealisticBiomeBOPShrubland.java | 2 +- ...ealisticBiomeBOPSnowyConiferousForest.java | 35 +-- .../RealisticBiomeBOPSnowyForest.java | 4 +- .../RealisticBiomeBOPSteppe.java | 2 +- .../RealisticBiomeBOPTemperateRainforest.java | 4 +- .../RealisticBiomeBOPTropicalIsland.java | 25 +- .../RealisticBiomeBOPTropicalRainforest.java | 2 +- .../RealisticBiomeBOPTundra.java | 2 +- .../RealisticBiomeBOPVolcanicIsland.java | 10 +- .../RealisticBiomeBOPWasteland.java | 2 +- .../RealisticBiomeBOPWetland.java | 2 +- .../RealisticBiomeBOPWoodland.java | 2 +- .../RealisticBiomeBOPXericShrubland.java | 4 +- .../RealisticBiomeBYGAthuraForest.java | 28 +- .../RealisticBiomeBYGAutumnForest.java | 93 +++---- .../RealisticBiomeBYGBirchPlains.java | 41 +-- .../RealisticBiomeBYGFrozenTundra.java | 4 +- .../RealisticBiomeBYGLushForest.java | 41 +-- .../RealisticBiomeBYGMushroomMountains.java | 4 +- .../RealisticBiomeBYGRedDesert.java | 2 +- .../RealisticBiomeBYGRedRockMountains.java | 6 +- .../biomesyougo/RealisticBiomeBYGShrubs.java | 39 +-- .../RealisticBiomeBYGWillowSwamps.java | 75 +++--- .../RealisticBiomeFCPhantasia.java | 4 +- .../RealisticBiomeMWAppleForest.java | 45 ++-- .../mineworld/RealisticBiomeMWArctic.java | 4 +- .../mineworld/RealisticBiomeMWDeadForest.java | 61 ++--- .../mineworld/RealisticBiomeMWIceHills.java | 4 +- .../mineworld/RealisticBiomeMWPalms.java | 6 +- .../mineworld/RealisticBiomeMWVolcano.java | 4 +- .../RealisticBiomeMFMithwoodForest.java | 213 +++++++-------- .../RealisticBiomeMCMBlackPlain.java | 4 +- .../morechinesemc/RealisticBiomeMCMBog.java | 4 +- .../RealisticBiomeMCMLoessPlateau.java | 43 +-- .../RealisticBiomeMCMMudFlat.java | 4 +- .../RealisticBiomeMCMWarmTaiga.java | 43 +-- .../RealisticBiomeSFSugiForest.java | 59 ++-- .../vanilla/RealisticBiomeVanillaBeach.java | 24 +- .../RealisticBiomeVanillaBirchForest.java | 81 +++--- ...RealisticBiomeVanillaBirchForestHills.java | 81 +++--- ...ealisticBiomeVanillaBirchForestHillsM.java | 79 +++--- .../RealisticBiomeVanillaBirchForestM.java | 57 ++-- .../RealisticBiomeVanillaColdBeach.java | 12 +- .../RealisticBiomeVanillaColdTaiga.java | 4 +- .../RealisticBiomeVanillaColdTaigaHills.java | 4 +- .../RealisticBiomeVanillaColdTaigaM.java | 2 +- .../RealisticBiomeVanillaDeepOcean.java | 2 +- .../vanilla/RealisticBiomeVanillaDesert.java | 2 +- .../RealisticBiomeVanillaDesertHills.java | 4 +- .../vanilla/RealisticBiomeVanillaDesertM.java | 4 +- .../RealisticBiomeVanillaExtremeHills.java | 85 +++--- ...RealisticBiomeVanillaExtremeHillsEdge.java | 83 +++--- .../RealisticBiomeVanillaExtremeHillsM.java | 4 +- ...RealisticBiomeVanillaExtremeHillsPlus.java | 77 +++--- ...ealisticBiomeVanillaExtremeHillsPlusM.java | 4 +- .../RealisticBiomeVanillaFlowerForest.java | 105 ++++---- .../vanilla/RealisticBiomeVanillaForest.java | 4 +- .../RealisticBiomeVanillaForestHills.java | 4 +- .../RealisticBiomeVanillaFrozenOcean.java | 4 +- .../RealisticBiomeVanillaFrozenRiver.java | 2 +- .../RealisticBiomeVanillaIceMountains.java | 4 +- .../RealisticBiomeVanillaIcePlains.java | 27 +- .../RealisticBiomeVanillaIcePlainsSpikes.java | 2 +- .../vanilla/RealisticBiomeVanillaJungle.java | 113 ++++---- .../RealisticBiomeVanillaJungleEdge.java | 25 +- .../RealisticBiomeVanillaJungleEdgeM.java | 25 +- .../RealisticBiomeVanillaJungleHills.java | 113 ++++---- .../vanilla/RealisticBiomeVanillaJungleM.java | 113 ++++---- .../RealisticBiomeVanillaMegaSpruceTaiga.java | 27 +- .../RealisticBiomeVanillaMegaTaiga.java | 57 ++-- .../RealisticBiomeVanillaMegaTaigaHills.java | 57 ++-- .../vanilla/RealisticBiomeVanillaMesa.java | 22 +- .../RealisticBiomeVanillaMesaBryce.java | 22 +- .../RealisticBiomeVanillaMesaPlateau.java | 36 +-- .../RealisticBiomeVanillaMesaPlateauF.java | 36 +-- .../RealisticBiomeVanillaMesaPlateauFM.java | 36 +-- .../RealisticBiomeVanillaMesaPlateauM.java | 18 +- .../RealisticBiomeVanillaMushroomIsland.java | 4 +- ...listicBiomeVanillaMushroomIslandShore.java | 4 +- .../vanilla/RealisticBiomeVanillaOcean.java | 4 +- .../vanilla/RealisticBiomeVanillaPlains.java | 76 +++--- ...ealisticBiomeVanillaRedwoodTaigaHills.java | 57 ++-- .../vanilla/RealisticBiomeVanillaRiver.java | 2 +- .../RealisticBiomeVanillaRoofedForest.java | 159 +++++------ .../RealisticBiomeVanillaRoofedForestM.java | 87 +++--- .../vanilla/RealisticBiomeVanillaSavanna.java | 4 +- .../RealisticBiomeVanillaSavannaM.java | 4 +- .../RealisticBiomeVanillaSavannaPlateau.java | 56 ++-- .../RealisticBiomeVanillaSavannaPlateauM.java | 58 ++-- .../RealisticBiomeVanillaStoneBeach.java | 4 +- .../RealisticBiomeVanillaSunflowerPlains.java | 4 +- .../RealisticBiomeVanillaSwampland.java | 83 +++--- .../RealisticBiomeVanillaSwamplandM.java | 80 +++--- .../vanilla/RealisticBiomeVanillaTaiga.java | 4 +- .../RealisticBiomeVanillaTaigaHills.java | 4 +- .../vanilla/RealisticBiomeVanillaTaigaM.java | 4 +- .../rtg/world/gen/feature/WorldGenBlob.java | 2 +- .../rtg/world/gen/feature/WorldGenBlock.java | 48 +++- .../rtg/world/gen/feature/WorldGenCacti.java | 13 +- .../rtg/world/gen/feature/WorldGenLayers.java | 70 ++++- .../rtg/world/gen/feature/WorldGenLog.java | 26 +- .../world/gen/feature/WorldGenVinesRTG.java | 70 ++++- .../world/gen/feature/tree/rtg/TreeRTG.java | 65 ++--- .../tree/rtg/TreeRTGAcaciaAbyssinica.java | 24 +- .../tree/rtg/TreeRTGAcaciaBucheri.java | 24 +- .../tree/rtg/TreeRTGBetulaPapyrifera.java | 28 +- .../tree/rtg/TreeRTGCeibaPentandra.java | 24 +- .../feature/tree/rtg/TreeRTGCeibaRosea.java | 24 +- .../tree/rtg/TreeRTGCocosNucifera.java | 28 +- .../rtg/TreeRTGCupressusSempervirens.java | 24 +- .../feature/tree/rtg/TreeRTGPiceaPungens.java | 24 +- .../tree/rtg/TreeRTGPiceaSitchensis.java | 30 +-- .../tree/rtg/TreeRTGPinusMonticola.java | 24 +- .../feature/tree/rtg/TreeRTGPinusNigra.java | 24 +- .../tree/rtg/TreeRTGPinusPonderosa.java | 24 +- .../feature/tree/rtg/TreeRTGQuercusRobur.java | 20 +- .../tree/rtg/TreeRTGRhizophoraMucronata.java | 24 +- .../tree/rtg/TreeRTGSalixMyrtilloides.java | 16 +- 216 files changed, 4438 insertions(+), 3066 deletions(-) diff --git a/src/main/java/rtg/event/EventManagerRTG.java b/src/main/java/rtg/event/EventManagerRTG.java index 40f7f501a..cc012e0ec 100644 --- a/src/main/java/rtg/event/EventManagerRTG.java +++ b/src/main/java/rtg/event/EventManagerRTG.java @@ -240,12 +240,12 @@ public void saplingGrowTreeRTG(SaplingGrowTreeEvent event) { for (int i = 0; i < biomeTrees.size(); i++) { Logger.debug("Biome Tree #%d = %s", i, biomeTrees.get(i).getClass().getName()); - Logger.debug("Biome Tree #%d Sapling Block = %s", i, biomeTrees.get(i).saplingBlock.getBlock().getLocalizedName()); - Logger.debug("Biome Tree #%d Sapling Meta = %d", i, SaplingUtil.getMetaFromState(biomeTrees.get(i).saplingBlock)); + Logger.debug("Biome Tree #%d Sapling Block = %s", i, biomeTrees.get(i).getSaplingBlock().getBlock().getLocalizedName()); + Logger.debug("Biome Tree #%d Sapling Meta = %d", i, SaplingUtil.getMetaFromState(biomeTrees.get(i).getSaplingBlock())); - if (saplingBlock.getBlock() == biomeTrees.get(i).saplingBlock.getBlock()) { + if (saplingBlock.getBlock() == biomeTrees.get(i).getSaplingBlock().getBlock()) { - if (SaplingUtil.getMetaFromState(saplingBlock) == SaplingUtil.getMetaFromState(biomeTrees.get(i).saplingBlock)) { + if (SaplingUtil.getMetaFromState(saplingBlock) == SaplingUtil.getMetaFromState(biomeTrees.get(i).getSaplingBlock())) { validTrees.add(biomeTrees.get(i)); Logger.debug("Valid tree found!"); @@ -265,18 +265,18 @@ public void saplingGrowTreeRTG(SaplingGrowTreeEvent event) { Logger.debug("Tree = %s", tree.getClass().getName()); // Set the trunk size if min/max values have been set. - if (tree.minTrunkSize > 0 && tree.maxTrunkSize > tree.minTrunkSize) { + if (tree.getMinTrunkSize() > 0 && tree.getMaxTrunkSize() > tree.getMinTrunkSize()) { - tree.trunkSize = RandomUtil.getRandomInt(event.getRand(), tree.minTrunkSize, tree.maxTrunkSize); + tree.setTrunkSize(RandomUtil.getRandomInt(event.getRand(), tree.getMinTrunkSize(), tree.getMaxTrunkSize())); } // Set the crown size if min/max values have been set. - if (tree.minCrownSize > 0 && tree.maxCrownSize > tree.minCrownSize) { + if (tree.getMinCrownSize() > 0 && tree.getMaxCrownSize() > tree.getMinCrownSize()) { - tree.crownSize = RandomUtil.getRandomInt(event.getRand(), tree.minCrownSize, tree.maxCrownSize); + tree.setCrownSize(RandomUtil.getRandomInt(event.getRand(), tree.getMinCrownSize(), tree.getMaxCrownSize())); } - int treeHeight = tree.trunkSize + tree.crownSize; + int treeHeight = tree.getTrunkSize() + tree.getCrownSize(); if (treeHeight < 1) { Logger.debug("Unable to grow RTG tree with no height."); return; @@ -293,10 +293,10 @@ public void saplingGrowTreeRTG(SaplingGrowTreeEvent event) { * * TODO: Does this affect the generation of normal RTG trees? - Pink */ - int oldFlag = tree.generateFlag; - tree.generateFlag = 3; + int oldFlag = tree.getGenerateFlag(); + tree.setGenerateFlag(3); boolean generated = tree.generate(event.getWorld(), event.getRand(), event.getPos()); - tree.generateFlag = oldFlag; + tree.setGenerateFlag(oldFlag); if (generated) { diff --git a/src/main/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java b/src/main/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java index 2be8b0b08..9946dd167 100644 --- a/src/main/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java @@ -20,7 +20,7 @@ */ public class DecoAbyssalCraftTree extends DecoTree { - public TreeType treeType; + private TreeType treeType; public DecoAbyssalCraftTree() { @@ -30,21 +30,21 @@ public DecoAbyssalCraftTree() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.loops = 1; - this.strengthFactorForLoops = 0f; - this.strengthNoiseFactorForLoops = false; - this.strengthNoiseFactorXForLoops = false; - this.treeType = TreeType.DARKWOOD; - this.distribution = new DecoTree.Distribution(100f, 5f, 0.8f); - this.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - this.treeConditionNoise = 0f; - this.treeConditionChance = 1; - this.minY = 63; // No underwater trees by default. - this.maxY = 230; // Sensible upper height limit by default. - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); - this.minSize = 2; - this.maxSize = 4; + this.setLoops(1); + this.setStrengthFactorForLoops(0f); + this.setStrengthNoiseFactorForLoops(false); + this.setStrengthNoiseFactorXForLoops(false); + this.setTreeType(TreeType.DARKWOOD); + this.setDistribution(new DecoTree.Distribution(100f, 5f, 0.8f)); + this.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + this.setTreeConditionNoise(0f); + this.setTreeConditionChance(1); + this.setMinY(63); // No underwater trees by default. + this.setMaxY(230); // Sensible upper height limit by default. + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + this.setMinSize(2); + this.setMaxSize(4); this.addDecoTypes(DecoType.TREE); } @@ -96,4 +96,10 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i public enum TreeType { DARKWOOD; } + + public DecoAbyssalCraftTree setTreeType(TreeType treeType) { + + this.treeType = treeType; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoBase.java b/src/main/java/rtg/world/biome/deco/DecoBase.java index 897806137..148a54619 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBase.java +++ b/src/main/java/rtg/world/biome/deco/DecoBase.java @@ -22,11 +22,11 @@ public abstract class DecoBase { * Currently, the only deco that uses allow=false is the DecoBaseBiomeDecorations deco, and it only gets * set to false when we need to generate ores in biomes that don't let the base biome handle decoration at all. */ - public boolean allowed; - public ArrayList decoTypes; - public boolean checkRiver; - public float minRiver; // Minimum river value required to generate. - public float maxRiver; // Maximum river value required to generate. + protected boolean allowed; + protected ArrayList decoTypes; + protected boolean checkRiver; + protected float minRiver; // Minimum river value required to generate. + protected float maxRiver; // Maximum river value required to generate. public DecoBase() { @@ -34,7 +34,7 @@ public DecoBase() { this.decoTypes = new ArrayList(); this.checkRiver = false; this.minRiver = -2f; - this.maxRiver = 2f; + this.setMaxRiver(2f); } public boolean properlyDefined() { @@ -134,16 +134,71 @@ public static void tweakTreeLeaves(DecoTree deco, boolean checkDecay, boolean de IBlockState leaves = deco.leavesBlock .withProperty(BlockLeaves.CHECK_DECAY, checkDecay) .withProperty(BlockLeaves.DECAYABLE, decayable); - deco.leavesBlock = leaves; + deco.setLeavesBlock(leaves); } } public static void tweakShrubLeaves(DecoShrub deco, boolean checkDecay, boolean decayable) { - if (deco.leavesBlock.getBlock() instanceof BlockLeaves) { - IBlockState leaves = deco.leavesBlock + if (deco.getLeavesBlock().getBlock() instanceof BlockLeaves) { + IBlockState leaves = deco.getLeavesBlock() .withProperty(BlockLeaves.CHECK_DECAY, checkDecay) .withProperty(BlockLeaves.DECAYABLE, decayable); - deco.leavesBlock = leaves; + deco.setLeavesBlock(leaves); } } + + public boolean isAllowed() { + + return allowed; + } + + public DecoBase setAllowed(boolean allowed) { + + this.allowed = allowed; + return this; + } + + public ArrayList getDecoTypes() { + + return decoTypes; + } + + public DecoBase setDecoTypes(ArrayList decoTypes) { + + this.decoTypes = decoTypes; + return this; + } + + public boolean isCheckRiver() { + + return checkRiver; + } + + public DecoBase setCheckRiver(boolean checkRiver) { + + this.checkRiver = checkRiver; + return this; + } + + public float getMinRiver() { + + return minRiver; + } + + public DecoBase setMinRiver(float minRiver) { + + this.minRiver = minRiver; + return this; + } + + public float getMaxRiver() { + + return maxRiver; + } + + public DecoBase setMaxRiver(float maxRiver) { + + this.setMaxRiver(maxRiver); + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java index 5f89200de..c551ee8d9 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java +++ b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java @@ -21,24 +21,24 @@ public class DecoBaseBiomeDecorations extends DecoBase { * This optional setting is useful when you want the base biome to decorate a majority of the biome's chunks. * Only used if greater than 0 */ - public int equalsZeroChance; + private int equalsZeroChance; /** * This optional setting is useful when you want the base biome to decorate a minority of the biome's chunks. * Only used if greater than 0 */ - public int notEqualsZeroChance; + private int notEqualsZeroChance; /** * How many times per chunk do we want the base biome to decorate itself? (Usually only once) */ - public int loops; + private int loops; /** * Height restriction. */ - public int minY; - public int maxY; + private int minY; + private int maxY; public DecoBaseBiomeDecorations() { @@ -48,11 +48,11 @@ public DecoBaseBiomeDecorations() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.equalsZeroChance = 0; // Only used if greater than 0 - this.notEqualsZeroChance = 0; // Only used if greater than 0 - this.loops = 1; // You almost always want to loop only once. - this.minY = 1; // No height limit by default. - this.maxY = 255; // No height limit by default. + this.setEqualsZeroChance(0); // Only used if greater than 0 + this.setNotEqualsZeroChance(0); // Only used if greater than 0 + this.setLoops(1); // You almost always want to loop only once. + this.setMinY(1); // No height limit by default. + this.setMaxY(255); // No height limit by default. this.addDecoTypes(DecoType.BASE_BIOME_DECORATION); } @@ -102,4 +102,59 @@ else if (this.notEqualsZeroChance > 0) { biome.rDecorator.decorateOres(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); } } + + public int getEqualsZeroChance() { + + return equalsZeroChance; + } + + public DecoBaseBiomeDecorations setEqualsZeroChance(int equalsZeroChance) { + + this.setEqualsZeroChance(equalsZeroChance); + return this; + } + + public int getNotEqualsZeroChance() { + + return notEqualsZeroChance; + } + + public DecoBaseBiomeDecorations setNotEqualsZeroChance(int notEqualsZeroChance) { + + this.setNotEqualsZeroChance(notEqualsZeroChance); + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoBaseBiomeDecorations setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoBaseBiomeDecorations setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoBaseBiomeDecorations setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoBoulder.java b/src/main/java/rtg/world/biome/deco/DecoBoulder.java index 19a563918..c27062a6b 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBoulder.java +++ b/src/main/java/rtg/world/biome/deco/DecoBoulder.java @@ -17,12 +17,12 @@ */ public class DecoBoulder extends DecoBase { - public IBlockState boulderBlock; // This can be any block. - public float strengthFactor; // Higher = more/bigger boulders. - public int minY; // Lower height restriction. - public int maxY; // Upper height restriction. - public int chance; // Higher = more rare. - public boolean water; + private IBlockState boulderBlock; // This can be any block. + private float strengthFactor; // Higher = more/bigger boulders. + private int minY; // Lower height restriction. + private int maxY; // Upper height restriction. + private int chance; // Higher = more rare. + private boolean water; public DecoBoulder() { @@ -32,11 +32,11 @@ public DecoBoulder() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - this.strengthFactor = 2f; - this.minY = 60; // Sensible lower height limit by default. - this.maxY = 255; // No upper height limit by default. - this.chance = 10; + this.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + this.setStrengthFactor(2f); + this.setMinY(60); // Sensible lower height limit by default. + this.setMaxY(255); // No upper height limit by default. + this.setChance(10); this.water = true; this.addDecoTypes(DecoType.BOULDER); @@ -69,4 +69,70 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public IBlockState getBoulderBlock() { + + return boulderBlock; + } + + public DecoBoulder setBoulderBlock(IBlockState boulderBlock) { + + this.setBoulderBlock(boulderBlock); + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoBoulder setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoBoulder setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoBoulder setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoBoulder setChance(int chance) { + + this.setChance(chance); + return this; + } + + public boolean isWater() { + + return water; + } + + public DecoBoulder setWater(boolean water) { + + this.water = water; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoCactus.java b/src/main/java/rtg/world/biome/deco/DecoCactus.java index 49fb4b36e..9521b5438 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCactus.java +++ b/src/main/java/rtg/world/biome/deco/DecoCactus.java @@ -19,12 +19,12 @@ */ public class DecoCactus extends DecoBase { - public int loops; - public int chance; - public float strengthFactor; - public int maxY; - public boolean sandOnly; - public IBlockState soilBlock; + private int loops; + private int chance; + private float strengthFactor; + private int maxY; + private boolean sandOnly; + private IBlockState soilBlock; public DecoCactus() { @@ -34,12 +34,12 @@ public DecoCactus() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.loops = 1; - this.chance = 1; - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // The higher the value, the more there will be. - this.sandOnly = false; - this.soilBlock = Blocks.SAND.getDefaultState(); + this.setLoops(1); + this.setChance(1); + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // The higher the value, the more there will be. + this.setSandOnly(false); + this.setSoilBlock(Blocks.SAND.getDefaultState()); this.addDecoTypes(DecoType.CACTUS); } @@ -67,4 +67,70 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public int getLoops() { + + return loops; + } + + public DecoCactus setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoCactus setChance(int chance) { + + this.setChance(chance); + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoCactus setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoCactus setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public boolean isSandOnly() { + + return sandOnly; + } + + public DecoCactus setSandOnly(boolean sandOnly) { + + this.setSandOnly(sandOnly); + return this; + } + + public IBlockState getSoilBlock() { + + return soilBlock; + } + + public DecoCactus setSoilBlock(IBlockState soilBlock) { + + this.setSoilBlock(soilBlock); + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoCobwebs.java b/src/main/java/rtg/world/biome/deco/DecoCobwebs.java index 3dc462770..1649b33d3 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCobwebs.java +++ b/src/main/java/rtg/world/biome/deco/DecoCobwebs.java @@ -17,12 +17,12 @@ */ public class DecoCobwebs extends DecoBase { - public float strengthFactor; // Higher = more/bigger boulders. - public int minY; // Lower height restriction. - public int maxY; // Upper height restriction. - public int chance; // Higher = more rare. - public IBlockState adjacentBlock; - public int minAdjacents; + private float strengthFactor; // Higher = more/bigger boulders. + private int minY; // Lower height restriction. + private int maxY; // Upper height restriction. + private int chance; // Higher = more rare. + private IBlockState adjacentBlock; + private int minAdjacents; public DecoCobwebs() { @@ -32,12 +32,12 @@ public DecoCobwebs() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.strengthFactor = 2f; - this.minY = 1; // No lower height limit by default. - this.maxY = 255; // No upper height limit by default. - this.chance = 10; - this.adjacentBlock = Blocks.AIR.getDefaultState(); - this.minAdjacents = 1; + this.setStrengthFactor(2f); + this.setMinY(1); // No lower height limit by default. + this.setMaxY(255); // No upper height limit by default. + this.setChance(10); + this.setAdjacentBlock(Blocks.AIR.getDefaultState()); + this.setMinAdjacents(1); this.addDecoTypes(DecoType.COBWEB); } @@ -60,4 +60,70 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoCobwebs setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoCobwebs setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoCobwebs setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoCobwebs setChance(int chance) { + + this.setChance(chance); + return this; + } + + public IBlockState getAdjacentBlock() { + + return adjacentBlock; + } + + public DecoCobwebs setAdjacentBlock(IBlockState adjacentBlock) { + + this.setAdjacentBlock(adjacentBlock); + return this; + } + + public int getMinAdjacents() { + + return minAdjacents; + } + + public DecoCobwebs setMinAdjacents(int minAdjacents) { + + this.setMinAdjacents(minAdjacents); + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoCrop.java b/src/main/java/rtg/world/biome/deco/DecoCrop.java index 7ef0c346b..f82d35e3a 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCrop.java +++ b/src/main/java/rtg/world/biome/deco/DecoCrop.java @@ -16,15 +16,15 @@ */ public class DecoCrop extends DecoBase { - public int type; // This can the number 0,1,2,3. - public int size; //Higher = larger fields. - public int density; //Higher = Crops in fields closer together. - public int height; //Higher = Crops on more y levels - When higher tends to be less dense. - public float strengthFactor; // Higher = More frequent spawns. - public int minY; // Lower height restriction. - public int maxY; // Upper height restriction. - public int chance; // Higher = more rare. - public boolean water; + private int type; // This can the number 0,1,2,3. + private int size; //Higher = larger fields. + private int density; //Higher = Crops in fields closer together. + private int height; //Higher = Crops on more y levels - When higher tends to be less dense. + private float strengthFactor; // Higher = More frequent spawns. + private int minY; // Lower height restriction. + private int maxY; // Upper height restriction. + private int chance; // Higher = more rare. + private boolean water; public DecoCrop() { @@ -38,10 +38,10 @@ public DecoCrop() { this.size = 5;//DO NOT PUT HIGHER THAN 30 this.density = 50; this.height = 2; - this.strengthFactor = 2f; - this.minY = 63; // Sensible lower height limit by default. - this.maxY = 255; // No upper height limit by default. - this.chance = 10; //The higher the number the less common it will be + this.setStrengthFactor(2f); + this.setMinY(63); // Sensible lower height limit by default. + this.setMaxY(255); // No upper height limit by default. + this.setChance(10); //The higher the number the less common it will be this.water = true; //whether or not to spawn water with the crops this.addDecoTypes(DecoType.WHEAT); @@ -78,4 +78,103 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public int getType() { + + return type; + } + + public DecoCrop setType(int type) { + + this.type = type; + return this; + } + + public int getSize() { + + return size; + } + + public DecoCrop setSize(int size) { + + this.size = size; + return this; + } + + public int getDensity() { + + return density; + } + + public DecoCrop setDensity(int density) { + + this.density = density; + return this; + } + + public int getHeight() { + + return height; + } + + public DecoCrop setHeight(int height) { + + this.height = height; + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoCrop setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoCrop setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoCrop setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoCrop setChance(int chance) { + + this.setChance(chance); + return this; + } + + public boolean isWater() { + + return water; + } + + public DecoCrop setWater(boolean water) { + + this.water = water; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoDeadBush.java b/src/main/java/rtg/world/biome/deco/DecoDeadBush.java index 78eca70f0..3603c267c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDeadBush.java +++ b/src/main/java/rtg/world/biome/deco/DecoDeadBush.java @@ -17,10 +17,10 @@ */ public class DecoDeadBush extends DecoBase { - public float strengthFactor; - public int maxY; - public int chance; - public int loops; + private float strengthFactor; + private int maxY; + private int chance; + private int loops; public DecoDeadBush() { @@ -30,10 +30,10 @@ public DecoDeadBush() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // The higher the value, the more there will be. - this.chance = 1; - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // The higher the value, the more there will be. + this.setChance(1); + this.setLoops(1); this.addDecoTypes(DecoType.DEAD_BUSH); } @@ -61,4 +61,48 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoDeadBush setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoDeadBush setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoDeadBush setChance(int chance) { + + this.setChance(chance); + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoDeadBush setLoops(int loops) { + + this.loops = loops; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoDesertWell.java b/src/main/java/rtg/world/biome/deco/DecoDesertWell.java index 46aec63d4..1e298af7d 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDesertWell.java +++ b/src/main/java/rtg/world/biome/deco/DecoDesertWell.java @@ -14,10 +14,10 @@ */ public class DecoDesertWell extends DecoBase { - public float strengthFactor; - public int maxY; - public int loops; - public int chance; + private float strengthFactor; + private int maxY; + private int loops; + private int chance; public DecoDesertWell() { @@ -27,10 +27,10 @@ public DecoDesertWell() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; - this.chance = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); + this.setChance(1); this.addDecoTypes(DecoType.DESERT_WELL); } @@ -42,7 +42,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGenerator = new WorldGenDesertWells(); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { if (rand.nextInt(this.chance) == 0) { @@ -57,4 +57,48 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoDesertWell setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoDesertWell setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoDesertWell setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoDesertWell setChance(int chance) { + + this.setChance(chance); + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java b/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java index c0f9a8748..598752e96 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java @@ -18,9 +18,9 @@ */ public class DecoDoubleGrass extends DecoBase { - public float strengthFactor; - public int maxY; - public int loops; + private float strengthFactor; + private int maxY; + private int loops; public DecoDoubleGrass() { @@ -30,9 +30,9 @@ public DecoDoubleGrass() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // The higher the value, the more there will be. - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // The higher the value, the more there will be. + this.setLoops(1); this.addDecoTypes(DecoType.GRASS_DOUBLE); } @@ -46,7 +46,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGenerator = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { int intX = worldX + rand.nextInt(16) + 8; int intY = rand.nextInt(this.maxY); @@ -59,4 +59,37 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoDoubleGrass setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoDoubleGrass setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoDoubleGrass setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java index 7f1d0c001..2ae93afd6 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java @@ -17,17 +17,17 @@ */ public class DecoFallenTree extends DecoBase { - public int loops; - public DecoFallenTree.Distribution distribution; // Parameter object for noise calculations. - public LogCondition logCondition; // Enum for the various conditions/chances for log gen. - public float logConditionNoise; // Only applies to a noise-related LogCondition. - public int logConditionChance; // Only applies to a chance-related LogCondition. - public int maxY; // Height restriction. - public IBlockState logBlock; - public IBlockState leavesBlock; - public int minSize; // Min log height (only used with certain log presets) - public int maxSize; // Max log height (only used with certain log presets) - public IBlockState[] randomLogBlocks; + private int loops; + private DecoFallenTree.Distribution distribution; // Parameter object for noise calculations. + private LogCondition logCondition; // Enum for the various conditions/chances for log gen. + private float logConditionNoise; // Only applies to a noise-related LogCondition. + private int logConditionChance; // Only applies to a chance-related LogCondition. + private int maxY; // Height restriction. + private IBlockState logBlock; + private IBlockState leavesBlock; + private int minSize; // Min log height (only used with certain log presets) + private int maxSize; // Max log height (only used with certain log presets) + private IBlockState[] randomLogBlocks; public DecoFallenTree() { @@ -37,16 +37,16 @@ public DecoFallenTree() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.loops = 1; - this.distribution = new DecoFallenTree.Distribution(100f, 5f, 0.8f); - this.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - this.logConditionNoise = 0f; - this.logConditionChance = 1; - this.maxY = 80; - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); - this.minSize = 2; - this.maxSize = 4; + this.setLoops(1); + this.setDistribution(new DecoFallenTree.Distribution(100f, 5f, 0.8f)); + this.setLogCondition(LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + this.setLogConditionNoise(0f); + this.setLogConditionChance(1); + this.setMaxY(80); + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + this.setMinSize(2); + this.setMaxSize(4); this.randomLogBlocks = new IBlockState[]{}; this.addDecoTypes(DecoType.FALLEN_TREE); @@ -55,16 +55,16 @@ public DecoFallenTree() { public DecoFallenTree(DecoFallenTree source) { this(); - this.loops = source.loops; - this.distribution = source.distribution; - this.logCondition = source.logCondition; - this.logConditionNoise = source.logConditionNoise; - this.logConditionChance = source.logConditionChance; - this.maxY = source.maxY; - this.logBlock = source.logBlock; - this.leavesBlock = source.leavesBlock; - this.minSize = source.minSize; - this.maxSize = source.maxSize; + this.setLoops(source.loops); + this.setDistribution(source.distribution); + this.setLogCondition(source.logCondition); + this.setLogConditionNoise(source.logConditionNoise); + this.setLogConditionChance(source.logConditionChance); + this.setMaxY(source.maxY); + this.setLogBlock(source.logBlock); + this.setLeavesBlock(source.leavesBlock); + this.setMinSize(source.minSize); + this.setMaxSize(source.maxSize); this.randomLogBlocks = source.randomLogBlocks; } @@ -78,7 +78,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i //Do we want to choose a random log? if (this.randomLogBlocks.length > 0) { - this.logBlock = this.randomLogBlocks[rand.nextInt(this.randomLogBlocks.length)]; + this.setLogBlock(this.randomLogBlocks[rand.nextInt(this.randomLogBlocks.length)]); } WorldGenerator worldGenerator = null; @@ -163,9 +163,9 @@ public enum LogCondition { */ public static class Distribution { - public float noiseDivisor; - public float noiseFactor; - public float noiseAddend; + private float noiseDivisor; + private float noiseFactor; + private float noiseAddend; public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { @@ -173,6 +173,39 @@ public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { this.noiseFactor = noiseFactor; this.noiseAddend = noiseAddend; } + + public float getNoiseDivisor() { + + return noiseDivisor; + } + + public Distribution setNoiseDivisor(float noiseDivisor) { + + this.noiseDivisor = noiseDivisor; + return this; + } + + public float getNoiseFactor() { + + return noiseFactor; + } + + public Distribution setNoiseFactor(float noiseFactor) { + + this.noiseFactor = noiseFactor; + return this; + } + + public float getNoiseAddend() { + + return noiseAddend; + } + + public Distribution setNoiseAddend(float noiseAddend) { + + this.noiseAddend = noiseAddend; + return this; + } } public int getLoops() { @@ -182,7 +215,7 @@ public int getLoops() { public DecoFallenTree setLoops(int loops) { - this.loops = loops; + this.setLoops(loops); return this; } @@ -193,7 +226,7 @@ public Distribution getDistribution() { public DecoFallenTree setDistribution(Distribution distribution) { - this.distribution = distribution; + this.setDistribution(distribution); return this; } @@ -204,7 +237,7 @@ public LogCondition getLogCondition() { public DecoFallenTree setLogCondition(LogCondition logCondition) { - this.logCondition = logCondition; + this.setLogCondition(logCondition); return this; } @@ -215,7 +248,7 @@ public float getLogConditionNoise() { public DecoFallenTree setLogConditionNoise(float logConditionNoise) { - this.logConditionNoise = logConditionNoise; + this.setLogConditionNoise(logConditionNoise); return this; } @@ -226,7 +259,7 @@ public int getLogConditionChance() { public DecoFallenTree setLogConditionChance(int logConditionChance) { - this.logConditionChance = logConditionChance; + this.setLogConditionChance(logConditionChance); return this; } @@ -237,7 +270,7 @@ public int getMaxY() { public DecoFallenTree setMaxY(int maxY) { - this.maxY = maxY; + this.setMaxY(maxY); return this; } @@ -248,7 +281,7 @@ public IBlockState getLogBlock() { public DecoFallenTree setLogBlock(IBlockState logBlock) { - this.logBlock = logBlock; + this.setLogBlock(logBlock); return this; } @@ -259,7 +292,7 @@ public IBlockState getLeavesBlock() { public DecoFallenTree setLeavesBlock(IBlockState leavesBlock) { - this.leavesBlock = leavesBlock; + this.setLeavesBlock(leavesBlock); return this; } @@ -270,7 +303,7 @@ public int getMinSize() { public DecoFallenTree setMinSize(int minSize) { - this.minSize = minSize; + this.setMinSize(minSize); return this; } @@ -281,7 +314,7 @@ public int getMaxSize() { public DecoFallenTree setMaxSize(int maxSize) { - this.maxSize = maxSize; + this.setMaxSize(maxSize); return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java index 4dbe39062..152c27fed 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java +++ b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java @@ -55,13 +55,13 @@ public DecoFlowersRTG() { * These can be overridden when configuring the Deco object in the realistic biome. */ this.flowers = new int[]{0, 9}; // Only roses and dandelions by default. - this.chance = 1; // 100% chance of generating by default. - this.notEqualsZeroChance = 1; - this.minY = 1; // No lower height limit by default - this should really be 63, but... backwards-compatibility. :/ - this.maxY = 253; // 2 below max build height to account for 2-block tall flowers. + this.setChance(1); // 100% chance of generating by default. + this.setNotEqualsZeroChance(1); + this.setMinY(1); // No lower height limit by default - this should really be 63, but... backwards-compatibility. :/ + this.setMaxY(253); // 2 below max build height to account for 2-block tall flowers. this.heightType = HeightType.NEXT_INT; - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); this.addDecoTypes(DecoType.FLOWER); } @@ -75,7 +75,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGenerator = new WorldGenFlowersRTG(this.flowers); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops * 16; i++) { int intX = worldX + rand.nextInt(16);// + 8; @@ -139,7 +139,7 @@ public float getStrengthFactor() { public DecoFlowersRTG setStrengthFactor(float strengthFactor) { - this.strengthFactor = strengthFactor; + this.setStrengthFactor(strengthFactor); return this; } @@ -150,7 +150,7 @@ public int getMinY() { public DecoFlowersRTG setMinY(int minY) { - this.minY = minY; + this.setMinY(minY); return this; } @@ -161,7 +161,7 @@ public int getMaxY() { public DecoFlowersRTG setMaxY(int maxY) { - this.maxY = maxY; + this.setMaxY(maxY); return this; } @@ -183,7 +183,7 @@ public int getChance() { public DecoFlowersRTG setChance(int chance) { - this.chance = chance; + this.setChance(chance); return this; } @@ -194,7 +194,7 @@ public int getNotEqualsZeroChance() { public DecoFlowersRTG setNotEqualsZeroChance(int notEqualsZeroChance) { - this.notEqualsZeroChance = notEqualsZeroChance; + this.setNotEqualsZeroChance(notEqualsZeroChance); return this; } @@ -205,7 +205,7 @@ public int getLoops() { public DecoFlowersRTG setLoops(int loops) { - this.loops = loops; + this.setLoops(loops); return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoGrass.java b/src/main/java/rtg/world/biome/deco/DecoGrass.java index f417b70a5..77cfe6dcd 100644 --- a/src/main/java/rtg/world/biome/deco/DecoGrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoGrass.java @@ -18,17 +18,17 @@ */ public class DecoGrass extends DecoBase { - public float strengthFactor; - public int minY; - public int maxY; - public int loops; - public int chance; - public int notEqualsZerochance; - public IBlockState[] randomGrassBlocks; - public byte[] randomGrassMetas; - - protected boolean useRandomGrass; - protected static final int MAX_LOOPS = 10; + private float strengthFactor; + private int minY; + private int maxY; + private int loops; + private int chance; + private int notEqualsZeroChance; + private IBlockState[] randomGrassBlocks; + private byte[] randomGrassMetas; + + private boolean useRandomGrass; + private static final int MAX_LOOPS = 10; private IBlockState block; private int meta; @@ -42,12 +42,12 @@ public DecoGrass() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.minY = 1; // No height limit by default. - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; - this.chance = 1; - this.notEqualsZerochance = 1; + this.setMinY(1); // No height limit by default. + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); + this.setChance(1); + this.notEqualsZeroChance = 1; this.block = Blocks.TALLGRASS.getStateFromMeta(1); this.meta = 1; this.randomGrassBlocks = new IBlockState[]{}; @@ -90,8 +90,8 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i if (TerrainGen.decorate(rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), GRASS)) { - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; - this.loops = (this.loops > this.MAX_LOOPS) ? this.MAX_LOOPS : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); + this.setLoops((this.loops > this.MAX_LOOPS) ? this.MAX_LOOPS : this.loops); for (int i = 0; i < this.loops * 64; i++) { int intX = worldX + rand.nextInt(16);// + 8; int intY = this.minY + (rand.nextInt(this.maxY - this.minY) + 1); @@ -104,9 +104,9 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i //this.meta = this.randomGrassMetas[rand.nextInt(this.randomGrassMetas.length)]; } - if (this.notEqualsZerochance > 1) { + if (this.notEqualsZeroChance > 1) { - if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZeroChance) != 0) { grassGenerator.generate(rtgWorld.world, rand, new BlockPos(intX, intY, intZ)); } } @@ -128,7 +128,7 @@ public float getStrengthFactor() { public DecoGrass setStrengthFactor(float strengthFactor) { - this.strengthFactor = strengthFactor; + this.setStrengthFactor(strengthFactor); return this; } @@ -172,18 +172,18 @@ public int getChance() { public DecoGrass setChance(int chance) { - this.chance = chance; + this.setChance(chance); return this; } public int getNotEqualsZerochance() { - return notEqualsZerochance; + return notEqualsZeroChance; } - public DecoGrass setNotEqualsZerochance(int notEqualsZerochance) { + public DecoGrass setNotEqualsZerochance(int notEqualsZeroChance) { - this.notEqualsZerochance = notEqualsZerochance; + this.notEqualsZeroChance = notEqualsZeroChance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java b/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java index f01184df0..f73fdde2a 100644 --- a/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java @@ -18,11 +18,11 @@ */ public class DecoGrassDoubleTallgrass extends DecoBase { - public float strengthFactor; - public int maxY; - public int loops; - public int grassChance; - public int doubleGrassChance; + private float strengthFactor; + private int maxY; + private int loops; + private int grassChance; + private int doubleGrassChance; public DecoGrassDoubleTallgrass() { @@ -32,11 +32,11 @@ public DecoGrassDoubleTallgrass() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); this.grassChance = 0; // 50% chance for both grass & double grass by default. - this.doubleGrassChance = 0; // 50% chance for both grass & double grass by default. (If set, overrides grass chance.) + this.setDoubleGrassChance(0); // 50% chance for both grass & double grass by default. (If set, overrides grass chance.) this.addDecoTypes(DecoType.GRASS, DecoType.GRASS_DOUBLE); } @@ -83,7 +83,7 @@ else if (this.grassChance > 0) { } } - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { int intX = worldX + rand.nextInt(16) + 8; int intY = rand.nextInt(this.maxY); @@ -97,4 +97,59 @@ else if (this.grassChance > 0) { } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoGrassDoubleTallgrass setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoGrassDoubleTallgrass setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoGrassDoubleTallgrass setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getGrassChance() { + + return grassChance; + } + + public DecoGrassDoubleTallgrass setGrassChance(int grassChance) { + + this.grassChance = grassChance; + return this; + } + + public int getDoubleGrassChance() { + + return doubleGrassChance; + } + + public DecoGrassDoubleTallgrass setDoubleGrassChance(int doubleGrassChance) { + + this.setDoubleGrassChance(doubleGrassChance); + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java b/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java index aa11e0017..50b57031c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java +++ b/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java @@ -17,11 +17,11 @@ */ public class DecoJungleCacti extends DecoBase { - public float strengthFactor; - public int maxY; - public boolean sandOnly; - public int extraHeight; - public byte sandMeta; + private float strengthFactor; + private int maxY; + private boolean sandOnly; + private int extraHeight; + private byte sandMeta; public DecoJungleCacti() { @@ -31,11 +31,11 @@ public DecoJungleCacti() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.strengthFactor = 8f; - this.maxY = 255; // No height limit by default. - this.sandOnly = false; - this.extraHeight = 7; - this.sandMeta = (byte) 1; + this.setStrengthFactor(8f); + this.setMaxY(255); // No height limit by default. + this.setSandOnly(false); + this.setExtraHeight(7); + this.setSandMeta((byte) 1); this.addDecoTypes(DecoType.CACTUS); } @@ -61,4 +61,59 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoJungleCacti setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoJungleCacti setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public boolean isSandOnly() { + + return sandOnly; + } + + public DecoJungleCacti setSandOnly(boolean sandOnly) { + + this.setSandOnly(sandOnly); + return this; + } + + public int getExtraHeight() { + + return extraHeight; + } + + public DecoJungleCacti setExtraHeight(int extraHeight) { + + this.setExtraHeight(extraHeight); + return this; + } + + public byte getSandMeta() { + + return sandMeta; + } + + public DecoJungleCacti setSandMeta(byte sandMeta) { + + this.setSandMeta(sandMeta); + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java b/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java index f1fc4e975..e3b69baa1 100644 --- a/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java @@ -35,9 +35,9 @@ public DecoLargeFernDoubleTallgrass() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); this.grassChance = 0; // 50% chance for both grass & ferns by default. this.fernChance = 0; // 50% chance for both grass & ferns by default. (If set, overrides grass chance.) @@ -54,7 +54,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldgeneratorDoubleTallgrass = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(GRASS_META), GRASS_META); WorldGenerator worldgeneratorLargeFern = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(FERN_META), FERN_META); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { int intX = worldX + rand.nextInt(16) + 8; int intY = rand.nextInt(this.maxY); @@ -100,4 +100,59 @@ else if (this.grassChance > 0) { } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoLargeFernDoubleTallgrass setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoLargeFernDoubleTallgrass setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoLargeFernDoubleTallgrass setLoops(int loops) { + + this.loops = loops; + return this; + } + + public int getGrassChance() { + + return grassChance; + } + + public DecoLargeFernDoubleTallgrass setGrassChance(int grassChance) { + + this.grassChance = grassChance; + return this; + } + + public int getFernChance() { + + return fernChance; + } + + public DecoLargeFernDoubleTallgrass setFernChance(int fernChance) { + + this.fernChance = fernChance; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoLayer.java b/src/main/java/rtg/world/biome/deco/DecoLayer.java index 0081b215d..9c1cc3e54 100644 --- a/src/main/java/rtg/world/biome/deco/DecoLayer.java +++ b/src/main/java/rtg/world/biome/deco/DecoLayer.java @@ -19,18 +19,18 @@ */ public class DecoLayer extends DecoBase { - public IBlockState layerBlock; - public PropertyInteger layerProperty; - public int dropHeight; - public int layerRange; - public int layerScatter; - - public float strengthFactor; // Higher = more/bigger shrubs. - public int minY; // Height restriction. - public int maxY; // Height restriction. - public int chance; // Higher = more rare. - public int notEqualsZerochance; - public int loops; + private IBlockState layerBlock; + private PropertyInteger layerProperty; + private int dropHeight; + private int layerRange; + private int layerScatter; + + private float strengthFactor; // Higher = more/bigger shrubs. + private int minY; // Height restriction. + private int maxY; // Height restriction. + private int chance; // Higher = more rare. + private int notEqualsZeroChance; + private int loops; public DecoLayer(IBlockState layerBlock, PropertyInteger layerProperty) { @@ -45,12 +45,12 @@ public DecoLayer(IBlockState layerBlock, PropertyInteger layerProperty) { this.dropHeight = 2; this.layerRange = 4; this.layerScatter = 3; - this.strengthFactor = 2f; - this.minY = 63; // Sensible height limit by default. - this.maxY = 255; // No height limit by default. - this.chance = 1; // 100% chance of generating by default. - this.notEqualsZerochance = 1; - this.loops = 1; + this.setStrengthFactor(2f); + this.setMinY(63); // Sensible height limit by default. + this.setMaxY(255); // No height limit by default. + this.setChance(1); // 100% chance of generating by default. + this.notEqualsZeroChance = 1; + this.setLoops(1); this.addDecoTypes(DecoType.LAYER, DecoType.LEAVES, DecoType.FALLEN_LEAVES); } @@ -70,9 +70,9 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i int intZ = worldZ + rand.nextInt(16);// + 8; int intY = rtgWorld.world.getHeight(new BlockPos(intX, 0, intZ)).getY(); - if (this.notEqualsZerochance > 1) { + if (this.notEqualsZeroChance > 1) { - if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZeroChance) != 0) { generateWorldGenerator(worldGenerator, worldUtil, rtgWorld.world, rand, intX, intY, intZ, hasPlacedVillageBlocks); } } @@ -96,4 +96,125 @@ private boolean generateWorldGenerator(WorldGenerator worldGenerator, WorldUtil return worldGenerator.generate(world, rand, new BlockPos(x, y, z)); } + + public IBlockState getLayerBlock() { + + return layerBlock; + } + + public DecoLayer setLayerBlock(IBlockState layerBlock) { + + this.layerBlock = layerBlock; + return this; + } + + public PropertyInteger getLayerProperty() { + + return layerProperty; + } + + public DecoLayer setLayerProperty(PropertyInteger layerProperty) { + + this.layerProperty = layerProperty; + return this; + } + + public int getDropHeight() { + + return dropHeight; + } + + public DecoLayer setDropHeight(int dropHeight) { + + this.dropHeight = dropHeight; + return this; + } + + public int getLayerRange() { + + return layerRange; + } + + public DecoLayer setLayerRange(int layerRange) { + + this.layerRange = layerRange; + return this; + } + + public int getLayerScatter() { + + return layerScatter; + } + + public DecoLayer setLayerScatter(int layerScatter) { + + this.layerScatter = layerScatter; + return this; + } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoLayer setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoLayer setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoLayer setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getChance() { + + return chance; + } + + public DecoLayer setChance(int chance) { + + this.setChance(chance); + return this; + } + + public int getNotEqualsZerochance() { + + return notEqualsZeroChance; + } + + public DecoLayer setNotEqualsZerochance(int notEqualsZeroChance) { + + this.notEqualsZeroChance = notEqualsZeroChance; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoLayer setLoops(int loops) { + + this.loops = loops; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoMushrooms.java b/src/main/java/rtg/world/biome/deco/DecoMushrooms.java index 23620df1e..e0c04c06e 100644 --- a/src/main/java/rtg/world/biome/deco/DecoMushrooms.java +++ b/src/main/java/rtg/world/biome/deco/DecoMushrooms.java @@ -18,12 +18,12 @@ */ public class DecoMushrooms extends DecoBase { - public float strengthFactor; - public int maxY; - public float randomFloat; - public RandomType randomType; - public int chance; - public int loops; + private float strengthFactor; + private int maxY; + private float randomFloat; + private RandomType randomType; + private int chance; + private int loops; public DecoMushrooms() { @@ -33,12 +33,12 @@ public DecoMushrooms() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // The higher the value, the more there will be. Disabled by default. - this.randomType = RandomType.USE_CHANCE_VALUE; - this.randomFloat = 1f; - this.chance = 1; - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // The higher the value, the more there will be. Disabled by default. + this.setRandomType(RandomType.USE_CHANCE_VALUE); + this.setRandomFloat(1f); + this.setChance(1); + this.setLoops(1); this.addDecoTypes(DecoType.MUSHROOM); } @@ -53,14 +53,14 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i // Let's figure out what the rand.nextInt() argument should be. switch (this.randomType) { case ALWAYS_GENERATE: - this.chance = 1; + this.setChance(1); break; case USE_CHANCE_VALUE: break; case X_DIVIDED_BY_STRENGTH: - this.chance = (int) (this.randomFloat / strength); + this.setChance((int) (this.randomFloat / strength)); break; default: @@ -70,7 +70,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGeneratorBrownShrooms = new WorldGenBush(Blocks.BROWN_MUSHROOM); WorldGenerator worldGeneratorRedShrooms = new WorldGenBush(Blocks.RED_MUSHROOM); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { if (rand.nextInt(this.chance) == 0) { @@ -98,4 +98,70 @@ public enum RandomType { USE_CHANCE_VALUE, X_DIVIDED_BY_STRENGTH } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoMushrooms setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoMushrooms setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public float getRandomFloat() { + + return randomFloat; + } + + public DecoMushrooms setRandomFloat(float randomFloat) { + + this.setRandomFloat(randomFloat); + return this; + } + + public RandomType getRandomType() { + + return randomType; + } + + public DecoMushrooms setRandomType(RandomType randomType) { + + this.setRandomType(randomType); + return this; + } + + public int getChance() { + + return chance; + } + + public DecoMushrooms setChance(int chance) { + + this.setChance(chance); + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoMushrooms setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoPond.java b/src/main/java/rtg/world/biome/deco/DecoPond.java index d27be0a08..9dd573cd4 100644 --- a/src/main/java/rtg/world/biome/deco/DecoPond.java +++ b/src/main/java/rtg/world/biome/deco/DecoPond.java @@ -17,10 +17,10 @@ */ public class DecoPond extends DecoBase { - public int chunksPerPond = 8; - public int minY = 64; - public int maxY = 240; - public int loops = 1; + private int chunksPerPond = 8; + private int minY = 64; + private int maxY = 240; + private int loops = 1; private WorldGenerator pondGenerator = new WorldGenPond(Blocks.WATER.getDefaultState()); private RTGConfig rtgConfig = RTGAPI.config(); @@ -47,4 +47,48 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public int getChunksPerPond() { + + return chunksPerPond; + } + + public DecoPond setChunksPerPond(int chunksPerPond) { + + this.chunksPerPond = chunksPerPond; + return this; + } + + public int getMinY() { + + return minY; + } + + public DecoPond setMinY(int minY) { + + this.minY = minY; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoPond setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoPond setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoPumpkin.java b/src/main/java/rtg/world/biome/deco/DecoPumpkin.java index 9b8d801b0..c84a49def 100644 --- a/src/main/java/rtg/world/biome/deco/DecoPumpkin.java +++ b/src/main/java/rtg/world/biome/deco/DecoPumpkin.java @@ -17,12 +17,12 @@ */ public class DecoPumpkin extends DecoBase { - public float strengthFactor; - public int maxY; - public float randomFloat; - public RandomType randomType; - public int chance; - public int loops; + private float strengthFactor; + private int maxY; + private float randomFloat; + private RandomType randomType; + private int chance; + private int loops; public DecoPumpkin() { @@ -32,12 +32,12 @@ public DecoPumpkin() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // The higher the value, the more there will be. Disabled by default. - this.randomType = RandomType.USE_CHANCE_VALUE; - this.randomFloat = 1f; - this.chance = 1; - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // The higher the value, the more there will be. Disabled by default. + this.setRandomType(RandomType.USE_CHANCE_VALUE); + this.setRandomFloat(1f); + this.setChance(1); + this.setLoops(1); this.addDecoTypes(DecoType.PUMPKIN); } @@ -52,14 +52,14 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i // Let's figure out what the rand.nextInt() argument should be. switch (this.randomType) { case ALWAYS_GENERATE: - this.chance = 1; + this.setChance(1); break; case USE_CHANCE_VALUE: break; case X_DIVIDED_BY_STRENGTH: - this.chance = (int) (this.randomFloat / strength); + this.setChance((int) (this.randomFloat / strength)); break; default: @@ -68,7 +68,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGenerator = new WorldGenPumpkin(); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { if (rand.nextInt(this.chance) == 0) { @@ -90,4 +90,70 @@ public enum RandomType { USE_CHANCE_VALUE, X_DIVIDED_BY_STRENGTH } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoPumpkin setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoPumpkin setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public float getRandomFloat() { + + return randomFloat; + } + + public DecoPumpkin setRandomFloat(float randomFloat) { + + this.setRandomFloat(randomFloat); + return this; + } + + public RandomType getRandomType() { + + return randomType; + } + + public DecoPumpkin setRandomType(RandomType randomType) { + + this.setRandomType(randomType); + return this; + } + + public int getChance() { + + return chance; + } + + public DecoPumpkin setChance(int chance) { + + this.setChance(chance); + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoPumpkin setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoReed.java b/src/main/java/rtg/world/biome/deco/DecoReed.java index ea8402ba5..3954523c7 100644 --- a/src/main/java/rtg/world/biome/deco/DecoReed.java +++ b/src/main/java/rtg/world/biome/deco/DecoReed.java @@ -17,9 +17,9 @@ */ public class DecoReed extends DecoBase { - public float strengthFactor; - public int maxY; - public int loops; + private float strengthFactor; + private int maxY; + private int loops; public DecoReed() { @@ -29,9 +29,9 @@ public DecoReed() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.maxY = 255; // No height limit by default. - this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.loops = 1; + this.setMaxY(255); // No height limit by default. + this.setStrengthFactor(0f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setLoops(1); this.addDecoTypes(DecoType.REED); } @@ -45,7 +45,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i WorldGenerator worldGenerator = new WorldGenReed(); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { int intX = worldX + rand.nextInt(16) + 8; int intY = rand.nextInt(this.maxY); @@ -58,4 +58,37 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } } } + + public float getStrengthFactor() { + + return strengthFactor; + } + + public DecoReed setStrengthFactor(float strengthFactor) { + + this.setStrengthFactor(strengthFactor); + return this; + } + + public int getMaxY() { + + return maxY; + } + + public DecoReed setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public int getLoops() { + + return loops; + } + + public DecoReed setLoops(int loops) { + + this.loops = loops; + return this; + } } diff --git a/src/main/java/rtg/world/biome/deco/DecoShrub.java b/src/main/java/rtg/world/biome/deco/DecoShrub.java index da2596b0c..3422ee305 100644 --- a/src/main/java/rtg/world/biome/deco/DecoShrub.java +++ b/src/main/java/rtg/world/biome/deco/DecoShrub.java @@ -19,21 +19,21 @@ */ public class DecoShrub extends DecoBase { - public int size; - public boolean useDefaultRandom; - public boolean Sand; - public IBlockState[] randomLogBlocks; - public IBlockState[] randomLeavesBlocks; - public float strengthFactor; // Higher = more/bigger shrubs. - public int minY; // Height restriction. - public int maxY; // Height restriction. - public int chance; // Higher = more rare. - public int notEqualsZerochance; - public int loops; - public int minSize; - public int maxSize; - public IBlockState logBlock; - public IBlockState leavesBlock; + private int size; + private boolean useDefaultRandom; + private boolean Sand; + private IBlockState[] randomLogBlocks; + private IBlockState[] randomLeavesBlocks; + private float strengthFactor; // Higher = more/bigger shrubs. + private int minY; // Height restriction. + private int maxY; // Height restriction. + private int chance; // Higher = more rare. + private int notEqualsZeroChance; + private int loops; + private int minSize; + private int maxSize; + private IBlockState logBlock; + private IBlockState leavesBlock; public DecoShrub() { @@ -48,16 +48,16 @@ public DecoShrub() { this.Sand = true; //Whether shrubs generate on sand this.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}; this.randomLeavesBlocks = new IBlockState[]{Blocks.LEAVES.getDefaultState(), BlockUtil.getStateLeaf(1)}; - this.strengthFactor = 3f; // Not sure why it was done like this, but... the higher the value, the more there will be. - this.minY = 1; // No height limit by default. - this.maxY = 255; // No height limit by default. - this.chance = 1; // 100% chance of generating by default. - this.notEqualsZerochance = 1; - this.loops = 1; - this.minSize = 3; - this.maxSize = 4; - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.setStrengthFactor(3f); // Not sure why it was done like this, but... the higher the value, the more there will be. + this.setMinY(1); // No height limit by default. + this.setMaxY(255); // No height limit by default. + this.setChance(1); // 100% chance of generating by default. + this.notEqualsZeroChance = 1; + this.setLoops(1); + this.setMinSize(3); + this.setMaxSize(4); + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.addDecoTypes(DecoType.SHRUB); } @@ -87,8 +87,8 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i this.randomLogBlocks.length == this.randomLeavesBlocks.length) { int rnd = rand.nextInt(this.randomLogBlocks.length); - this.logBlock = this.randomLogBlocks[rnd]; - this.leavesBlock = this.randomLeavesBlocks[rnd]; + this.setLogBlock(this.randomLogBlocks[rnd]); + this.setLeavesBlock(this.randomLeavesBlocks[rnd]); } WorldUtil worldUtil = new WorldUtil(rtgWorld.world); @@ -101,9 +101,9 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i int intZ = worldZ + rand.nextInt(16);// + 8; int intY = rtgWorld.world.getHeight(new BlockPos(intX, 0, intZ)).getY(); - if (this.notEqualsZerochance > 1) { + if (this.notEqualsZeroChance > 1) { - if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZeroChance) != 0) { generateWorldGenerator(worldGenerator, worldUtil, rtgWorld.world, rand, intX, intY, intZ, hasPlacedVillageBlocks); } } @@ -190,7 +190,7 @@ public float getStrengthFactor() { public DecoShrub setStrengthFactor(float strengthFactor) { - this.strengthFactor = strengthFactor; + this.setStrengthFactor(strengthFactor); return this; } @@ -201,7 +201,7 @@ public int getMinY() { public DecoShrub setMinY(int minY) { - this.minY = minY; + this.setMinY(minY); return this; } @@ -212,7 +212,7 @@ public int getMaxY() { public DecoShrub setMaxY(int maxY) { - this.maxY = maxY; + this.setMaxY(maxY); return this; } @@ -223,18 +223,18 @@ public int getChance() { public DecoShrub setChance(int chance) { - this.chance = chance; + this.setChance(chance); return this; } - public int getNotEqualsZerochance() { + public int getNotEqualsZeroChance() { - return notEqualsZerochance; + return notEqualsZeroChance; } - public DecoShrub setNotEqualsZerochance(int notEqualsZerochance) { + public DecoShrub setNotEqualsZeroChance(int notEqualsZeroChance) { - this.notEqualsZerochance = notEqualsZerochance; + this.notEqualsZeroChance = notEqualsZeroChance; return this; } @@ -245,7 +245,7 @@ public int getLoops() { public DecoShrub setLoops(int loops) { - this.loops = loops; + this.setLoops(loops); return this; } @@ -256,7 +256,7 @@ public int getMinSize() { public DecoShrub setMinSize(int minSize) { - this.minSize = minSize; + this.setMinSize(minSize); return this; } @@ -267,7 +267,7 @@ public int getMaxSize() { public DecoShrub setMaxSize(int maxSize) { - this.maxSize = maxSize; + this.setMaxSize(maxSize); return this; } @@ -278,7 +278,7 @@ public IBlockState getLogBlock() { public DecoShrub setLogBlock(IBlockState logBlock) { - this.logBlock = logBlock; + this.setLogBlock(logBlock); return this; } @@ -289,7 +289,7 @@ public IBlockState getLeavesBlock() { public DecoShrub setLeavesBlock(IBlockState leavesBlock) { - this.leavesBlock = leavesBlock; + this.setLeavesBlock(leavesBlock); return this; } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index 3e5b56b0f..67a705717 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -24,31 +24,31 @@ */ public class DecoTree extends DecoBase { - public int loops; - public float strengthFactorForLoops; // If set, this overrides and dynamically calculates 'loops' based on the strength parameter. - public boolean strengthNoiseFactorForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * strength) - public boolean strengthNoiseFactorXForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * X * strength) - public TreeType treeType; // Enum for the various tree presets. - public TreeRTG tree; - public WorldGenerator worldGen; - public DecoTree.Distribution distribution; // Parameter object for noise calculations. - public TreeCondition treeCondition; // Enum for the various conditions/chances for tree gen. - public float treeConditionNoise; // Only applies to a noise-related TreeCondition. - public float treeConditionNoise2; // Only applies to a noise-related TreeCondition. - public int treeConditionChance; // Only applies to a chance-related TreeCondition. - public float treeConditionFloat; // Multi-purpose float. - public int minY; // Lower height restriction. - public int maxY; // Upper height restriction. - public IBlockState logBlock; - public IBlockState leavesBlock; - public int minSize; // Min tree height (only used with certain tree presets) - public int maxSize; // Max tree height (only used with certain tree presets) - public int minTrunkSize; // Min tree height (only used with certain tree presets) - public int maxTrunkSize; // Max tree height (only used with certain tree presets) - public int minCrownSize; // Min tree height (only used with certain tree presets) - public int maxCrownSize; // Max tree height (only used with certain tree presets) - public boolean noLeaves; - public Scatter scatter; + protected int loops; + protected float strengthFactorForLoops; // If set, this overrides and dynamically calculates 'loops' based on the strength parameter. + protected boolean strengthNoiseFactorForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * strength) + protected boolean strengthNoiseFactorXForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * X * strength) + protected TreeType treeType; // Enum for the various tree presets. + protected TreeRTG tree; + protected WorldGenerator worldGen; + protected DecoTree.Distribution distribution; // Parameter object for noise calculations. + protected TreeCondition treeCondition; // Enum for the various conditions/chances for tree gen. + protected float treeConditionNoise; // Only applies to a noise-related TreeCondition. + protected float treeConditionNoise2; // Only applies to a noise-related TreeCondition. + protected int treeConditionChance; // Only applies to a chance-related TreeCondition. + protected float treeConditionFloat; // Multi-purpose float. + protected int minY; // Lower height restriction. + protected int maxY; // Upper height restriction. + protected IBlockState logBlock; + protected IBlockState leavesBlock; + protected int minSize; // Min tree height (only used with certain tree presets) + protected int maxSize; // Max tree height (only used with certain tree presets) + protected int minTrunkSize; // Min tree height (only used with certain tree presets) + protected int maxTrunkSize; // Max tree height (only used with certain tree presets) + protected int minCrownSize; // Min tree height (only used with certain tree presets) + protected int maxCrownSize; // Max tree height (only used with certain tree presets) + protected boolean noLeaves; + protected Scatter scatter; public DecoTree() { @@ -58,31 +58,31 @@ public DecoTree() { * Default values. * These can be overridden when configuring the Deco object in the realistic biome. */ - this.loops = 1; - this.strengthFactorForLoops = 0f; - this.strengthNoiseFactorForLoops = false; - this.strengthNoiseFactorXForLoops = false; - this.treeType = TreeType.RTG_TREE; + this.setLoops(1); + this.setStrengthFactorForLoops(0f); + this.setStrengthNoiseFactorForLoops(false); + this.setStrengthNoiseFactorXForLoops(false); + this.setTreeType(TreeType.RTG_TREE); this.tree = null; this.worldGen = null; - this.distribution = new DecoTree.Distribution(100f, 5f, 0.8f); - this.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - this.treeConditionNoise = 0f; - this.treeConditionNoise2 = 0f; - this.treeConditionFloat = 0f; - this.treeConditionChance = 1; - this.minY = 63; // No underwater trees by default. - this.maxY = 230; // Sensible upper height limit by default. - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); - this.minSize = 2; - this.maxSize = 4; - this.minTrunkSize = 2; - this.maxTrunkSize = 4; - this.minCrownSize = 2; - this.maxCrownSize = 4; - this.noLeaves = false; - this.scatter = new Scatter(16, 0); + this.setDistribution(new DecoTree.Distribution(100f, 5f, 0.8f)); + this.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + this.setTreeConditionNoise(0f); + this.setTreeConditionNoise2(0f); + this.setTreeConditionFloat(0f); + this.setTreeConditionChance(1); + this.setMinY(63); // No underwater trees by default. + this.setMaxY(230); // Sensible upper height limit by default. + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + this.setMinSize(2); + this.setMaxSize(4); + this.setMinTrunkSize(2); + this.setMaxTrunkSize(4); + this.setMinCrownSize(2); + this.setMaxCrownSize(4); + this.setNoLeaves(false); + this.setScatter(new Scatter(16, 0)); this.addDecoTypes(DecoType.TREE); } @@ -90,44 +90,44 @@ public DecoTree() { public DecoTree(DecoTree source) { this(); - this.loops = source.loops; - this.strengthFactorForLoops = source.strengthFactorForLoops; - this.strengthNoiseFactorForLoops = source.strengthNoiseFactorForLoops; - this.strengthNoiseFactorXForLoops = source.strengthNoiseFactorXForLoops; - this.treeType = source.treeType; + this.setLoops(source.loops); + this.setStrengthFactorForLoops(source.strengthFactorForLoops); + this.setStrengthNoiseFactorForLoops(source.strengthNoiseFactorForLoops); + this.setStrengthNoiseFactorXForLoops(source.strengthNoiseFactorXForLoops); + this.setTreeType(source.treeType); this.tree = source.tree; this.worldGen = source.worldGen; - this.distribution = source.distribution; - this.treeCondition = source.treeCondition; - this.treeConditionNoise = source.treeConditionNoise; - this.treeConditionNoise2 = source.treeConditionNoise2; - this.treeConditionFloat = source.treeConditionFloat; + this.setDistribution(source.distribution); + this.setTreeCondition(source.treeCondition); + this.setTreeConditionNoise(source.treeConditionNoise); + this.setTreeConditionNoise2(source.treeConditionNoise2); + this.setTreeConditionFloat(source.treeConditionFloat); this.treeConditionChance = source.treeConditionChance; - this.minY = source.minY; - this.maxY = source.maxY; - this.logBlock = source.logBlock; - this.leavesBlock = source.leavesBlock; - this.minSize = source.minSize; - this.maxSize = source.maxSize; - this.minTrunkSize = source.minTrunkSize; - this.maxTrunkSize = source.maxTrunkSize; - this.minCrownSize = source.minCrownSize; - this.maxCrownSize = source.maxCrownSize; - this.noLeaves = source.noLeaves; - this.scatter = source.scatter; + this.setMinY(source.minY); + this.setMaxY(source.maxY); + this.setLogBlock(source.logBlock); + this.setLeavesBlock(source.leavesBlock); + this.setMinSize(source.minSize); + this.setMaxSize(source.maxSize); + this.setMinTrunkSize(source.minTrunkSize); + this.setMaxTrunkSize(source.maxTrunkSize); + this.setMinCrownSize(source.minCrownSize); + this.setMaxCrownSize(source.maxCrownSize); + this.setNoLeaves(source.noLeaves); + this.setScatter(source.scatter); } public DecoTree(TreeRTG tree) { this(); this.tree = tree; - this.logBlock = tree.logBlock; - this.leavesBlock = tree.leavesBlock; - this.minTrunkSize = tree.minTrunkSize; - this.maxTrunkSize = tree.maxTrunkSize; - this.minCrownSize = tree.minCrownSize; - this.maxCrownSize = tree.maxCrownSize; - this.noLeaves = tree.noLeaves; + this.setLogBlock(tree.getLogBlock()); + this.setLeavesBlock(tree.getLeavesBlock()); + this.setMinTrunkSize(tree.getMinTrunkSize()); + this.setMaxTrunkSize(tree.getMaxTrunkSize()); + this.setMinCrownSize(tree.getMinCrownSize()); + this.setMaxCrownSize(tree.getMaxCrownSize()); + this.setNoLeaves(tree.getNoLeaves()); } public DecoTree(WorldGenerator worldGen) { @@ -221,7 +221,7 @@ rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), TREE, loopCount case RTG_TREE: - //this.logBlock = strength < 0.2f ? BlockUtil.getStateLog(2) : this.logBlock; + //this.setLogBlock(strength < 0.2f ? BlockUtil.getStateLog(2) : this.logBlock); this.tree.setLogBlock(this.logBlock); this.tree.setLeavesBlock(this.leavesBlock); @@ -321,9 +321,9 @@ public int get(Random rand, int coord) { */ public static class Distribution { - public float noiseDivisor; - public float noiseFactor; - public float noiseAddend; + protected float noiseDivisor; + protected float noiseFactor; + protected float noiseAddend; public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { @@ -331,6 +331,39 @@ public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { this.noiseFactor = noiseFactor; this.noiseAddend = noiseAddend; } + + public float getNoiseDivisor() { + + return noiseDivisor; + } + + public Distribution setNoiseDivisor(float noiseDivisor) { + + this.noiseDivisor = noiseDivisor; + return this; + } + + public float getNoiseFactor() { + + return noiseFactor; + } + + public Distribution setNoiseFactor(float noiseFactor) { + + this.noiseFactor = noiseFactor; + return this; + } + + public float getNoiseAddend() { + + return noiseAddend; + } + + public Distribution setNoiseAddend(float noiseAddend) { + + this.noiseAddend = noiseAddend; + return this; + } } public int getLoops() { @@ -340,7 +373,7 @@ public int getLoops() { public DecoTree setLoops(int loops) { - this.loops = loops; + this.setLoops(loops); return this; } @@ -351,7 +384,7 @@ public float getStrengthFactorForLoops() { public DecoTree setStrengthFactorForLoops(float strengthFactorForLoops) { - this.strengthFactorForLoops = strengthFactorForLoops; + this.setStrengthFactorForLoops(strengthFactorForLoops); return this; } @@ -362,7 +395,7 @@ public boolean isStrengthNoiseFactorForLoops() { public DecoTree setStrengthNoiseFactorForLoops(boolean strengthNoiseFactorForLoops) { - this.strengthNoiseFactorForLoops = strengthNoiseFactorForLoops; + this.setStrengthNoiseFactorForLoops(strengthNoiseFactorForLoops); return this; } @@ -373,7 +406,7 @@ public boolean isStrengthNoiseFactorXForLoops() { public DecoTree setStrengthNoiseFactorXForLoops(boolean strengthNoiseFactorXForLoops) { - this.strengthNoiseFactorXForLoops = strengthNoiseFactorXForLoops; + this.setStrengthNoiseFactorXForLoops(strengthNoiseFactorXForLoops); return this; } @@ -384,7 +417,7 @@ public TreeType getTreeType() { public DecoTree setTreeType(TreeType treeType) { - this.treeType = treeType; + this.setTreeType(treeType); return this; } @@ -417,7 +450,7 @@ public Distribution getDistribution() { public DecoTree setDistribution(Distribution distribution) { - this.distribution = distribution; + this.setDistribution(distribution); return this; } @@ -428,7 +461,7 @@ public TreeCondition getTreeCondition() { public DecoTree setTreeCondition(TreeCondition treeCondition) { - this.treeCondition = treeCondition; + this.setTreeCondition(treeCondition); return this; } @@ -439,7 +472,7 @@ public float getTreeConditionNoise() { public DecoTree setTreeConditionNoise(float treeConditionNoise) { - this.treeConditionNoise = treeConditionNoise; + this.setTreeConditionNoise(treeConditionNoise); return this; } @@ -450,7 +483,7 @@ public float getTreeConditionNoise2() { public DecoTree setTreeConditionNoise2(float treeConditionNoise2) { - this.treeConditionNoise2 = treeConditionNoise2; + this.setTreeConditionNoise2(treeConditionNoise2); return this; } @@ -472,7 +505,7 @@ public float getTreeConditionFloat() { public DecoTree setTreeConditionFloat(float treeConditionFloat) { - this.treeConditionFloat = treeConditionFloat; + this.setTreeConditionFloat(treeConditionFloat); return this; } @@ -483,7 +516,7 @@ public int getMinY() { public DecoTree setMinY(int minY) { - this.minY = minY; + this.setMinY(minY); return this; } @@ -494,7 +527,7 @@ public int getMaxY() { public DecoTree setMaxY(int maxY) { - this.maxY = maxY; + this.setMaxY(maxY); return this; } @@ -505,7 +538,7 @@ public IBlockState getLogBlock() { public DecoTree setLogBlock(IBlockState logBlock) { - this.logBlock = logBlock; + this.setLogBlock(logBlock); return this; } @@ -516,7 +549,7 @@ public IBlockState getLeavesBlock() { public DecoTree setLeavesBlock(IBlockState leavesBlock) { - this.leavesBlock = leavesBlock; + this.setLeavesBlock(leavesBlock); return this; } @@ -527,7 +560,7 @@ public int getMinSize() { public DecoTree setMinSize(int minSize) { - this.minSize = minSize; + this.setMinSize(minSize); return this; } @@ -538,7 +571,7 @@ public int getMaxSize() { public DecoTree setMaxSize(int maxSize) { - this.maxSize = maxSize; + this.setMaxSize(maxSize); return this; } @@ -549,7 +582,7 @@ public int getMinTrunkSize() { public DecoTree setMinTrunkSize(int minTrunkSize) { - this.minTrunkSize = minTrunkSize; + this.setMinTrunkSize(minTrunkSize); return this; } @@ -560,7 +593,7 @@ public int getMaxTrunkSize() { public DecoTree setMaxTrunkSize(int maxTrunkSize) { - this.maxTrunkSize = maxTrunkSize; + this.setMaxTrunkSize(maxTrunkSize); return this; } @@ -571,7 +604,7 @@ public int getMinCrownSize() { public DecoTree setMinCrownSize(int minCrownSize) { - this.minCrownSize = minCrownSize; + this.setMinCrownSize(minCrownSize); return this; } @@ -582,7 +615,7 @@ public int getMaxCrownSize() { public DecoTree setMaxCrownSize(int maxCrownSize) { - this.maxCrownSize = maxCrownSize; + this.setMaxCrownSize(maxCrownSize); return this; } @@ -593,7 +626,7 @@ public boolean isNoLeaves() { public DecoTree setNoLeaves(boolean noLeaves) { - this.noLeaves = noLeaves; + this.setNoLeaves(noLeaves); return this; } @@ -604,7 +637,7 @@ public Scatter getScatter() { public DecoTree setScatter(Scatter scatter) { - this.scatter = scatter; + this.setScatter(scatter); return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoVines.java b/src/main/java/rtg/world/biome/deco/DecoVines.java index 1001aa385..92744135e 100644 --- a/src/main/java/rtg/world/biome/deco/DecoVines.java +++ b/src/main/java/rtg/world/biome/deco/DecoVines.java @@ -22,15 +22,15 @@ */ public class DecoVines extends DecoBase { - public int loops; - public float strengthFactor; - public Block vineBlock; - public int minY; - public int maxY; - public PropertyBool propNorth; - public PropertyBool propEast; - public PropertyBool propSouth; - public PropertyBool propWest; + private int loops; + private float strengthFactor; + private Block vineBlock; + private int minY; + private int maxY; + private PropertyBool propNorth; + private PropertyBool propEast; + private PropertyBool propSouth; + private PropertyBool propWest; protected WorldGenerator worldGenerator; @@ -38,10 +38,10 @@ public DecoVines() { super(); - this.loops = 1; - this.strengthFactor = 0f; - this.minY = 63; - this.maxY = 200; + this.setLoops(1); + this.setStrengthFactor(0f); + this.setMinY(63); + this.setMaxY(200); this.vineBlock = Blocks.VINE; this.propNorth = BlockVine.NORTH; this.propEast = BlockVine.EAST; @@ -77,7 +77,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i this.worldGenerator = new WorldGenVinesRTG(this.vineBlock, this.maxY, this.propNorth, this.propEast, this.propSouth, this.propWest); - this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops); for (int i = 0; i < this.loops; i++) { int intX = worldX + rand.nextInt(16);// + 8; @@ -97,7 +97,7 @@ public int getLoops() { public DecoVines setLoops(int loops) { - this.loops = loops; + this.setLoops(loops); return this; } @@ -108,7 +108,7 @@ public float getStrengthFactor() { public DecoVines setStrengthFactor(float strengthFactor) { - this.strengthFactor = strengthFactor; + this.setStrengthFactor(strengthFactor); return this; } @@ -130,7 +130,7 @@ public int getMinY() { public DecoVines setMinY(int minY) { - this.minY = minY; + this.setMinY(minY); return this; } @@ -141,7 +141,7 @@ public int getMaxY() { public DecoVines setMaxY(int maxY) { - this.maxY = maxY; + this.setMaxY(maxY); return this; } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java index e38e6a7c4..d390fd72e 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java @@ -15,21 +15,21 @@ public DecoCollectionDesert() { super(); DecoDesertWell decoDesertWell = new DecoDesertWell(); - decoDesertWell.maxY = 80; - decoDesertWell.strengthFactor = 1f; - decoDesertWell.chance = 160; + decoDesertWell.setMaxY(80); + decoDesertWell.setStrengthFactor(1f); + decoDesertWell.setChance(160); this.addDeco(decoDesertWell); DecoCactus decoCactus = new DecoCactus(); - decoCactus.maxY = 90; - decoCactus.strengthFactor = 3f; - decoCactus.chance = 2; + decoCactus.setMaxY(90); + decoCactus.setStrengthFactor(3f); + decoCactus.setChance(2); this.addDeco(decoCactus); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.maxY = 128; - decoDeadBush.strengthFactor = 2f; - decoDeadBush.chance = 3; + decoDeadBush.setMaxY(128); + decoDeadBush.setStrengthFactor(2f); + decoDeadBush.setChance(3); this.addDeco(decoDeadBush); } } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java index 0ed12a995..792974ad7 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java @@ -21,54 +21,54 @@ public DecoCollectionDesertRiver() { super(); TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); - acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); - acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaTree.minTrunkSize = 12; - acaciaTree.maxTrunkSize = 16; + acaciaTree.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaTree.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaTree.setMinTrunkSize(12); + acaciaTree.setMaxTrunkSize(16); this.addTree(acaciaTree); DecoTree acaciaTrees = new DecoTree(acaciaTree); - acaciaTrees.checkRiver = true; - acaciaTrees.minRiver = 0.86f; - acaciaTrees.loops = 1; - acaciaTrees.treeType = TreeType.RTG_TREE; - acaciaTrees.treeCondition = TreeCondition.ALWAYS_GENERATE; - acaciaTrees.maxY = 65; + acaciaTrees.setCheckRiver(true); + acaciaTrees.setMinRiver(0.86f); + acaciaTrees.setLoops(1); + acaciaTrees.setTreeType(TreeType.RTG_TREE); + acaciaTrees.setTreeCondition(TreeCondition.ALWAYS_GENERATE); + acaciaTrees.setMaxY(65); this.addDeco(acaciaTrees); DecoShrub acaciaShrub = new DecoShrub(); - acaciaShrub.checkRiver = true; - acaciaShrub.minRiver = 0.86f; - acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); - acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaShrub.maxY = 65; - acaciaShrub.loops = 1; - acaciaShrub.chance = 1; + acaciaShrub.setCheckRiver(true); + acaciaShrub.setMinRiver(0.86f); + acaciaShrub.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaShrub.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaShrub.setMaxY(65); + acaciaShrub.setLoops(1); + acaciaShrub.setChance(1); this.addDeco(acaciaShrub); DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, acaciaShrub, acaciaTrees); this.addDeco(decoHelperThisOrThat); DecoCactus decoRiverCactus = new DecoCactus(); - decoRiverCactus.checkRiver = true; - decoRiverCactus.minRiver = 0.7f; - decoRiverCactus.maxY = 80; - decoRiverCactus.strengthFactor = 12f; + decoRiverCactus.setCheckRiver(true); + decoRiverCactus.setMinRiver(0.7f); + decoRiverCactus.setMaxY(80); + decoRiverCactus.setStrengthFactor(12f); this.addDeco(decoRiverCactus); DecoReed decoReed = new DecoReed(); - decoReed.checkRiver = true; - decoReed.minRiver = 0.7f; - decoReed.maxY = 68; - decoReed.loops = 3; + decoReed.setCheckRiver(true); + decoReed.setMinRiver(0.7f); + decoReed.setMaxY(68); + decoReed.setLoops(3); this.addDeco(decoReed); DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); - decoGrassDoubleTallgrass.checkRiver = true; - decoGrassDoubleTallgrass.minRiver = 0.7f; - decoGrassDoubleTallgrass.maxY = 128; - decoGrassDoubleTallgrass.loops = 15; - decoGrassDoubleTallgrass.doubleGrassChance = 3; + decoGrassDoubleTallgrass.setCheckRiver(true); + decoGrassDoubleTallgrass.setMinRiver(0.7f); + decoGrassDoubleTallgrass.setMaxY(128); + decoGrassDoubleTallgrass.setLoops(15); + decoGrassDoubleTallgrass.setDoubleGrassChance(3); this.addDeco(decoGrassDoubleTallgrass); } } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java index 7c17db14e..a37938ab9 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java @@ -59,12 +59,12 @@ private DecoHelper5050 tallTrees(float noiseMin, float noiseMax) { private DecoTree tallPineTrees(IBlockState log, IBlockState leaves, float noiseMin, float noiseMax) { TreeRTG pinusPonderosa = new TreeRTGPinusPonderosa(); - pinusPonderosa.logBlock = log; - pinusPonderosa.leavesBlock = leaves; - pinusPonderosa.minTrunkSize = 11; - pinusPonderosa.maxTrunkSize = 21; - pinusPonderosa.minCrownSize = 15; - pinusPonderosa.maxCrownSize = 29; + pinusPonderosa.setLogBlock(log); + pinusPonderosa.setLeavesBlock(leaves); + pinusPonderosa.setMinTrunkSize(11); + pinusPonderosa.setMaxTrunkSize(21); + pinusPonderosa.setMinCrownSize(15); + pinusPonderosa.setMaxCrownSize(29); this.addTree(pinusPonderosa); diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java index 0ab289543..c83449100 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java @@ -24,55 +24,55 @@ public DecoCollectionMegaTaiga() { super(); TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); - sitchensisTree.logBlock = BlockUtil.getStateLog(1); - sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); - sitchensisTree.minTrunkSize = 4; - sitchensisTree.maxTrunkSize = 9; - sitchensisTree.minCrownSize = 5; - sitchensisTree.maxCrownSize = 14; + sitchensisTree.setLogBlock(BlockUtil.getStateLog(1)); + sitchensisTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sitchensisTree.setMinTrunkSize(4); + sitchensisTree.setMaxTrunkSize(9); + sitchensisTree.setMinCrownSize(5); + sitchensisTree.setMaxCrownSize(14); this.addTree(sitchensisTree); DecoTree smallPines = new DecoTree(sitchensisTree); - smallPines.strengthNoiseFactorXForLoops = true; - smallPines.strengthFactorForLoops = 4f; - smallPines.treeType = TreeType.RTG_TREE; - smallPines.treeCondition = TreeCondition.ALWAYS_GENERATE; - smallPines.treeConditionChance = 3; - smallPines.maxY = 100; + smallPines.setStrengthNoiseFactorXForLoops(true); + smallPines.setStrengthFactorForLoops(4f); + smallPines.setTreeType(TreeType.RTG_TREE); + smallPines.setTreeCondition(TreeCondition.ALWAYS_GENERATE); + smallPines.setTreeConditionChance(3); + smallPines.setMaxY(100); TreeRTG pungensTree = new TreeRTGPiceaPungens(); - pungensTree.logBlock = BlockUtil.getStateLog(1); - pungensTree.leavesBlock = BlockUtil.getStateLeaf(1); - pungensTree.minTrunkSize = 2; - pungensTree.maxTrunkSize = 7; - pungensTree.minCrownSize = 6; - pungensTree.maxCrownSize = 17; + pungensTree.setLogBlock(BlockUtil.getStateLog(1)); + pungensTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + pungensTree.setMinTrunkSize(2); + pungensTree.setMaxTrunkSize(7); + pungensTree.setMinCrownSize(6); + pungensTree.setMaxCrownSize(17); this.addTree(pungensTree); DecoTree spruceTrees = new DecoTree(pungensTree); - spruceTrees.strengthNoiseFactorXForLoops = true; - spruceTrees.strengthFactorForLoops = 4f; - spruceTrees.treeType = TreeType.RTG_TREE; - spruceTrees.treeCondition = TreeCondition.ALWAYS_GENERATE; - spruceTrees.treeConditionChance = 1; - spruceTrees.maxY = 100; + spruceTrees.setStrengthNoiseFactorXForLoops(true); + spruceTrees.setStrengthFactorForLoops(4f); + spruceTrees.setTreeType(TreeType.RTG_TREE); + spruceTrees.setTreeCondition(TreeCondition.ALWAYS_GENERATE); + spruceTrees.setTreeConditionChance(1); + spruceTrees.setMaxY(100); TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); - ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); - ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaTree.minTrunkSize = 11; - ponderosaTree.maxTrunkSize = 21; - ponderosaTree.minCrownSize = 15; - ponderosaTree.maxCrownSize = 29; + ponderosaTree.setLogBlock(Blocks.LOG.getDefaultState()); + ponderosaTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + ponderosaTree.setMinTrunkSize(11); + ponderosaTree.setMaxTrunkSize(21); + ponderosaTree.setMinCrownSize(15); + ponderosaTree.setMaxCrownSize(29); this.addTree(ponderosaTree); DecoTree oakPines = new DecoTree(ponderosaTree); - oakPines.strengthNoiseFactorXForLoops = true; - oakPines.strengthFactorForLoops = 4f; - oakPines.treeType = TreeType.RTG_TREE; - oakPines.treeCondition = TreeCondition.ALWAYS_GENERATE; - oakPines.treeConditionChance = 1; - oakPines.maxY = 100; + oakPines.setStrengthNoiseFactorXForLoops(true); + oakPines.setStrengthFactorForLoops(4f); + oakPines.setTreeType(TreeType.RTG_TREE); + oakPines.setTreeCondition(TreeCondition.ALWAYS_GENERATE); + oakPines.setTreeConditionChance(1); + oakPines.setMaxY(100); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{spruceTrees, smallPines, oakPines}; diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java index 3e229c0e1..742ebeda6 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java @@ -18,59 +18,59 @@ public class DecoCollectionSavanna extends DecoCollectionBase { public DecoCollectionSavanna(boolean fallenTrees) { DecoShrub acaciaShrub = new DecoShrub(); - acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); - acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaShrub.maxY = 160; - acaciaShrub.strengthFactor = 2f; - acaciaShrub.chance = 12; + acaciaShrub.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaShrub.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaShrub.setMaxY(160); + acaciaShrub.setStrengthFactor(2f); + acaciaShrub.setChance(12); this.addDeco(acaciaShrub); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 36; - decoFallenTree.logBlock = Blocks.LOG2.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(36); + decoFallenTree.setLogBlock(Blocks.LOG2.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, fallenTrees); TreeRTG bucheriTree = new TreeRTGAcaciaBucheri(); - bucheriTree.logBlock = Blocks.LOG2.getDefaultState(); - bucheriTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); - bucheriTree.minTrunkSize = 4; - bucheriTree.maxTrunkSize = 9; + bucheriTree.setLogBlock(Blocks.LOG2.getDefaultState()); + bucheriTree.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + bucheriTree.setMinTrunkSize(4); + bucheriTree.setMaxTrunkSize(9); this.addTree(bucheriTree); DecoTree bucheriTrees = new DecoTree(bucheriTree); - bucheriTrees.loops = 1; - bucheriTrees.treeType = TreeType.RTG_TREE; - bucheriTrees.distribution.noiseDivisor = 80f; - bucheriTrees.distribution.noiseFactor = 60f; - bucheriTrees.distribution.noiseAddend = -15f; - bucheriTrees.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bucheriTrees.treeConditionNoise = -0.4f; - bucheriTrees.treeConditionChance = 28; + bucheriTrees.setLoops(1); + bucheriTrees.setTreeType(TreeType.RTG_TREE); + bucheriTrees.getDistribution().setNoiseDivisor(80f); + bucheriTrees.getDistribution().setNoiseFactor(60f); + bucheriTrees.getDistribution().setNoiseAddend(-15f); + bucheriTrees.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bucheriTrees.setTreeConditionNoise(-0.4f); + bucheriTrees.setTreeConditionChance(28); this.addDeco(bucheriTrees); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 32; - decoBoulder.maxY = 95; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(32); + decoBoulder.setMaxY(95); this.addDeco(decoBoulder); DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); - decoDoubleGrass.maxY = 128; - decoDoubleGrass.strengthFactor = 3f; + decoDoubleGrass.setMaxY(128); + decoDoubleGrass.setStrengthFactor(3f); this.addDeco(decoDoubleGrass); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java index 9fa159c54..307f8d90a 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java @@ -20,27 +20,27 @@ public class DecoCollectionSmallPineTreesForest extends DecoCollectionBase { public DecoCollectionSmallPineTreesForest() { TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); - sitchensisTree.logBlock = Blocks.LOG.getDefaultState(); - sitchensisTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - sitchensisTree.minTrunkSize = 4; - sitchensisTree.maxTrunkSize = 10; - sitchensisTree.minCrownSize = 6; - sitchensisTree.maxCrownSize = 14; + sitchensisTree.setLogBlock(Blocks.LOG.getDefaultState()); + sitchensisTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + sitchensisTree.setMinTrunkSize(4); + sitchensisTree.setMaxTrunkSize(10); + sitchensisTree.setMinCrownSize(6); + sitchensisTree.setMaxCrownSize(14); this.addTree(sitchensisTree); DecoTree oakPine = new DecoTree(sitchensisTree); - oakPine.strengthFactorForLoops = 3f; - oakPine.treeType = TreeType.RTG_TREE; - oakPine.treeCondition = TreeCondition.RANDOM_CHANCE; - oakPine.treeConditionChance = 4; - oakPine.maxY = 110; + oakPine.setStrengthFactorForLoops(3f); + oakPine.setTreeType(TreeType.RTG_TREE); + oakPine.setTreeCondition(TreeCondition.RANDOM_CHANCE); + oakPine.setTreeConditionChance(4); + oakPine.setMaxY(110); DecoTree vanillaTrees = new DecoTree(new WorldGenTrees(false)); - vanillaTrees.strengthFactorForLoops = 3f; - vanillaTrees.treeType = TreeType.WORLDGEN; - vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; - vanillaTrees.treeConditionChance = 4; - vanillaTrees.maxY = 110; + vanillaTrees.setStrengthFactorForLoops(3f); + vanillaTrees.setTreeType(TreeType.WORLDGEN); + vanillaTrees.setTreeCondition(TreeCondition.RANDOM_CHANCE); + vanillaTrees.setTreeConditionChance(4); + vanillaTrees.setMaxY(110); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{oakPine, vanillaTrees}; diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java index a1d1b7cc3..f9ad72b9a 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java @@ -24,196 +24,196 @@ public DecoCollectionTaiga(boolean fallenTrees, float grassStrengthFactor) { super(); TreeRTG sempervirensSpruceTree1 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceTree1.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceTree1.leavesBlock = BlockUtil.getStateLeaf(1); - sempervirensSpruceTree1.minTrunkSize = 3; - sempervirensSpruceTree1.maxTrunkSize = 7; - sempervirensSpruceTree1.minCrownSize = 5; - sempervirensSpruceTree1.maxCrownSize = 10; + sempervirensSpruceTree1.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceTree1.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sempervirensSpruceTree1.setMinTrunkSize(3); + sempervirensSpruceTree1.setMaxTrunkSize(7); + sempervirensSpruceTree1.setMinCrownSize(5); + sempervirensSpruceTree1.setMaxCrownSize(10); this.addTree(sempervirensSpruceTree1); DecoTree bigSpruceTrees1 = new DecoTree(sempervirensSpruceTree1); - bigSpruceTrees1.strengthFactorForLoops = 4f; - bigSpruceTrees1.treeType = TreeType.RTG_TREE; - bigSpruceTrees1.distribution.noiseDivisor = 100f; - bigSpruceTrees1.distribution.noiseFactor = 6f; - bigSpruceTrees1.distribution.noiseAddend = 0.8f; - bigSpruceTrees1.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bigSpruceTrees1.treeConditionNoise = 0f; - bigSpruceTrees1.treeConditionChance = 1; - bigSpruceTrees1.maxY = 110; + bigSpruceTrees1.setStrengthFactorForLoops(4f); + bigSpruceTrees1.setTreeType(TreeType.RTG_TREE); + bigSpruceTrees1.getDistribution().setNoiseDivisor(100f); + bigSpruceTrees1.getDistribution().setNoiseFactor(6f); + bigSpruceTrees1.getDistribution().setNoiseAddend(0.8f); + bigSpruceTrees1.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bigSpruceTrees1.setTreeConditionNoise(0f); + bigSpruceTrees1.setTreeConditionChance(1); + bigSpruceTrees1.setMaxY(110); TreeRTG sempervirensSpruceOakTree1 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceOakTree1.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceOakTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - sempervirensSpruceOakTree1.minTrunkSize = 3; - sempervirensSpruceOakTree1.maxTrunkSize = 7; - sempervirensSpruceOakTree1.minCrownSize = 5; - sempervirensSpruceOakTree1.maxCrownSize = 10; + sempervirensSpruceOakTree1.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceOakTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + sempervirensSpruceOakTree1.setMinTrunkSize(3); + sempervirensSpruceOakTree1.setMaxTrunkSize(7); + sempervirensSpruceOakTree1.setMinCrownSize(5); + sempervirensSpruceOakTree1.setMaxCrownSize(10); this.addTree(sempervirensSpruceOakTree1); DecoTree bigSpruceOakTrees1 = new DecoTree(sempervirensSpruceOakTree1); - bigSpruceOakTrees1.strengthFactorForLoops = 4f; - bigSpruceOakTrees1.treeType = TreeType.RTG_TREE; - bigSpruceOakTrees1.distribution.noiseDivisor = 100f; - bigSpruceOakTrees1.distribution.noiseFactor = 6f; - bigSpruceOakTrees1.distribution.noiseAddend = 0.8f; - bigSpruceOakTrees1.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bigSpruceOakTrees1.treeConditionNoise = 0f; - bigSpruceOakTrees1.treeConditionChance = 1; - bigSpruceOakTrees1.maxY = 110; + bigSpruceOakTrees1.setStrengthFactorForLoops(4f); + bigSpruceOakTrees1.setTreeType(TreeType.RTG_TREE); + bigSpruceOakTrees1.getDistribution().setNoiseDivisor(100f); + bigSpruceOakTrees1.getDistribution().setNoiseFactor(6f); + bigSpruceOakTrees1.getDistribution().setNoiseAddend(0.8f); + bigSpruceOakTrees1.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bigSpruceOakTrees1.setTreeConditionNoise(0f); + bigSpruceOakTrees1.setTreeConditionChance(1); + bigSpruceOakTrees1.setMaxY(110); DecoHelperThisOrThat decoHelperThisOrThat1 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees1, bigSpruceOakTrees1); this.addDeco(decoHelperThisOrThat1); TreeRTG sempervirensSpruceTree2 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceTree2.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceTree2.leavesBlock = BlockUtil.getStateLeaf(1); - sempervirensSpruceTree2.minTrunkSize = 3; - sempervirensSpruceTree2.maxTrunkSize = 7; - sempervirensSpruceTree2.minCrownSize = 5; - sempervirensSpruceTree2.maxCrownSize = 10; + sempervirensSpruceTree2.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceTree2.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sempervirensSpruceTree2.setMinTrunkSize(3); + sempervirensSpruceTree2.setMaxTrunkSize(7); + sempervirensSpruceTree2.setMinCrownSize(5); + sempervirensSpruceTree2.setMaxCrownSize(10); this.addTree(sempervirensSpruceTree2); DecoTree bigSpruceTrees2 = new DecoTree(sempervirensSpruceTree2); - bigSpruceTrees2.strengthFactorForLoops = 4f; - bigSpruceTrees2.treeType = TreeType.RTG_TREE; - bigSpruceTrees2.distribution.noiseDivisor = 80f; - bigSpruceTrees2.distribution.noiseFactor = 60f; - bigSpruceTrees2.distribution.noiseAddend = -15f; - bigSpruceTrees2.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bigSpruceTrees2.treeConditionNoise = 0f; - bigSpruceTrees2.treeConditionChance = 1; - bigSpruceTrees2.maxY = 110; + bigSpruceTrees2.setStrengthFactorForLoops(4f); + bigSpruceTrees2.setTreeType(TreeType.RTG_TREE); + bigSpruceTrees2.getDistribution().setNoiseDivisor(80f); + bigSpruceTrees2.getDistribution().setNoiseFactor(60f); + bigSpruceTrees2.getDistribution().setNoiseAddend(-15f); + bigSpruceTrees2.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bigSpruceTrees2.setTreeConditionNoise(0f); + bigSpruceTrees2.setTreeConditionChance(1); + bigSpruceTrees2.setMaxY(110); TreeRTG sempervirensSpruceOakTree2 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceOakTree2.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceOakTree2.leavesBlock = Blocks.LEAVES.getDefaultState(); - sempervirensSpruceOakTree2.minTrunkSize = 3; - sempervirensSpruceOakTree2.maxTrunkSize = 7; - sempervirensSpruceOakTree2.minCrownSize = 5; - sempervirensSpruceOakTree2.maxCrownSize = 10; + sempervirensSpruceOakTree2.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceOakTree2.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + sempervirensSpruceOakTree2.setMinTrunkSize(3); + sempervirensSpruceOakTree2.setMaxTrunkSize(7); + sempervirensSpruceOakTree2.setMinCrownSize(5); + sempervirensSpruceOakTree2.setMaxCrownSize(10); this.addTree(sempervirensSpruceOakTree2); DecoTree bigSpruceOakTrees2 = new DecoTree(sempervirensSpruceOakTree2); - bigSpruceOakTrees2.strengthFactorForLoops = 4f; - bigSpruceOakTrees2.treeType = TreeType.RTG_TREE; - bigSpruceOakTrees2.distribution.noiseDivisor = 80f; - bigSpruceOakTrees2.distribution.noiseFactor = 60f; - bigSpruceOakTrees2.distribution.noiseAddend = -15f; - bigSpruceOakTrees2.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bigSpruceOakTrees2.treeConditionNoise = 0f; - bigSpruceOakTrees2.treeConditionChance = 1; - bigSpruceOakTrees2.maxY = 110; + bigSpruceOakTrees2.setStrengthFactorForLoops(4f); + bigSpruceOakTrees2.setTreeType(TreeType.RTG_TREE); + bigSpruceOakTrees2.getDistribution().setNoiseDivisor(80f); + bigSpruceOakTrees2.getDistribution().setNoiseFactor(60f); + bigSpruceOakTrees2.getDistribution().setNoiseAddend(-15f); + bigSpruceOakTrees2.setTreeCondition(TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bigSpruceOakTrees2.setTreeConditionNoise(0f); + bigSpruceOakTrees2.setTreeConditionChance(1); + bigSpruceOakTrees2.setMaxY(110); DecoHelperThisOrThat decoHelperThisOrThat2 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees2, bigSpruceOakTrees2); this.addDeco(decoHelperThisOrThat2); TreeRTG sempervirensSpruceTree3 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceTree3.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceTree3.leavesBlock = BlockUtil.getStateLeaf(1); - sempervirensSpruceTree3.minTrunkSize = 3; - sempervirensSpruceTree3.maxTrunkSize = 7; - sempervirensSpruceTree3.minCrownSize = 5; - sempervirensSpruceTree3.maxCrownSize = 10; + sempervirensSpruceTree3.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceTree3.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sempervirensSpruceTree3.setMinTrunkSize(3); + sempervirensSpruceTree3.setMaxTrunkSize(7); + sempervirensSpruceTree3.setMinCrownSize(5); + sempervirensSpruceTree3.setMaxCrownSize(10); this.addTree(sempervirensSpruceTree3); DecoTree bigSpruceTrees3 = new DecoTree(sempervirensSpruceTree3); - bigSpruceTrees3.strengthFactorForLoops = 3f; - bigSpruceTrees3.treeType = TreeType.RTG_TREE; - bigSpruceTrees3.distribution.noiseDivisor = 80f; - bigSpruceTrees3.distribution.noiseFactor = 60f; - bigSpruceTrees3.distribution.noiseAddend = -15f; - bigSpruceTrees3.treeCondition = TreeCondition.RANDOM_CHANCE; - bigSpruceTrees3.treeConditionChance = 2; - bigSpruceTrees3.maxY = 120; + bigSpruceTrees3.setStrengthFactorForLoops(3f); + bigSpruceTrees3.setTreeType(TreeType.RTG_TREE); + bigSpruceTrees3.getDistribution().setNoiseDivisor(80f); + bigSpruceTrees3.getDistribution().setNoiseFactor(60f); + bigSpruceTrees3.getDistribution().setNoiseAddend(-15f); + bigSpruceTrees3.setTreeCondition(TreeCondition.RANDOM_CHANCE); + bigSpruceTrees3.setTreeConditionChance(2); + bigSpruceTrees3.setMaxY(120); TreeRTG sempervirensSpruceOakTree3 = new TreeRTGCupressusSempervirens(); - sempervirensSpruceOakTree3.logBlock = BlockUtil.getStateLog(1); - sempervirensSpruceOakTree3.leavesBlock = Blocks.LEAVES.getDefaultState(); - sempervirensSpruceOakTree3.minTrunkSize = 3; - sempervirensSpruceOakTree3.maxTrunkSize = 7; - sempervirensSpruceOakTree3.minCrownSize = 5; - sempervirensSpruceOakTree3.maxCrownSize = 10; + sempervirensSpruceOakTree3.setLogBlock(BlockUtil.getStateLog(1)); + sempervirensSpruceOakTree3.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + sempervirensSpruceOakTree3.setMinTrunkSize(3); + sempervirensSpruceOakTree3.setMaxTrunkSize(7); + sempervirensSpruceOakTree3.setMinCrownSize(5); + sempervirensSpruceOakTree3.setMaxCrownSize(10); this.addTree(sempervirensSpruceOakTree3); DecoTree bigSpruceOakTrees3 = new DecoTree(sempervirensSpruceOakTree3); - bigSpruceOakTrees3.strengthFactorForLoops = 3f; - bigSpruceOakTrees3.treeType = TreeType.RTG_TREE; - bigSpruceOakTrees3.distribution.noiseDivisor = 80f; - bigSpruceOakTrees3.distribution.noiseFactor = 60f; - bigSpruceOakTrees3.distribution.noiseAddend = -15f; - bigSpruceOakTrees3.treeCondition = TreeCondition.RANDOM_CHANCE; - bigSpruceOakTrees3.treeConditionChance = 2; - bigSpruceOakTrees3.maxY = 120; + bigSpruceOakTrees3.setStrengthFactorForLoops(3f); + bigSpruceOakTrees3.setTreeType(TreeType.RTG_TREE); + bigSpruceOakTrees3.getDistribution().setNoiseDivisor(80f); + bigSpruceOakTrees3.getDistribution().setNoiseFactor(60f); + bigSpruceOakTrees3.getDistribution().setNoiseAddend(-15f); + bigSpruceOakTrees3.setTreeCondition(TreeCondition.RANDOM_CHANCE); + bigSpruceOakTrees3.setTreeConditionChance(2); + bigSpruceOakTrees3.setMaxY(120); DecoHelperThisOrThat decoHelperThisOrThat3 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees3, bigSpruceOakTrees3); this.addDeco(decoHelperThisOrThat3); TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); - sitchensisTree.logBlock = BlockUtil.getStateLog(1); - sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); - sitchensisTree.minTrunkSize = 4; - sitchensisTree.maxTrunkSize = 9; - sitchensisTree.minCrownSize = 5; - sitchensisTree.maxCrownSize = 14; + sitchensisTree.setLogBlock(BlockUtil.getStateLog(1)); + sitchensisTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sitchensisTree.setMinTrunkSize(4); + sitchensisTree.setMaxTrunkSize(9); + sitchensisTree.setMinCrownSize(5); + sitchensisTree.setMaxCrownSize(14); this.addTree(sitchensisTree); DecoTree decoTrees = new DecoTree(sitchensisTree); - decoTrees.strengthFactorForLoops = 4f; - decoTrees.treeType = TreeType.RTG_TREE; - decoTrees.treeCondition = TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 3; - decoTrees.maxY = 120; + decoTrees.setStrengthFactorForLoops(4f); + decoTrees.setTreeType(TreeType.RTG_TREE); + decoTrees.setTreeCondition(TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(3); + decoTrees.setMaxY(120); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 32; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(32); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, fallenTrees); DecoShrub decoShrubSpruce = new DecoShrub(); - decoShrubSpruce.logBlock = BlockUtil.getStateLog(1); - decoShrubSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - decoShrubSpruce.maxY = 100; - decoShrubSpruce.strengthFactor = 3f; - decoShrubSpruce.chance = 6; + decoShrubSpruce.setLogBlock(BlockUtil.getStateLog(1)); + decoShrubSpruce.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoShrubSpruce.setMaxY(100); + decoShrubSpruce.setStrengthFactor(3f); + decoShrubSpruce.setChance(6); this.addDeco(decoShrubSpruce); // DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); -// decoBaseBiomeDecorations.equalsZeroChance = 3; +// decoBaseBiomeDecorations.setEqualsZeroChance(3); // this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 20; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(20); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 32f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(32f); this.addDeco(decoPumpkin); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 24f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(24f); this.addDeco(decoMushrooms); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = grassStrengthFactor; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(grassStrengthFactor); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java b/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java index 3ee700878..4fe9e0791 100644 --- a/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java +++ b/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java @@ -14,8 +14,8 @@ public class DecoHelperThisOrThat extends DecoBase { - public int chance; - public ChanceType chanceType; + private int chance; + private ChanceType chanceType; private DecoBase decoThis; private DecoBase decoThat; @@ -23,7 +23,7 @@ public DecoHelperThisOrThat(int chance, ChanceType chanceType, DecoBase decoThis super(); - this.chance = chance; + this.setChance(chance); this.chanceType = chanceType; this.decoThis = decoThis; this.decoThat = decoThat; @@ -74,4 +74,26 @@ public enum ChanceType { EQUALS_ZERO, NOT_EQUALS_ZERO; } + + public int getChance() { + + return chance; + } + + public DecoHelperThisOrThat setChance(int chance) { + + this.chance = chance; + return this; + } + + public ChanceType getChanceType() { + + return chanceType; + } + + public DecoHelperThisOrThat setChanceType(ChanceType chanceType) { + + this.chanceType = chanceType; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/realistic/RealisticBiomeBase.java b/src/main/java/rtg/world/biome/realistic/RealisticBiomeBase.java index cd71ea5d2..a56ca092b 100644 --- a/src/main/java/rtg/world/biome/realistic/RealisticBiomeBase.java +++ b/src/main/java/rtg/world/biome/realistic/RealisticBiomeBase.java @@ -110,7 +110,7 @@ public RealisticBiomeBase(Biome biome, Biome river) { * This also needs to be here so that ores get generated. */ DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.allowed = false; + decoBaseBiomeDecorations.setAllowed(false); this.addDeco(decoBaseBiomeDecorations); // set the water feature constants with the config changes @@ -475,15 +475,15 @@ public void addTree(TreeRTG tree, boolean allowed) { if (allowed) { // Set the sapling data for this tree before we add it to the list. - tree.saplingBlock = SaplingUtil.getSaplingFromLeaves(tree.leavesBlock); + tree.setSaplingBlock(SaplingUtil.getSaplingFromLeaves(tree.getLeavesBlock())); /* * Make sure all leaves delay their decay to prevent insta-despawning of leaves (e.g. Swamp Willow) * The try/catch is a safeguard against trees that use leaves which aren't an instance of BlockLeaves. */ try { - IBlockState leaves = tree.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); - tree.leavesBlock = leaves; + IBlockState leaves = tree.getLeavesBlock().withProperty(BlockLeaves.CHECK_DECAY, false); + tree.setLeavesBlock(leaves); } catch (Exception e) { // Do nothing. diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java index 67c92c6f3..8e23ab8e4 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java @@ -11,10 +11,10 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java index e7a106c14..af7622309 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java @@ -12,15 +12,16 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; import com.shinoow.abyssalcraft.api.block.ACBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoShrub; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeACDarklands extends RealisticBiomeACBase { @@ -180,20 +181,20 @@ else if (cliff == 2) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 8; - decoFallenTree.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); - decoFallenTree.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); - decoFallenTree.minSize = 2; - decoFallenTree.maxSize = 3; + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(8); + decoFallenTree.setLogBlock(ACBlocks.darklands_oak_wood.getDefaultState()); + decoFallenTree.setLeavesBlock(ACBlocks.darklands_oak_leaves.getDefaultState()); + decoFallenTree.setMinSize(2); + decoFallenTree.setMaxSize(3); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrubCustom = new DecoShrub(); - decoShrubCustom.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); - decoShrubCustom.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); - decoShrubCustom.maxY = 110; - decoShrubCustom.notEqualsZerochance = 3; - decoShrubCustom.strengthFactor = 2f; + decoShrubCustom.setLogBlock(ACBlocks.darklands_oak_wood.getDefaultState()); + decoShrubCustom.setLeavesBlock(ACBlocks.darklands_oak_leaves.getDefaultState()); + decoShrubCustom.setMaxY(110); + decoShrubCustom.setNotEqualsZeroChance(3); + decoShrubCustom.setStrengthFactor(2f); this.addDeco(decoShrubCustom); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java index c2a8eba5e..2db4b6e36 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java @@ -12,13 +12,14 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; import com.shinoow.abyssalcraft.api.block.ACBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeACDarklandsForest extends RealisticBiomeACBase { @@ -176,37 +177,37 @@ else if (cliff == 2) { public void initDecos() { DecoAbyssalCraftTree decoTrees = new DecoAbyssalCraftTree(); - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.distribution.noiseDivisor = 80f; - decoTrees.distribution.noiseFactor = 60f; - decoTrees.distribution.noiseAddend = -15f; - decoTrees.treeType = DecoAbyssalCraftTree.TreeType.DARKWOOD; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 3; - decoTrees.maxY = 110; + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.getDistribution().setNoiseDivisor(80f); + decoTrees.getDistribution().setNoiseFactor(60f); + decoTrees.getDistribution().setNoiseAddend(-15f); + decoTrees.setTreeType(DecoAbyssalCraftTree.TreeType.DARKWOOD); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(3); + decoTrees.setMaxY(110); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 12; - decoFallenTree.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); - decoFallenTree.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); - decoFallenTree.minSize = 2; - decoFallenTree.maxSize = 3; + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setLogBlock(ACBlocks.darklands_oak_wood.getDefaultState()); + decoFallenTree.setLeavesBlock(ACBlocks.darklands_oak_leaves.getDefaultState()); + decoFallenTree.setMinSize(2); + decoFallenTree.setMaxSize(3); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrubCustom = new DecoShrub(); - decoShrubCustom.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); - decoShrubCustom.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); - decoShrubCustom.maxY = 110; - decoShrubCustom.notEqualsZerochance = 3; - decoShrubCustom.strengthFactor = 3f; + decoShrubCustom.setLogBlock(ACBlocks.darklands_oak_wood.getDefaultState()); + decoShrubCustom.setLeavesBlock(ACBlocks.darklands_oak_leaves.getDefaultState()); + decoShrubCustom.setMaxY(110); + decoShrubCustom.setNotEqualsZeroChance(3); + decoShrubCustom.setStrengthFactor(3f); this.addDeco(decoShrubCustom); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 8f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(8f); this.addDeco(decoGrass); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java index faaa5bda3..d3f552257 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java @@ -11,10 +11,10 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java index 36e341f35..baa491c58 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java @@ -12,10 +12,10 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; import com.shinoow.abyssalcraft.api.block.ACBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java index 84f1ece61..55f606144 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java @@ -11,10 +11,10 @@ import com.shinoow.abyssalcraft.api.biome.ACBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; diff --git a/src/main/java/rtg/world/biome/realistic/abyssalcraft/SurfaceACBase.java b/src/main/java/rtg/world/biome/realistic/abyssalcraft/SurfaceACBase.java index db3d412fc..0ec972ade 100644 --- a/src/main/java/rtg/world/biome/realistic/abyssalcraft/SurfaceACBase.java +++ b/src/main/java/rtg/world/biome/realistic/abyssalcraft/SurfaceACBase.java @@ -4,8 +4,8 @@ import com.shinoow.abyssalcraft.api.block.ACBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; +import rtg.api.world.RTGWorld; import rtg.world.gen.surface.SurfaceBase; public abstract class SurfaceACBase extends SurfaceBase { diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java index 91190b694..0a2764c99 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java index 729a1b161..7ec14a6c7 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java index 6accf6a77..b879f1ec7 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java @@ -9,9 +9,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java index d98b752c2..fce74efe4 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java index e6037be68..3cabb5530 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java index 636b0f43a..3e34b82fc 100644 --- a/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java +++ b/src/main/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java b/src/main/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java index bd6fb7fc9..0f9e50575 100644 --- a/src/main/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java +++ b/src/main/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java @@ -9,14 +9,15 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; class RealisticBiomeBAFarmlandBiome extends rtg.world.biome.realistic.betteragriculture.RealisticBiomeBABase { @@ -164,81 +165,81 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoCrop decoWheat = new DecoCrop(); - decoWheat.type = 3; - decoWheat.chance = 80; - decoWheat.strengthFactor = 15f; - decoWheat.maxY = 255; - decoWheat.size = 30;//DO NOT PUT HIGHER THAN 30 - decoWheat.density = 600; - decoWheat.height = 5; + decoWheat.setType(3); + decoWheat.setChance(80); + decoWheat.setStrengthFactor(15f); + decoWheat.setMaxY(255); + decoWheat.setSize(30);//DO NOT PUT HIGHER THAN 30 + decoWheat.setDensity(600); + decoWheat.setHeight(5); this.addDeco(decoWheat); DecoCrop decoBeet = new DecoCrop(); - decoBeet.type = 2; - decoBeet.chance = 80; - decoBeet.strengthFactor = 12f; - decoBeet.maxY = 255; - decoBeet.size = 30;//DO NOT PUT HIGHER THAN 30 - decoBeet.density = 500; - decoBeet.height = 5; + decoBeet.setType(2); + decoBeet.setChance(80); + decoBeet.setStrengthFactor(12f); + decoBeet.setMaxY(255); + decoBeet.setSize(30);//DO NOT PUT HIGHER THAN 30 + decoBeet.setDensity(500); + decoBeet.setHeight(5); this.addDeco(decoBeet); DecoCrop decoCarrot = new DecoCrop(); - decoCarrot.type = 1; - decoCarrot.chance = 80; - decoCarrot.strengthFactor = 12f; - decoCarrot.maxY = 255; - decoCarrot.size = 30;//DO NOT PUT HIGHER THAN 30 - decoCarrot.density = 500; - decoCarrot.height = 5; + decoCarrot.setType(1); + decoCarrot.setChance(80); + decoCarrot.setStrengthFactor(12f); + decoCarrot.setMaxY(255); + decoCarrot.setSize(30);//DO NOT PUT HIGHER THAN 30 + decoCarrot.setDensity(500); + decoCarrot.setHeight(5); this.addDeco(decoCarrot); DecoCrop decoPotato = new DecoCrop(); - decoPotato.type = 0; - decoPotato.chance = 80; - decoPotato.strengthFactor = 12f; - decoPotato.maxY = 255; - decoPotato.size = 30;//DO NOT PUT HIGHER THAN 30 - decoPotato.density = 500; - decoPotato.height = 5; + decoPotato.setType(0); + decoPotato.setChance(80); + decoPotato.setStrengthFactor(12f); + decoPotato.setMaxY(255); + decoPotato.setSize(30);//DO NOT PUT HIGHER THAN 30 + decoPotato.setDensity(500); + decoPotato.setHeight(5); this.addDeco(decoPotato); DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.maxY = 90; - decoShrubOak.strengthFactor = 2f; - decoShrubOak.chance = 4; + decoShrubOak.setMaxY(90); + decoShrubOak.setStrengthFactor(2f); + decoShrubOak.setChance(4); this.addDeco(decoShrubOak); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = BlockUtil.getStateDirt(2); - decoBoulder.chance = 24; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 4f; + decoBoulder.setBoulderBlock(BlockUtil.getStateDirt(2)); + decoBoulder.setChance(24); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(4f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 105; - decoBaseBiomeDecorations.notEqualsZeroChance = 8; + decoBaseBiomeDecorations.setMaxY(105); + decoBaseBiomeDecorations.setNotEqualsZeroChance(8); this.addDeco(decoBaseBiomeDecorations); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 63; - decoGrass.maxY = 100; - decoGrass.loops = 1; + decoGrass.setMinY(63); + decoGrass.setMaxY(100); + decoGrass.setLoops(1); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java index bde32fdbe..fdb113933 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java index f0bc48059..3a0631858 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java @@ -11,11 +11,11 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java index 988fa892b..9f7348a5f 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java @@ -13,13 +13,14 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPBayou extends RealisticBiomeBOPBase { @@ -178,23 +179,23 @@ else if (cliff == 2) { public void initDecos() { DecoPond decoPond = new DecoPond(); - decoPond.chunksPerPond = 1; - decoPond.maxY = 67; - decoPond.loops = 8; + decoPond.setChunksPerPond(1); + decoPond.setMaxY(67); + decoPond.setLoops(8); this.addDeco(decoPond); // TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); -// myrtilloidesTree.logBlock = logBlock; -// myrtilloidesTree.leavesBlock = leavesBlock; +// myrtilloidesTree.setLogBlock(logBlock); +// myrtilloidesTree.setLeavesBlock(leavesBlock); // myrtilloidesTree.validGroundBlocks.add(mudBlock); // this.addTree(myrtilloidesTree); // DecoTree decoTrees = new DecoTree(myrtilloidesTree); -// decoTrees.treeType = DecoTree.TreeType.RTG_TREE; -// decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; -// decoTrees.treeConditionChance = 4; -// decoTrees.logBlock = logBlock; -// decoTrees.leavesBlock = leavesBlock; -// decoTrees.maxY = 90; +// decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); +// decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); +// decoTrees.setTreeConditionChance(4); +// decoTrees.setLogBlock(logBlock); +// decoTrees.setLeavesBlock(leavesBlock); +// decoTrees.setMaxY(90); // this.addDeco(decoTrees); /* @@ -203,65 +204,65 @@ public void initDecos() { */ // TreeRTG roseaTree = new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f); -// roseaTree.logBlock = logBlock; -// roseaTree.leavesBlock = leavesBlock; +// roseaTree.setLogBlock(logBlock); +// roseaTree.setLeavesBlock(leavesBlock); // roseaTree.validGroundBlocks.add(mudBlock); -// roseaTree.minTrunkSize = 2; -// roseaTree.maxTrunkSize = 3; -// roseaTree.minCrownSize = 10; -// roseaTree.maxCrownSize = 18; -// roseaTree.noLeaves = false; +// roseaTree.setMinTrunkSize(2); +// roseaTree.setMaxTrunkSize(3); +// roseaTree.setMinCrownSize(10); +// roseaTree.setMaxCrownSize(18); +// roseaTree.setNoLeaves(false); // this.addTree(roseaTree); // DecoTree ceibaRoseaTree = new DecoTree(roseaTree); -// ceibaRoseaTree.treeType = DecoTree.TreeType.RTG_TREE; -// ceibaRoseaTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; -// ceibaRoseaTree.treeConditionChance = 4; -// ceibaRoseaTree.maxY = 90; -// ceibaRoseaTree.scatter = new DecoTree.Scatter(16, 0); +// ceibaRoseaTree.setTreeType(DecoTree.TreeType.RTG_TREE); +// ceibaRoseaTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); +// ceibaRoseaTree.setTreeConditionChance(4); +// ceibaRoseaTree.setMaxY(90); +// ceibaRoseaTree.setScatter(new DecoTree.Scatter(16, 0)); // this.addDeco(ceibaRoseaTree); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 4; + decoBaseBiomeDecorations.setNotEqualsZeroChance(4); this.addDeco(decoBaseBiomeDecorations); // Shrubs to fill in the blanks. DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.maxY = 90; - decoShrubOak.strengthFactor = 4f; - decoShrubOak.chance = 3; + decoShrubOak.setMaxY(90); + decoShrubOak.setStrengthFactor(4f); + decoShrubOak.setChance(3); this.addDeco(decoShrubOak); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = -0.2f; - decoFallenTree.logConditionChance = 4; - decoFallenTree.logBlock = logBlock; - decoFallenTree.leavesBlock = leavesBlock; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(-0.2f); + decoFallenTree.setLogConditionChance(4); + decoFallenTree.setLogBlock(logBlock); + decoFallenTree.setLeavesBlock(leavesBlock); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoJungleLilypadVines decoJungleLilypadVines = new DecoJungleLilypadVines(); this.addDeco(decoJungleLilypadVines); DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); - decoGrassDoubleTallgrass.maxY = 90; - decoGrassDoubleTallgrass.strengthFactor = 4f; - decoGrassDoubleTallgrass.doubleGrassChance = 8; + decoGrassDoubleTallgrass.setMaxY(90); + decoGrassDoubleTallgrass.setStrengthFactor(4f); + decoGrassDoubleTallgrass.setDoubleGrassChance(8); this.addDeco(decoGrassDoubleTallgrass); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 90; - decoGrass.strengthFactor = 4f; - decoGrass.chance = 2; + decoGrass.setMaxY(90); + decoGrass.setStrengthFactor(4f); + decoGrass.setChance(2); this.addDeco(decoGrass); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE); this.addDeco(decoMushrooms); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java index 4a66b29d9..601a87cb3 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightVariation; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java index 676363411..d4ffd7d20 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java @@ -11,11 +11,11 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.BumpyHillsEffect; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java index cb35b1081..42f85f6ea 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java index 89f13ae14..70b7d6ba4 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java @@ -11,11 +11,11 @@ import biomesoplenty.api.biome.BOPBiomes; +import rtg.api.config.BiomeConfig; +import rtg.api.util.CliffCalculator; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.util.noise.SimplexOctave; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; -import rtg.api.util.CliffCalculator; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java index 3852832af..787b22356 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java @@ -12,10 +12,10 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBase; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; @@ -23,6 +23,7 @@ import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPCherryBlossomGrove extends RealisticBiomeBOPBase { @@ -167,36 +168,36 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.distribution.noiseDivisor = 100f; - decoFallenTree1.distribution.noiseFactor = 6f; - decoFallenTree1.distribution.noiseAddend = 0.8f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree1.logConditionNoise = 0f; - decoFallenTree1.logConditionChance = 16; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = BOPBlocks.log_1.getStateFromMeta(1); - decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 5; + decoFallenTree1.getDistribution().setNoiseDivisor(100f); + decoFallenTree1.getDistribution().setNoiseFactor(6f); + decoFallenTree1.getDistribution().setNoiseAddend(0.8f); + decoFallenTree1.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree1.setLogConditionNoise(0f); + decoFallenTree1.setLogConditionChance(16); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(BOPBlocks.log_1.getStateFromMeta(1)); + decoFallenTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(5); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree1.distribution.noiseDivisor = 100f; - decoFallenTree1.distribution.noiseFactor = 6f; - decoFallenTree1.distribution.noiseAddend = 0.8f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree2.logConditionNoise = 0f; - decoFallenTree2.logConditionChance = 16; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree2.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 5; + decoFallenTree1.getDistribution().setNoiseDivisor(100f); + decoFallenTree1.getDistribution().setNoiseFactor(6f); + decoFallenTree1.getDistribution().setNoiseAddend(0.8f); + decoFallenTree2.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree2.setLogConditionNoise(0f); + decoFallenTree2.setLogConditionChance(16); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree2.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(5); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree2, decoFallenTree1}; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java index 60e7aa8df..a690f527d 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.SnowHeightCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java index 8a6581196..cd543a51e 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java @@ -12,15 +12,16 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPConiferousForest extends RealisticBiomeBOPBase { @@ -166,29 +167,29 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = BOPBlocks.log_1.getStateFromMeta(3); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 5; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(BOPBlocks.log_1.getStateFromMeta(3)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 12; - decoBaseBiomeDecorations.loops = 1; + decoBaseBiomeDecorations.setNotEqualsZeroChance(12); + decoBaseBiomeDecorations.setLoops(1); this.addDeco(decoBaseBiomeDecorations); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java index 78996e14f..b0eadff0e 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java index d00e93200..ef8d30ff5 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.SimplexOctave; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.SimplexOctave; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoPond; import rtg.world.biome.deco.helper.DecoHelperBorder; @@ -177,7 +177,7 @@ else if (depth < 4) { public void initDecos() { DecoPond decoPond = new DecoPond(); - decoPond.chunksPerPond = 3;// very high because most are blocked by topography + decoPond.setChunksPerPond(3);// very high because most are blocked by topography DecoHelperBorder borderedPond = new DecoHelperBorder(decoPond, 0.8f, 0.7f); this.addDeco(borderedPond); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java index 2d96adfa7..03c5d9fb4 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java @@ -12,11 +12,11 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBase; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; @@ -24,6 +24,7 @@ import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPDeadForest extends RealisticBiomeBOPBase { @@ -173,39 +174,39 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.loops = 1; - decoFallenTree1.distribution.noiseDivisor = 100f; - decoFallenTree1.distribution.noiseFactor = 6f; - decoFallenTree1.distribution.noiseAddend = 0.8f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree1.logConditionNoise = 0f; - decoFallenTree1.logConditionChance = 10; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = BOPBlocks.log_3.getStateFromMeta(2); - decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 5; + decoFallenTree1.setLoops(1); + decoFallenTree1.getDistribution().setNoiseDivisor(100f); + decoFallenTree1.getDistribution().setNoiseFactor(6f); + decoFallenTree1.getDistribution().setNoiseAddend(0.8f); + decoFallenTree1.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree1.setLogConditionNoise(0f); + decoFallenTree1.setLogConditionChance(10); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(BOPBlocks.log_3.getStateFromMeta(2)); + decoFallenTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(5); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree2.loops = 1; - decoFallenTree2.distribution.noiseDivisor = 100f; - decoFallenTree2.distribution.noiseFactor = 6f; - decoFallenTree2.distribution.noiseAddend = 0.8f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree2.logConditionNoise = 0f; - decoFallenTree2.logConditionChance = 10; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = BlockUtil.getStateLog(1); - decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 5; + decoFallenTree2.setLoops(1); + decoFallenTree2.getDistribution().setNoiseDivisor(100f); + decoFallenTree2.getDistribution().setNoiseFactor(6f); + decoFallenTree2.getDistribution().setNoiseAddend(0.8f); + decoFallenTree2.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree2.setLogConditionNoise(0f); + decoFallenTree2.setLogConditionChance(10); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree2.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(5); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree2, decoFallenTree1}; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java index 5d49f0c6f..4d4be038a 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java @@ -12,9 +12,9 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightEffect; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java index 0e38a57d2..6a7883bf2 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java @@ -11,17 +11,18 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPEucalyptusForest extends RealisticBiomeBOPBase { @@ -169,29 +170,29 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder1 = new DecoBoulder(); - decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.maxY = 80; - decoBoulder1.chance = 12; - decoBoulder1.strengthFactor = 1f; + decoBoulder1.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMaxY(80); + decoBoulder1.setChance(12); + decoBoulder1.setStrengthFactor(1f); DecoBoulder decoBoulder2 = new DecoBoulder(); - decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder2.maxY = 80; - decoBoulder2.chance = 12; - decoBoulder2.strengthFactor = 1f; + decoBoulder2.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder2.setMaxY(80); + decoBoulder2.setChance(12); + decoBoulder2.setStrengthFactor(1f); DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); this.addDeco(decoHelper5050); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 8; - decoFallenTree.maxSize = 14; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(8); + decoFallenTree.setMaxSize(14); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java index 5a3b3cee2..b4fd651ec 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java @@ -12,11 +12,11 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBase; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; @@ -25,6 +25,7 @@ import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPFen extends RealisticBiomeBOPBase { @@ -162,41 +163,41 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder1 = new DecoBoulder(); - decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.maxY = 80; - decoBoulder1.chance = 12; - decoBoulder1.strengthFactor = 1f; + decoBoulder1.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMaxY(80); + decoBoulder1.setChance(12); + decoBoulder1.setStrengthFactor(1f); DecoBoulder decoBoulder2 = new DecoBoulder(); - decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder2.maxY = 80; - decoBoulder2.chance = 12; - decoBoulder2.strengthFactor = 1f; + decoBoulder2.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder2.setMaxY(80); + decoBoulder2.setChance(12); + decoBoulder2.setStrengthFactor(1f); DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); this.addDeco(decoHelper5050); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = BOPBlocks.log_3.getStateFromMeta(2); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 5; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(BOPBlocks.log_3.getStateFromMeta(2)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree2.distribution.noiseDivisor = 100f; - decoFallenTree2.distribution.noiseFactor = 6f; - decoFallenTree2.distribution.noiseAddend = 0.8f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree2.logConditionNoise = 0f; - decoFallenTree2.logConditionChance = 16; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 5; + decoFallenTree2.getDistribution().setNoiseDivisor(100f); + decoFallenTree2.getDistribution().setNoiseFactor(6f); + decoFallenTree2.getDistribution().setNoiseAddend(0.8f); + decoFallenTree2.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree2.setLogConditionNoise(0f); + decoFallenTree2.setLogConditionChance(16); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree2.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(5); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree, decoFallenTree2}; decoHelperRandomSplit.chances = new int[]{4, 1}; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java index d5813f255..428b862c6 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFlowersRTG; import rtg.world.biome.deco.DecoGrass; @@ -165,9 +165,9 @@ public void initDecos() { // First, let's get a few shrubs in to break things up a bit. DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 4f; - decoShrub.chance = 3; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(4f); + decoShrub.setChance(3); this.addDeco(decoShrub); // Flowers are the most aesthetically important feature of this biome, so let's add those next. @@ -186,13 +186,13 @@ public void initDecos() { // Not much free space left, so let's give some space to the base biome. DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 4; + decoBaseBiomeDecorations.setNotEqualsZeroChance(4); this.addDeco(decoBaseBiomeDecorations); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 24f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(24f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java index dde899c6a..72b8d5d19 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java index aad0265e5..2e29c0493 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java index 271744b11..a6a2a81eb 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java index 147c85fbe..50c8253d4 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java @@ -11,11 +11,11 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java index 5028cf3e2..744b1fc68 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java @@ -11,15 +11,16 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; public class RealisticBiomeBOPGrove extends RealisticBiomeBOPBase { @@ -174,44 +175,44 @@ else if (cliff == 2) { public void initDecos() { DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.distribution.noiseDivisor = 80f; - decoFallenTree1.distribution.noiseFactor = 60f; - decoFallenTree1.distribution.noiseAddend = -15f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; - decoFallenTree1.logConditionNoise = 8f; - decoFallenTree1.logConditionChance = 1; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = BlockUtil.getStateLog(2); - decoFallenTree1.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 6; + decoFallenTree1.getDistribution().setNoiseDivisor(80f); + decoFallenTree1.getDistribution().setNoiseFactor(60f); + decoFallenTree1.getDistribution().setNoiseAddend(-15f); + decoFallenTree1.setLogCondition(X_DIVIDED_BY_STRENGTH); + decoFallenTree1.setLogConditionNoise(8f); + decoFallenTree1.setLogConditionChance(1); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree1.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(6); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree2.distribution.noiseDivisor = 80f; - decoFallenTree2.distribution.noiseFactor = 60f; - decoFallenTree2.distribution.noiseAddend = -15f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; - decoFallenTree2.logConditionNoise = 8f; - decoFallenTree2.logConditionChance = 1; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 6; + decoFallenTree2.getDistribution().setNoiseDivisor(80f); + decoFallenTree2.getDistribution().setNoiseFactor(60f); + decoFallenTree2.getDistribution().setNoiseAddend(-15f); + decoFallenTree2.setLogCondition(X_DIVIDED_BY_STRENGTH); + decoFallenTree2.setLogConditionNoise(8f); + decoFallenTree2.setLogConditionChance(1); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree2.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(6); DecoHelper5050 decoHelperHelper5050 = new DecoHelper5050(decoFallenTree1, decoFallenTree2); this.addDeco(decoHelperHelper5050, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrubCustom = new DecoShrub(); - decoShrubCustom.logBlock = BlockUtil.getStateLog(2); - decoShrubCustom.leavesBlock = BlockUtil.getStateLeaf(2); - decoShrubCustom.maxY = 110; - decoShrubCustom.strengthFactor = 2f; + decoShrubCustom.setLogBlock(BlockUtil.getStateLog(2)); + decoShrubCustom.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoShrubCustom.setMaxY(110); + decoShrubCustom.setStrengthFactor(2f); DecoShrub decoShrubCustom2 = new DecoShrub(); - decoShrubCustom2.logBlock = BlockUtil.getStateLog2(1); - decoShrubCustom2.leavesBlock = BlockUtil.getStateLeaf2(1); - decoShrubCustom2.maxY = 110; - decoShrubCustom2.strengthFactor = 2f; + decoShrubCustom2.setLogBlock(BlockUtil.getStateLog2(1)); + decoShrubCustom2.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoShrubCustom2.setMaxY(110); + decoShrubCustom2.setStrengthFactor(2f); DecoHelper5050 decoHelperHelper50502 = new DecoHelper5050(decoShrubCustom, decoShrubCustom2); this.addDeco(decoHelperHelper50502); @@ -222,8 +223,8 @@ public void initDecos() { this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java index 05c22cb85..1fbfdee0b 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java @@ -11,14 +11,15 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HillockEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; public class RealisticBiomeBOPHeathland extends RealisticBiomeBOPBase { @@ -126,16 +127,16 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; - decoFallenTree.logConditionNoise = 8f; - decoFallenTree.logConditionChance = 1; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(X_DIVIDED_BY_STRENGTH); + decoFallenTree.setLogConditionNoise(8f); + decoFallenTree.setLogConditionChance(1); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java index 5c63d1489..020e4d6db 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.BumpyHillsEffect; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java index 56b829561..a441b10f3 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java index a8cdd2c8d..bbcae2109 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java @@ -11,11 +11,11 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -23,6 +23,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPLandOfLakes extends RealisticBiomeBOPBase { @@ -176,69 +177,69 @@ else if (cliff == 2) { public void initDecos() { TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); - birchTree.logBlock = BlockUtil.getStateLog(2); - birchTree.leavesBlock = BlockUtil.getStateLeaf(2); - birchTree.minTrunkSize = 4; - birchTree.maxTrunkSize = 10; - birchTree.minCrownSize = 8; - birchTree.maxCrownSize = 19; + birchTree.setLogBlock(BlockUtil.getStateLog(2)); + birchTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchTree.setMinTrunkSize(4); + birchTree.setMaxTrunkSize(10); + birchTree.setMinCrownSize(8); + birchTree.setMaxCrownSize(19); this.addTree(birchTree); DecoTree birchTrees = new DecoTree(birchTree); - birchTrees.strengthFactorForLoops = 9f; - birchTrees.treeType = DecoTree.TreeType.RTG_TREE; - birchTrees.distribution.noiseDivisor = 100f; - birchTrees.distribution.noiseFactor = 6f; - birchTrees.distribution.noiseAddend = 0.8f; - birchTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - birchTrees.treeConditionChance = 1; - birchTrees.treeConditionNoise = 0f; - birchTrees.maxY = 120; + birchTrees.setStrengthFactorForLoops(9f); + birchTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + birchTrees.getDistribution().setNoiseDivisor(100f); + birchTrees.getDistribution().setNoiseFactor(6f); + birchTrees.getDistribution().setNoiseAddend(0.8f); + birchTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + birchTrees.setTreeConditionChance(1); + birchTrees.setTreeConditionNoise(0f); + birchTrees.setMaxY(120); TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); - sitchensisTree.logBlock = BlockUtil.getStateLog(1); - sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); - sitchensisTree.minTrunkSize = 4; - sitchensisTree.maxTrunkSize = 9; - sitchensisTree.minCrownSize = 5; - sitchensisTree.maxCrownSize = 14; + sitchensisTree.setLogBlock(BlockUtil.getStateLog(1)); + sitchensisTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + sitchensisTree.setMinTrunkSize(4); + sitchensisTree.setMaxTrunkSize(9); + sitchensisTree.setMinCrownSize(5); + sitchensisTree.setMaxCrownSize(14); this.addTree(sitchensisTree); DecoTree smallPine = new DecoTree(sitchensisTree); - smallPine.strengthFactorForLoops = 9f; - smallPine.treeType = DecoTree.TreeType.RTG_TREE; - smallPine.distribution.noiseDivisor = 100f; - smallPine.distribution.noiseFactor = 6f; - smallPine.distribution.noiseAddend = 0.8f; - smallPine.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - smallPine.treeConditionChance = 1; - smallPine.treeConditionNoise = 0f; - smallPine.maxY = 120; + smallPine.setStrengthFactorForLoops(9f); + smallPine.setTreeType(DecoTree.TreeType.RTG_TREE); + smallPine.getDistribution().setNoiseDivisor(100f); + smallPine.getDistribution().setNoiseFactor(6f); + smallPine.getDistribution().setNoiseAddend(0.8f); + smallPine.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + smallPine.setTreeConditionChance(1); + smallPine.setTreeConditionNoise(0f); + smallPine.setMaxY(120); DecoHelper5050 decoHelper5050 = new DecoHelper5050(birchTrees, smallPine); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 12; - decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1), BlockUtil.getStateLog(2)}; - decoFallenTree.minSize = 8; - decoFallenTree.maxSize = 12; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1), BlockUtil.getStateLog(2)}); + decoFallenTree.setMinSize(8); + decoFallenTree.setMaxSize(12); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 12; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(12); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java index 4ccfaa95c..20651779e 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoGrass; import rtg.world.biome.deco.DecoShrub; @@ -163,14 +163,14 @@ else if (cliff == 2) { public void initDecos() { DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.chance = 10; - decoShrub.strengthFactor = 4f; + decoShrub.setMaxY(110); + decoShrub.setChance(10); + decoShrub.setStrengthFactor(4f); this.addDeco(decoShrub); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 6f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(6f); this.addDeco(decoGrass); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java index 5d7962952..4fc7f0e42 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java @@ -12,16 +12,17 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoJungleCacti; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPLushDesert extends RealisticBiomeBOPBase { @@ -195,27 +196,27 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 12; - decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG2.getStateFromMeta(1), BOPBlocks.log_3.getStateFromMeta(2), Blocks.LOG.getDefaultState()}; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 5; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{Blocks.LOG2.getStateFromMeta(1), BOPBlocks.log_3.getStateFromMeta(2), Blocks.LOG.getDefaultState()}); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); - decoJungleCacti.strengthFactor = 8f; - decoJungleCacti.maxY = 110; + decoJungleCacti.setStrengthFactor(8f); + decoJungleCacti.setMaxY(110); this.addDeco(decoJungleCacti); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java index 44b443080..e6b5623b7 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java @@ -11,14 +11,15 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.ALWAYS_GENERATE; public class RealisticBiomeBOPLushSwamp extends RealisticBiomeBOPBase { @@ -119,22 +120,22 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.ALWAYS_GENERATE; - decoFallenTree.logConditionChance = 4; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(ALWAYS_GENERATE); + decoFallenTree.setLogConditionChance(4); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java index 9819a07b0..7f01fbac3 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java index d409c5f6a..ff0ad6847 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java @@ -11,14 +11,15 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; public class RealisticBiomeBOPMapleWoods extends RealisticBiomeBOPBase { @@ -122,15 +123,15 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; - decoFallenTree.logConditionNoise = 8f; - decoFallenTree.logConditionChance = 1; - decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(X_DIVIDED_BY_STRENGTH); + decoFallenTree.setLogConditionNoise(8f); + decoFallenTree.setLogConditionChance(1); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java index a42a35d5c..77e2d8f4f 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightVariation; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java index d8ec6dfc9..2c8712057 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java index 0b2985217..71ff1690c 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java @@ -12,9 +12,9 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java index 7f3cf1047..3625f5af7 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java index fab881048..4d0e9dbd9 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java @@ -12,16 +12,17 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightEffect; import rtg.world.gen.terrain.JitterEffect; import rtg.world.gen.terrain.MountainsWithPassesEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPMountainPeaks extends RealisticBiomeBOPBase { @@ -191,34 +192,34 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 90; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 3f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(90); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(3f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(6); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BOPBlocks.log_2.getStateFromMeta(6)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 10; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(10); this.addDeco(decoShrub); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 3f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(3f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java index 7944344a6..6c2a69f16 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java @@ -12,13 +12,14 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPMysticGrove extends RealisticBiomeBOPBase { @@ -115,14 +116,14 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 12; - decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BOPBlocks.log_3.getStateFromMeta(4), BOPBlocks.log_1.getStateFromMeta(5)}; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 5; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{Blocks.LOG.getDefaultState(), BOPBlocks.log_3.getStateFromMeta(4), BOPBlocks.log_1.getStateFromMeta(5)}); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java index 91c61fc38..268015358 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java @@ -12,14 +12,15 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPOasis extends RealisticBiomeBOPBase { @@ -160,15 +161,15 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(3); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 5; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(BOPBlocks.log_2.getStateFromMeta(3)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java index 72a186013..a73b90a52 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java @@ -12,13 +12,14 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPOminousWoods extends RealisticBiomeBOPBase { @@ -125,14 +126,14 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 6; - decoFallenTree.randomLogBlocks = new IBlockState[]{BOPBlocks.log_1.getStateFromMeta(2), BOPBlocks.log_3.getStateFromMeta(2)}; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{BOPBlocks.log_1.getStateFromMeta(2), BOPBlocks.log_3.getStateFromMeta(2)}); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java index cd2e36e94..2f4f264ee 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java @@ -11,13 +11,14 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPOrchard extends RealisticBiomeBOPBase { @@ -125,15 +126,15 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 10; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 2; - decoFallenTree.maxSize = 3; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(10); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(2); + decoFallenTree.setMaxSize(3); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java index c9bd4b6ed..6459eade0 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java index 2ad26b3a9..325a4fbe0 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java index 6586b9972..4e92192eb 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java index d78c42bab..319c13286 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java index 4489b7049..309720133 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java index 7e42304db..c61865ba3 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java index ad07c4623..85deb6655 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java @@ -12,16 +12,17 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPRedwoodForest extends RealisticBiomeBOPBase { @@ -173,28 +174,28 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder1 = new DecoBoulder(); - decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.maxY = 80; - decoBoulder1.chance = 16; - decoBoulder1.strengthFactor = 1f; + decoBoulder1.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMaxY(80); + decoBoulder1.setChance(16); + decoBoulder1.setStrengthFactor(1f); DecoBoulder decoBoulder2 = new DecoBoulder(); - decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder2.maxY = 80; - decoBoulder2.chance = 16; - decoBoulder2.strengthFactor = 1f; + decoBoulder2.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder2.setMaxY(80); + decoBoulder2.setChance(16); + decoBoulder2.setStrengthFactor(1f); DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); this.addDeco(decoHelper5050); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 12; - decoFallenTree.logBlock = BOPBlocks.log_3.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 9; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setLogBlock(BOPBlocks.log_3.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java index 07e0cf3dd..28b0901fc 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java index 258e0628e..2be762acf 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java @@ -11,16 +11,17 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPSeasonalForest extends RealisticBiomeBOPBase { @@ -170,21 +171,21 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 6; - decoFallenTree.randomLogBlocks = new IBlockState[]{BlockUtil.getStateLog2(1), Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(2)}; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setRandomLogBlocks(new IBlockState[]{BlockUtil.getStateLog2(1), Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(2)}); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java index c8db257bd..720b1592e 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java @@ -12,16 +12,17 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPShield extends RealisticBiomeBOPBase { @@ -131,37 +132,37 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.distribution.noiseDivisor = 80f; - decoFallenTree1.distribution.noiseFactor = 60f; - decoFallenTree1.distribution.noiseAddend = -15f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree1.logConditionNoise = 0f; - decoFallenTree1.logConditionChance = 6; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = BOPBlocks.log_2.getStateFromMeta(6); - decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 4; + decoFallenTree1.getDistribution().setNoiseDivisor(80f); + decoFallenTree1.getDistribution().setNoiseFactor(60f); + decoFallenTree1.getDistribution().setNoiseAddend(-15f); + decoFallenTree1.setLogCondition(RANDOM_CHANCE); + decoFallenTree1.setLogConditionNoise(0f); + decoFallenTree1.setLogConditionChance(6); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(BOPBlocks.log_2.getStateFromMeta(6)); + decoFallenTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(4); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree2.distribution.noiseDivisor = 80f; - decoFallenTree2.distribution.noiseFactor = 60f; - decoFallenTree2.distribution.noiseAddend = -15f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree2.logConditionNoise = 0f; - decoFallenTree2.logConditionChance = 6; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = BlockUtil.getStateLog(1); - decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 4; + decoFallenTree2.getDistribution().setNoiseDivisor(80f); + decoFallenTree2.getDistribution().setNoiseFactor(60f); + decoFallenTree2.getDistribution().setNoiseAddend(-15f); + decoFallenTree2.setLogCondition(RANDOM_CHANCE); + decoFallenTree2.setLogConditionNoise(0f); + decoFallenTree2.setLogConditionChance(6); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree2.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(4); DecoHelper5050 decoHelperHelper5050 = new DecoHelper5050(decoFallenTree1, decoFallenTree2); this.addDeco(decoHelperHelper5050, this.getConfig().ALLOW_LOGS.get()); diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java index 19333cf62..ca3cb841c 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java index ad286bd45..865431346 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java @@ -12,15 +12,16 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBOPSnowyConiferousForest extends RealisticBiomeBOPBase { @@ -184,27 +185,27 @@ else if (cliff == 3) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 80; - decoBoulder.chance = 16; - decoBoulder.strengthFactor = 1f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(80); + decoBoulder.setChance(16); + decoBoulder.setStrengthFactor(1f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = BOPBlocks.log_1.getStateFromMeta(3); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(BOPBlocks.log_1.getStateFromMeta(3)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 12; + decoBaseBiomeDecorations.setNotEqualsZeroChance(12); this.addDeco(decoBaseBiomeDecorations); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java index f7292d566..af23e5b0a 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java index 6ce96c46e..358af24eb 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java index a3bd187b7..98532d168 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java index 532356a15..725aa3652 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java @@ -12,14 +12,15 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeBOPTropicalIsland extends RealisticBiomeBOPBase { @@ -160,16 +161,16 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 12; - decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(3); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(12); + decoFallenTree.setLogBlock(BOPBlocks.log_2.getStateFromMeta(3)); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java index 32c735331..0ca46fee6 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java index 323a7ad8a..4da91ffef 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java index 19faf4b3d..7060e9504 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoGrassDoubleTallgrass; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; @@ -160,9 +160,9 @@ else if (depth < 4) { public void initDecos() { DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); - decoGrassDoubleTallgrass.doubleGrassChance = 3; - decoGrassDoubleTallgrass.loops = 15; - decoGrassDoubleTallgrass.maxY = 128; + decoGrassDoubleTallgrass.setDoubleGrassChance(3); + decoGrassDoubleTallgrass.setLoops(15); + decoGrassDoubleTallgrass.setMaxY(128); this.addDeco(decoGrassDoubleTallgrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java index d568f614d..5751c85d1 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java index 2e8090e65..047539ded 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java @@ -12,9 +12,9 @@ import biomesoplenty.api.biome.BOPBiomes; import biomesoplenty.api.block.BOPBlocks; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java index ea2ffe6aa..5ffd4ccbd 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java @@ -11,9 +11,9 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java index 23143fad9..28723bf81 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java +++ b/src/main/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java @@ -11,10 +11,10 @@ import biomesoplenty.api.biome.BOPBiomes; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.*; diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAthuraForest.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAthuraForest.java index d3191da26..551768041 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAthuraForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAthuraForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoGrass; @@ -172,18 +172,18 @@ else if (depth < 4) { public void initDecos() { DecoShrub decoShrubAthura = new DecoShrub(); - decoShrubAthura.logBlock = athuraLogBlock; - decoShrubAthura.leavesBlock = athuraLeavesBlock; - decoShrubAthura.maxY = 90; - decoShrubAthura.strengthFactor = 4f; - decoShrubAthura.chance = 8; + decoShrubAthura.setLogBlock(athuraLogBlock); + decoShrubAthura.setLeavesBlock(athuraLeavesBlock); + decoShrubAthura.setMaxY(90); + decoShrubAthura.setStrengthFactor(4f); + decoShrubAthura.setChance(8); this.addDeco(decoShrubAthura); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 24; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(24); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); @@ -191,9 +191,9 @@ public void initDecos() { // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 63; - decoGrass.maxY = 105; - decoGrass.loops = 1; + decoGrass.setMinY(63); + decoGrass.setMaxY(105); + decoGrass.setLoops(1); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java index ba73dfbca..8e9c058cf 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java @@ -9,16 +9,17 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGQuercusRobur; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBYGAutumnForest extends RealisticBiomeBYGBase { @@ -171,72 +172,72 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrubCika = new DecoShrub(); - decoShrubCika.logBlock = cikaLogBlock; - decoShrubCika.leavesBlock = cikaLeavesBlock; - decoShrubCika.maxY = 90; - decoShrubCika.strengthFactor = 4f; - decoShrubCika.chance = 8; + decoShrubCika.setLogBlock(cikaLogBlock); + decoShrubCika.setLeavesBlock(cikaLeavesBlock); + decoShrubCika.setMaxY(90); + decoShrubCika.setStrengthFactor(4f); + decoShrubCika.setChance(8); this.addDeco(decoShrubCika); DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.maxY = 90; - decoShrubOak.strengthFactor = 4f; - decoShrubOak.chance = 4; + decoShrubOak.setMaxY(90); + decoShrubOak.setStrengthFactor(4f); + decoShrubOak.setChance(4); this.addDeco(decoShrubOak); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 24; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(24); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); TreeRTG quercusRoburOakTree = new TreeRTGQuercusRobur(); - quercusRoburOakTree.logBlock = Blocks.LOG.getDefaultState(); - quercusRoburOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - quercusRoburOakTree.minTrunkSize = 3; - quercusRoburOakTree.maxTrunkSize = 6; - quercusRoburOakTree.minCrownSize = 5; - quercusRoburOakTree.maxCrownSize = 9; - quercusRoburOakTree.validGroundBlocks.clear(); - quercusRoburOakTree.validGroundBlocks.add(BlockUtil.getStateDirt(2)); + quercusRoburOakTree.setLogBlock(Blocks.LOG.getDefaultState()); + quercusRoburOakTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + quercusRoburOakTree.setMinTrunkSize(3); + quercusRoburOakTree.setMaxTrunkSize(6); + quercusRoburOakTree.setMinCrownSize(5); + quercusRoburOakTree.setMaxCrownSize(9); + quercusRoburOakTree.getValidGroundBlocks().clear(); + quercusRoburOakTree.getValidGroundBlocks().add(BlockUtil.getStateDirt(2)); this.addTree(quercusRoburOakTree); DecoTree bigOakTrees = new DecoTree(quercusRoburOakTree); - bigOakTrees.strengthFactorForLoops = 2f; - bigOakTrees.treeType = DecoTree.TreeType.RTG_TREE; - bigOakTrees.distribution.noiseDivisor = 100f; - bigOakTrees.distribution.noiseFactor = 6f; - bigOakTrees.distribution.noiseAddend = 0.8f; - bigOakTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - bigOakTrees.treeConditionNoise = 0f; - bigOakTrees.treeConditionChance = 6; - bigOakTrees.maxY = 105; + bigOakTrees.setStrengthFactorForLoops(2f); + bigOakTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + bigOakTrees.getDistribution().setNoiseDivisor(100f); + bigOakTrees.getDistribution().setNoiseFactor(6f); + bigOakTrees.getDistribution().setNoiseAddend(0.8f); + bigOakTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + bigOakTrees.setTreeConditionNoise(0f); + bigOakTrees.setTreeConditionChance(6); + bigOakTrees.setMaxY(105); this.addDeco(bigOakTrees); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 105; - decoBaseBiomeDecorations.notEqualsZeroChance = 8; + decoBaseBiomeDecorations.setMaxY(105); + decoBaseBiomeDecorations.setNotEqualsZeroChance(8); this.addDeco(decoBaseBiomeDecorations); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 63; - decoGrass.maxY = 105; - decoGrass.loops = 1; + decoGrass.setMinY(63); + decoGrass.setMaxY(105); + decoGrass.setLoops(1); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java index 994b52f94..fcd63500e 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoGrass; @@ -21,6 +21,7 @@ import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBYGBirchPlains extends RealisticBiomeBYGBase { @@ -178,33 +179,33 @@ else if (cliff == 2) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 100; + decoBaseBiomeDecorations.setMaxY(100); this.addDeco(decoBaseBiomeDecorations); DecoShrub decoShrubBirch = new DecoShrub(); - decoShrubBirch.logBlock = BlockUtil.getStateLog(2); - decoShrubBirch.leavesBlock = BlockUtil.getStateLeaf(2); - decoShrubBirch.maxY = 90; - decoShrubBirch.strengthFactor = 6f; - decoShrubBirch.chance = 4; + decoShrubBirch.setLogBlock(BlockUtil.getStateLog(2)); + decoShrubBirch.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoShrubBirch.setMaxY(90); + decoShrubBirch.setStrengthFactor(6f); + decoShrubBirch.setChance(4); this.addDeco(decoShrubBirch); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 100; - decoGrass.strengthFactor = 6f; + decoGrass.setMaxY(100); + decoGrass.setStrengthFactor(6f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java index 315ae986c..d11f08235 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java index a8b6eeff3..b51fd9494 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoGrass; @@ -21,6 +21,7 @@ import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBYGLushForest extends RealisticBiomeBYGBase { @@ -178,33 +179,33 @@ else if (cliff == 2) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 100; + decoBaseBiomeDecorations.setMaxY(100); this.addDeco(decoBaseBiomeDecorations); DecoShrub decoShrubBirch = new DecoShrub(); - decoShrubBirch.logBlock = BlockUtil.getStateLog(2); - decoShrubBirch.leavesBlock = BlockUtil.getStateLeaf(2); - decoShrubBirch.maxY = 90; - decoShrubBirch.strengthFactor = 6f; - decoShrubBirch.chance = 4; + decoShrubBirch.setLogBlock(BlockUtil.getStateLog(2)); + decoShrubBirch.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoShrubBirch.setMaxY(90); + decoShrubBirch.setStrengthFactor(6f); + decoShrubBirch.setChance(4); this.addDeco(decoShrubBirch); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 100; - decoGrass.strengthFactor = 6f; + decoGrass.setMaxY(100); + decoGrass.setStrengthFactor(6f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGMushroomMountains.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGMushroomMountains.java index 0db595831..e9b441cdc 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGMushroomMountains.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGMushroomMountains.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; +import rtg.api.util.CliffCalculator; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.util.noise.SimplexOctave; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; -import rtg.api.util.CliffCalculator; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java index 5d7a4bb61..87e9186c8 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java index 789354199..1d9020dc2 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java @@ -9,12 +9,12 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.util.noise.SimplexOctave; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.util.noise.SimplexOctave; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGShrubs.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGShrubs.java index 42d486446..f6bfe8799 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGShrubs.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGShrubs.java @@ -9,17 +9,18 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoGrass; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBYGShrubs extends RealisticBiomeBYGBase { @@ -169,23 +170,23 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 2; - decoFallenTree.maxSize = 4; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(2); + decoFallenTree.setMaxSize(4); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 24; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(24); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); @@ -193,9 +194,9 @@ public void initDecos() { // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 63; - decoGrass.maxY = 105; - decoGrass.loops = 1; + decoGrass.setMinY(63); + decoGrass.setMaxY(105); + decoGrass.setLoops(1); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java index 61eda3509..73ba632c7 100644 --- a/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java +++ b/src/main/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoShrub; @@ -22,6 +22,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGSalixMyrtilloides; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeBYGWillowSwamps extends RealisticBiomeBYGBase { @@ -121,62 +122,62 @@ else if (depth < 4) { public void initDecos() { DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 82; + decoBaseBiomeDecorations.setMaxY(82); this.addDeco(decoBaseBiomeDecorations); TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); - myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); - myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + myrtilloidesTree.setLogBlock(Blocks.LOG.getDefaultState()); + myrtilloidesTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.addTree(myrtilloidesTree); DecoTree decoTrees = new DecoTree(myrtilloidesTree); - decoTrees.distribution.noiseDivisor = 80f; - decoTrees.distribution.noiseFactor = 60f; - decoTrees.distribution.noiseAddend = -15f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoTrees.treeConditionNoise = 0f; - decoTrees.treeConditionChance = 16; - decoTrees.maxY = 70; + decoTrees.getDistribution().setNoiseDivisor(80f); + decoTrees.getDistribution().setNoiseFactor(60f); + decoTrees.getDistribution().setNoiseAddend(-15f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoTrees.setTreeConditionNoise(0f); + decoTrees.setTreeConditionChance(16); + decoTrees.setMaxY(70); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; - decoFallenTree.maxY = 76; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); + decoFallenTree.setMaxY(76); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); TreeRTG deadWillowTree = new TreeRTGSalixMyrtilloides(); - deadWillowTree.logBlock = Blocks.LOG.getDefaultState(); - deadWillowTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - deadWillowTree.noLeaves = true; + deadWillowTree.setLogBlock(Blocks.LOG.getDefaultState()); + deadWillowTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + deadWillowTree.setNoLeaves(true); this.addTree(deadWillowTree); DecoTree deadWillow = new DecoTree(deadWillowTree); - deadWillow.treeType = DecoTree.TreeType.RTG_TREE; - deadWillow.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - deadWillow.treeConditionChance = 18; - deadWillow.maxY = 84; + deadWillow.setTreeType(DecoTree.TreeType.RTG_TREE); + deadWillow.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + deadWillow.setTreeConditionChance(18); + deadWillow.setMaxY(84); this.addDeco(deadWillow); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 88; - decoShrub.strengthFactor = 6f; + decoShrub.setMaxY(88); + decoShrub.setStrengthFactor(6f); this.addDeco(decoShrub); DecoShrub decoShrubBYG = new DecoShrub(); - decoShrubBYG.logBlock = willowLogBlock; - decoShrubBYG.leavesBlock = willowLeavesBlock; - decoShrubBYG.maxY = 88; - decoShrubBYG.strengthFactor = 3f; + decoShrubBYG.setLogBlock(willowLogBlock); + decoShrubBYG.setLeavesBlock(willowLeavesBlock); + decoShrubBYG.setMaxY(88); + decoShrubBYG.setStrengthFactor(3f); this.addDeco(decoShrubBYG); } } diff --git a/src/main/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java b/src/main/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java index 5e84b405e..82b1bf9e5 100644 --- a/src/main/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java +++ b/src/main/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWAppleForest.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWAppleForest.java index a3fc8898f..196bd2dfc 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWAppleForest.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWAppleForest.java @@ -9,14 +9,15 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeMWAppleForest extends RealisticBiomeMWBase { @@ -164,38 +165,38 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.strengthFactor = 2f; - decoBoulder.chance = 24; - decoBoulder.maxY = 95; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setStrengthFactor(2f); + decoBoulder.setChance(24); + decoBoulder.setMaxY(95); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.distribution.noiseDivisor = 100f; - decoFallenTree1.distribution.noiseFactor = 6f; - decoFallenTree1.distribution.noiseAddend = 0.8f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree1.logConditionNoise = 0f; - decoFallenTree1.logConditionChance = 16; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = mwLogBlock; - decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 5; + decoFallenTree1.getDistribution().setNoiseDivisor(100f); + decoFallenTree1.getDistribution().setNoiseFactor(6f); + decoFallenTree1.getDistribution().setNoiseAddend(0.8f); + decoFallenTree1.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree1.setLogConditionNoise(0f); + decoFallenTree1.setLogConditionChance(16); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(mwLogBlock); + decoFallenTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(5); this.addDeco(decoFallenTree1, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 120; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(120); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 4; + decoBaseBiomeDecorations.setNotEqualsZeroChance(4); this.addDeco(decoBaseBiomeDecorations); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 20f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(20f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWArctic.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWArctic.java index 184b15266..e8599ce84 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWArctic.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWArctic.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWDeadForest.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWDeadForest.java index 1851e52e9..d6f61fd77 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWDeadForest.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWDeadForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBase; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; @@ -21,6 +21,7 @@ import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeMWDeadForest extends RealisticBiomeMWBase { @@ -172,39 +173,39 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 24; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(24); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree1 = new DecoFallenTree(); - decoFallenTree1.loops = 1; - decoFallenTree1.distribution.noiseDivisor = 100f; - decoFallenTree1.distribution.noiseFactor = 6f; - decoFallenTree1.distribution.noiseAddend = 0.8f; - decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree1.logConditionNoise = 0f; - decoFallenTree1.logConditionChance = 10; - decoFallenTree1.maxY = 100; - decoFallenTree1.logBlock = BlockUtil.getStateLog(1); - decoFallenTree1.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree1.minSize = 3; - decoFallenTree1.maxSize = 5; + decoFallenTree1.setLoops(1); + decoFallenTree1.getDistribution().setNoiseDivisor(100f); + decoFallenTree1.getDistribution().setNoiseFactor(6f); + decoFallenTree1.getDistribution().setNoiseAddend(0.8f); + decoFallenTree1.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree1.setLogConditionNoise(0f); + decoFallenTree1.setLogConditionChance(10); + decoFallenTree1.setMaxY(100); + decoFallenTree1.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree1.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree1.setMinSize(3); + decoFallenTree1.setMaxSize(5); DecoFallenTree decoFallenTree2 = new DecoFallenTree(); - decoFallenTree2.loops = 1; - decoFallenTree2.distribution.noiseDivisor = 100f; - decoFallenTree2.distribution.noiseFactor = 6f; - decoFallenTree2.distribution.noiseAddend = 0.8f; - decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree2.logConditionNoise = 0f; - decoFallenTree2.logConditionChance = 10; - decoFallenTree2.maxY = 100; - decoFallenTree2.logBlock = BlockUtil.getStateLog(3); - decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree2.minSize = 3; - decoFallenTree2.maxSize = 5; + decoFallenTree2.setLoops(1); + decoFallenTree2.getDistribution().setNoiseDivisor(100f); + decoFallenTree2.getDistribution().setNoiseFactor(6f); + decoFallenTree2.getDistribution().setNoiseAddend(0.8f); + decoFallenTree2.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree2.setLogConditionNoise(0f); + decoFallenTree2.setLogConditionChance(10); + decoFallenTree2.setMaxY(100); + decoFallenTree2.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree2.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree2.setMinSize(3); + decoFallenTree2.setMaxSize(5); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree2, decoFallenTree1}; diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWIceHills.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWIceHills.java index e9d31863f..540aa38ec 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWIceHills.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWIceHills.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWPalms.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWPalms.java index 530c65bac..ebad5e52c 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWPalms.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWPalms.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; @@ -153,7 +153,7 @@ else if (depth < 4) { public void initDecos() { DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.equalsZeroChance = 5; + decoBaseBiomeDecorations.setEqualsZeroChance(5); this.addDeco(decoBaseBiomeDecorations); } } diff --git a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWVolcano.java b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWVolcano.java index cb95aac3d..c1eeab857 100644 --- a/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWVolcano.java +++ b/src/main/java/rtg/world/biome/realistic/mineworld/RealisticBiomeMWVolcano.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java b/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java index 06ead579b..f15d92da7 100644 --- a/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java +++ b/src/main/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelper5050; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -22,6 +22,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeMFMithwoodForest extends RealisticBiomeMFBase { @@ -177,98 +178,98 @@ else if (cliff == 2) { public void initDecos() { TreeRTG megaMithwood = new TreeRTGPinusNigra(); - megaMithwood.logBlock = mithwoodLogBlock; - megaMithwood.leavesBlock = mithwoodLeavesBlock; - megaMithwood.minTrunkSize = 18; - megaMithwood.maxTrunkSize = 27; - megaMithwood.minCrownSize = 7; - megaMithwood.maxCrownSize = 10; + megaMithwood.setLogBlock(mithwoodLogBlock); + megaMithwood.setLeavesBlock(mithwoodLeavesBlock); + megaMithwood.setMinTrunkSize(18); + megaMithwood.setMaxTrunkSize(27); + megaMithwood.setMinCrownSize(7); + megaMithwood.setMaxCrownSize(10); this.addTree(megaMithwood); DecoTree RTGMithwood = new DecoTree(megaMithwood); - RTGMithwood.strengthFactorForLoops = 1f; - RTGMithwood.strengthNoiseFactorXForLoops = true; - RTGMithwood.distribution.noiseDivisor = 100f; - RTGMithwood.distribution.noiseFactor = 6f; - RTGMithwood.distribution.noiseAddend = 0.8f; - RTGMithwood.treeType = DecoTree.TreeType.RTG_TREE; - RTGMithwood.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - RTGMithwood.treeConditionChance = 12; - RTGMithwood.maxY = 100; + RTGMithwood.setStrengthFactorForLoops(1f); + RTGMithwood.setStrengthNoiseFactorXForLoops(true); + RTGMithwood.getDistribution().setNoiseDivisor(100f); + RTGMithwood.getDistribution().setNoiseFactor(6f); + RTGMithwood.getDistribution().setNoiseAddend(0.8f); + RTGMithwood.setTreeType(DecoTree.TreeType.RTG_TREE); + RTGMithwood.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + RTGMithwood.setTreeConditionChance(12); + RTGMithwood.setMaxY(100); this.addDeco(RTGMithwood); TreeRTG megaOak = new TreeRTGPinusNigra(); - megaOak.logBlock = Blocks.LOG.getDefaultState(); - megaOak.leavesBlock = Blocks.LEAVES.getDefaultState(); - megaOak.minTrunkSize = 18; - megaOak.maxTrunkSize = 27; - megaOak.minCrownSize = 7; - megaOak.maxCrownSize = 10; + megaOak.setLogBlock(Blocks.LOG.getDefaultState()); + megaOak.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + megaOak.setMinTrunkSize(18); + megaOak.setMaxTrunkSize(27); + megaOak.setMinCrownSize(7); + megaOak.setMaxCrownSize(10); this.addTree(megaOak); DecoTree RTGOak = new DecoTree(megaOak); - RTGOak.strengthFactorForLoops = 4f; - RTGOak.strengthNoiseFactorXForLoops = true; - RTGOak.distribution.noiseDivisor = 100f; - RTGOak.distribution.noiseFactor = 6f; - RTGOak.distribution.noiseAddend = 0.8f; - RTGOak.treeType = DecoTree.TreeType.RTG_TREE; - RTGOak.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - RTGOak.treeConditionChance = 12; - RTGOak.maxY = 100; + RTGOak.setStrengthFactorForLoops(4f); + RTGOak.setStrengthNoiseFactorXForLoops(true); + RTGOak.getDistribution().setNoiseDivisor(100f); + RTGOak.getDistribution().setNoiseFactor(6f); + RTGOak.getDistribution().setNoiseAddend(0.8f); + RTGOak.setTreeType(DecoTree.TreeType.RTG_TREE); + RTGOak.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + RTGOak.setTreeConditionChance(12); + RTGOak.setMaxY(100); this.addDeco(RTGOak); TreeRTG megaBirch = new TreeRTGBetulaPapyrifera(); - megaBirch.logBlock = BlockUtil.getStateLog(2); - megaBirch.leavesBlock = BlockUtil.getStateLeaf(2); - megaBirch.minTrunkSize = 4; - megaBirch.maxTrunkSize = 10; - megaBirch.minCrownSize = 8; - megaBirch.maxCrownSize = 19; + megaBirch.setLogBlock(BlockUtil.getStateLog(2)); + megaBirch.setLeavesBlock(BlockUtil.getStateLeaf(2)); + megaBirch.setMinTrunkSize(4); + megaBirch.setMaxTrunkSize(10); + megaBirch.setMinCrownSize(8); + megaBirch.setMaxCrownSize(19); this.addTree(megaBirch); DecoTree RTGBirch = new DecoTree(megaBirch); - RTGBirch.strengthFactorForLoops = 2f; - RTGBirch.treeType = DecoTree.TreeType.RTG_TREE; - RTGBirch.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - RTGBirch.treeConditionChance = 24; - RTGBirch.maxY = 100; + RTGBirch.setStrengthFactorForLoops(2f); + RTGBirch.setTreeType(DecoTree.TreeType.RTG_TREE); + RTGBirch.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + RTGBirch.setTreeConditionChance(24); + RTGBirch.setMaxY(100); this.addDeco(RTGBirch); TreeRTG megaSpruce = new TreeRTGPinusPonderosa(); - megaSpruce.logBlock = BlockUtil.getStateLog(1); - megaSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - megaSpruce.minTrunkSize = 11; - megaSpruce.maxTrunkSize = 21; - megaSpruce.minCrownSize = 15; - megaSpruce.maxCrownSize = 29; + megaSpruce.setLogBlock(BlockUtil.getStateLog(1)); + megaSpruce.setLeavesBlock(BlockUtil.getStateLeaf(1)); + megaSpruce.setMinTrunkSize(11); + megaSpruce.setMaxTrunkSize(21); + megaSpruce.setMinCrownSize(15); + megaSpruce.setMaxCrownSize(29); this.addTree(megaSpruce); DecoTree RTGSpruce = new DecoTree(megaSpruce); - RTGSpruce.strengthFactorForLoops = 2f; - RTGSpruce.strengthNoiseFactorForLoops = true; - RTGSpruce.treeType = DecoTree.TreeType.RTG_TREE; - RTGSpruce.distribution.noiseDivisor = 80f; - RTGSpruce.distribution.noiseFactor = 60f; - RTGSpruce.distribution.noiseAddend = -15f; - RTGSpruce.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - RTGSpruce.treeConditionNoise = 0f; - RTGSpruce.treeConditionChance = 24; - RTGSpruce.maxY = 140; + RTGSpruce.setStrengthFactorForLoops(2f); + RTGSpruce.setStrengthNoiseFactorForLoops(true); + RTGSpruce.setTreeType(DecoTree.TreeType.RTG_TREE); + RTGSpruce.getDistribution().setNoiseDivisor(80f); + RTGSpruce.getDistribution().setNoiseFactor(60f); + RTGSpruce.getDistribution().setNoiseAddend(-15f); + RTGSpruce.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + RTGSpruce.setTreeConditionNoise(0f); + RTGSpruce.setTreeConditionChance(24); + RTGSpruce.setMaxY(140); this.addDeco(RTGSpruce); DecoShrub decoShrubMithwood = new DecoShrub(); - decoShrubMithwood.logBlock = mithwoodLogBlock; - decoShrubMithwood.leavesBlock = mithwoodLeavesBlock; - decoShrubMithwood.maxY = 100; - decoShrubMithwood.strengthFactor = 1f; - decoShrubMithwood.chance = 2; + decoShrubMithwood.setLogBlock(mithwoodLogBlock); + decoShrubMithwood.setLeavesBlock(mithwoodLeavesBlock); + decoShrubMithwood.setMaxY(100); + decoShrubMithwood.setStrengthFactor(1f); + decoShrubMithwood.setChance(2); this.addDeco(decoShrubMithwood); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 4; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(4); this.addDeco(decoShrub); DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); @@ -285,63 +286,63 @@ public void initDecos() { this.addDeco(decoFlowers2); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 2; - decoBoulder.maxY = 100; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(2); + decoBoulder.setMaxY(100); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 100; - decoBaseBiomeDecorations.notEqualsZeroChance = 8; + decoBaseBiomeDecorations.setMaxY(100); + decoBaseBiomeDecorations.setNotEqualsZeroChance(8); this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenMithwoodTree = new DecoFallenTree(); - decoFallenMithwoodTree.distribution.noiseDivisor = 100f; - decoFallenMithwoodTree.distribution.noiseFactor = 6f; - decoFallenMithwoodTree.distribution.noiseAddend = 0.8f; - decoFallenMithwoodTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenMithwoodTree.logConditionNoise = 0f; - decoFallenMithwoodTree.logConditionChance = 24; - decoFallenMithwoodTree.logBlock = mithwoodLogBlock; - decoFallenMithwoodTree.leavesBlock = mithwoodLeavesBlock; - decoFallenMithwoodTree.minSize = 3; - decoFallenMithwoodTree.maxSize = 6; + decoFallenMithwoodTree.getDistribution().setNoiseDivisor(100f); + decoFallenMithwoodTree.getDistribution().setNoiseFactor(6f); + decoFallenMithwoodTree.getDistribution().setNoiseAddend(0.8f); + decoFallenMithwoodTree.setLogCondition(DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenMithwoodTree.setLogConditionNoise(0f); + decoFallenMithwoodTree.setLogConditionChance(24); + decoFallenMithwoodTree.setLogBlock(mithwoodLogBlock); + decoFallenMithwoodTree.setLeavesBlock(mithwoodLeavesBlock); + decoFallenMithwoodTree.setMinSize(3); + decoFallenMithwoodTree.setMaxSize(6); this.addDeco(decoFallenMithwoodTree, this.getConfig().ALLOW_LOGS.get()); DecoFallenTree decoFallenOak = new DecoFallenTree(); - decoFallenOak.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenOak.logConditionChance = 8; - decoFallenOak.maxY = 100; - decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); - decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenOak.minSize = 3; - decoFallenOak.maxSize = 6; + decoFallenOak.setLogCondition(RANDOM_CHANCE); + decoFallenOak.setLogConditionChance(8); + decoFallenOak.setMaxY(100); + decoFallenOak.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenOak.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenOak.setMinSize(3); + decoFallenOak.setMaxSize(6); this.addDeco(decoFallenOak, this.getConfig().ALLOW_LOGS.get()); DecoFallenTree decoFallenBirch = new DecoFallenTree(); - decoFallenBirch.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenBirch.logConditionChance = 8; - decoFallenBirch.maxY = 100; - decoFallenBirch.logBlock = BlockUtil.getStateLog(2); - decoFallenBirch.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenBirch.minSize = 3; - decoFallenBirch.maxSize = 6; + decoFallenBirch.setLogCondition(RANDOM_CHANCE); + decoFallenBirch.setLogConditionChance(8); + decoFallenBirch.setMaxY(100); + decoFallenBirch.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenBirch.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenBirch.setMinSize(3); + decoFallenBirch.setMaxSize(6); DecoFallenTree decoFallenSpruce = new DecoFallenTree(); - decoFallenSpruce.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenSpruce.logConditionChance = 8; - decoFallenSpruce.maxY = 100; - decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); - decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenSpruce.minSize = 3; - decoFallenSpruce.maxSize = 6; + decoFallenSpruce.setLogCondition(RANDOM_CHANCE); + decoFallenSpruce.setLogConditionChance(8); + decoFallenSpruce.setMaxY(100); + decoFallenSpruce.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenSpruce.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenSpruce.setMinSize(3); + decoFallenSpruce.setMaxSize(6); DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenBirch, decoFallenSpruce); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 24f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(24f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBlackPlain.java b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBlackPlain.java index f7a7ef844..b1b561882 100644 --- a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBlackPlain.java +++ b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBlackPlain.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; diff --git a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBog.java b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBog.java index 5bcb0b377..51a82290a 100644 --- a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBog.java +++ b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMBog.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightVariation; diff --git a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMLoessPlateau.java b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMLoessPlateau.java index 1c7e1f415..3cbb6f222 100644 --- a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMLoessPlateau.java +++ b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMLoessPlateau.java @@ -9,17 +9,18 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoShrub; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeMCMLoessPlateau extends RealisticBiomeMCMBase { @@ -200,31 +201,31 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.logBlock = BlockUtil.getStateLog(1); - decoShrub.leavesBlock = BlockUtil.getStateLeaf(1); - decoShrub.maxY = 90; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 12; + decoShrub.setLogBlock(BlockUtil.getStateLog(1)); + decoShrub.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoShrub.setMaxY(90); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(12); this.addDeco(decoShrub); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 30; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(30); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMMudFlat.java b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMMudFlat.java index 18abcfbbd..848eabe82 100644 --- a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMMudFlat.java +++ b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMMudFlat.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.HeightVariation; diff --git a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMWarmTaiga.java b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMWarmTaiga.java index dadb86f61..bb60cdbe9 100644 --- a/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMWarmTaiga.java +++ b/src/main/java/rtg/world/biome/realistic/morechinesemc/RealisticBiomeMCMWarmTaiga.java @@ -9,17 +9,18 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.biome.deco.DecoShrub; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeMCMWarmTaiga extends RealisticBiomeMCMBase { @@ -169,31 +170,31 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.logBlock = BlockUtil.getStateLog(1); - decoShrub.leavesBlock = BlockUtil.getStateLeaf(1); - decoShrub.maxY = 90; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 12; + decoShrub.setLogBlock(BlockUtil.getStateLog(1)); + decoShrub.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoShrub.setMaxY(90); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(12); this.addDeco(decoShrub); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 30; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(30); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); diff --git a/src/main/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java b/src/main/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java index 028f3dde0..5b52873f1 100644 --- a/src/main/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java +++ b/src/main/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java @@ -9,13 +9,14 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeSFSugiForest extends RealisticBiomeSFBase { @@ -165,49 +166,49 @@ else if (depth < 4) { public void initDecos() { DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = sugiLogBlock; - decoFallenTree.leavesBlock = sugiLeavesBlock; - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(sugiLogBlock); + decoFallenTree.setLeavesBlock(sugiLeavesBlock); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrubSugi = new DecoShrub(); - decoShrubSugi.logBlock = sugiLogBlock; - decoShrubSugi.leavesBlock = sugiLeavesBlock; - decoShrubSugi.maxY = 90; - decoShrubSugi.strengthFactor = 4f; - decoShrubSugi.chance = 8; + decoShrubSugi.setLogBlock(sugiLogBlock); + decoShrubSugi.setLeavesBlock(sugiLeavesBlock); + decoShrubSugi.setMaxY(90); + decoShrubSugi.setStrengthFactor(4f); + decoShrubSugi.setChance(8); this.addDeco(decoShrubSugi); DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.maxY = 90; - decoShrubOak.strengthFactor = 4f; - decoShrubOak.chance = 4; + decoShrubOak.setMaxY(90); + decoShrubOak.setStrengthFactor(4f); + decoShrubOak.setChance(4); this.addDeco(decoShrubOak); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 24; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(24); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.maxY = 105; - decoBaseBiomeDecorations.notEqualsZeroChance = 8; + decoBaseBiomeDecorations.setMaxY(105); + decoBaseBiomeDecorations.setNotEqualsZeroChance(8); this.addDeco(decoBaseBiomeDecorations); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 63; - decoGrass.maxY = 100; - decoGrass.loops = 1; + decoGrass.setMinY(63); + decoGrass.setMaxY(100); + decoGrass.setLoops(1); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java index 471f1b6ae..60b691174 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoTree; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGCocosNucifera; @@ -152,20 +152,20 @@ public void initDecos() { // Scattered palm trees. TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); - nuciferaTree.minTrunkSize = 7; - nuciferaTree.maxTrunkSize = 9; - nuciferaTree.minCrownSize = 6; - nuciferaTree.maxCrownSize = 8; - nuciferaTree.validGroundBlocks.clear(); - nuciferaTree.validGroundBlocks.add(Blocks.SAND.getDefaultState()); + nuciferaTree.setMinTrunkSize(7); + nuciferaTree.setMaxTrunkSize(9); + nuciferaTree.setMinCrownSize(6); + nuciferaTree.setMaxCrownSize(8); + nuciferaTree.getValidGroundBlocks().clear(); + nuciferaTree.getValidGroundBlocks().add(Blocks.SAND.getDefaultState()); this.addTree(nuciferaTree); DecoTree palmTrees = new DecoTree(nuciferaTree); - palmTrees.treeType = DecoTree.TreeType.RTG_TREE; - palmTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - palmTrees.treeConditionNoise = -0.2f; - palmTrees.treeConditionChance = 12; - palmTrees.maxY = 68; + palmTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + palmTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + palmTrees.setTreeConditionNoise(-0.2f); + palmTrees.setTreeConditionChance(12); + palmTrees.setMaxY(68); this.addDeco(palmTrees, this.getConfig().ALLOW_PALM_TREES.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java index dae909e37..ae13755a0 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -22,6 +22,7 @@ import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeVanillaBirchForest extends RealisticBiomeVanillaBase { @@ -174,44 +175,44 @@ else if (cliff == 2) { public void initDecos() { TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); - birchSmall.logBlock = BlockUtil.getStateLog(2); - birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); - birchSmall.minTrunkSize = 4; - birchSmall.maxTrunkSize = 10; - birchSmall.minCrownSize = 8; - birchSmall.maxCrownSize = 19; + birchSmall.setLogBlock(BlockUtil.getStateLog(2)); + birchSmall.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchSmall.setMinTrunkSize(4); + birchSmall.setMaxTrunkSize(10); + birchSmall.setMinCrownSize(8); + birchSmall.setMaxCrownSize(19); this.addTree(birchSmall); DecoTree smallBirch = new DecoTree(birchSmall); - smallBirch.strengthNoiseFactorForLoops = true; - smallBirch.treeType = DecoTree.TreeType.RTG_TREE; - smallBirch.distribution.noiseDivisor = 80f; - smallBirch.distribution.noiseFactor = 60f; - smallBirch.distribution.noiseAddend = -15f; - smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - smallBirch.maxY = 120; + smallBirch.setStrengthNoiseFactorForLoops(true); + smallBirch.setTreeType(DecoTree.TreeType.RTG_TREE); + smallBirch.getDistribution().setNoiseDivisor(80f); + smallBirch.getDistribution().setNoiseFactor(60f); + smallBirch.getDistribution().setNoiseAddend(-15f); + smallBirch.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + smallBirch.setMaxY(120); this.addDeco(smallBirch); TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); - birchTree.logBlock = BlockUtil.getStateLog(2); - birchTree.leavesBlock = BlockUtil.getStateLeaf(2); - birchTree.minTrunkSize = 4; - birchTree.maxTrunkSize = 10; - birchTree.minCrownSize = 8; - birchTree.maxCrownSize = 19; + birchTree.setLogBlock(BlockUtil.getStateLog(2)); + birchTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchTree.setMinTrunkSize(4); + birchTree.setMaxTrunkSize(10); + birchTree.setMinCrownSize(8); + birchTree.setMaxCrownSize(19); this.addTree(birchTree); DecoTree birchTrees = new DecoTree(birchTree); - birchTrees.strengthFactorForLoops = 3f; - birchTrees.treeType = DecoTree.TreeType.RTG_TREE; - birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - birchTrees.maxY = 100; + birchTrees.setStrengthFactorForLoops(3f); + birchTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + birchTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + birchTrees.setMaxY(100); DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); - rtgTrees.treeType = DecoTree.TreeType.WORLDGEN; - rtgTrees.strengthFactorForLoops = 3f; - rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - rtgTrees.maxY = 100; + rtgTrees.setTreeType(DecoTree.TreeType.WORLDGEN); + rtgTrees.setStrengthFactorForLoops(3f); + rtgTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + rtgTrees.setMaxY(100); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; @@ -219,21 +220,21 @@ public void initDecos() { this.addDeco(decoHelperRandomSplit); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 8; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(8); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 120; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(120); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 3; + decoBaseBiomeDecorations.setNotEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); @@ -243,8 +244,8 @@ public void initDecos() { this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 20f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(20f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java index 20b782a45..f13e3c748 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java @@ -10,17 +10,18 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeVanillaBirchForestHills extends RealisticBiomeVanillaBase { @@ -180,44 +181,44 @@ else if (cliff == 2) { public void initDecos() { TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); - birchSmall.logBlock = BlockUtil.getStateLog(2); - birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); - birchSmall.minTrunkSize = 4; - birchSmall.maxTrunkSize = 10; - birchSmall.minCrownSize = 8; - birchSmall.maxCrownSize = 19; + birchSmall.setLogBlock(BlockUtil.getStateLog(2)); + birchSmall.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchSmall.setMinTrunkSize(4); + birchSmall.setMaxTrunkSize(10); + birchSmall.setMinCrownSize(8); + birchSmall.setMaxCrownSize(19); this.addTree(birchSmall); DecoTree smallBirch = new DecoTree(birchSmall); - smallBirch.strengthNoiseFactorForLoops = true; - smallBirch.treeType = DecoTree.TreeType.RTG_TREE; - smallBirch.distribution.noiseDivisor = 80f; - smallBirch.distribution.noiseFactor = 60f; - smallBirch.distribution.noiseAddend = -15f; - smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - smallBirch.maxY = 120; + smallBirch.setStrengthNoiseFactorForLoops(true); + smallBirch.setTreeType(DecoTree.TreeType.RTG_TREE); + smallBirch.getDistribution().setNoiseDivisor(80f); + smallBirch.getDistribution().setNoiseFactor(60f); + smallBirch.getDistribution().setNoiseAddend(-15f); + smallBirch.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + smallBirch.setMaxY(120); this.addDeco(smallBirch); TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); - birchTree.logBlock = BlockUtil.getStateLog(2); - birchTree.leavesBlock = BlockUtil.getStateLeaf(2); - birchTree.minTrunkSize = 4; - birchTree.maxTrunkSize = 10; - birchTree.minCrownSize = 8; - birchTree.maxCrownSize = 19; + birchTree.setLogBlock(BlockUtil.getStateLog(2)); + birchTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchTree.setMinTrunkSize(4); + birchTree.setMaxTrunkSize(10); + birchTree.setMinCrownSize(8); + birchTree.setMaxCrownSize(19); this.addTree(birchTree); DecoTree birchTrees = new DecoTree(birchTree); - birchTrees.strengthFactorForLoops = 3f; - birchTrees.treeType = DecoTree.TreeType.RTG_TREE; - birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - birchTrees.maxY = 100; + birchTrees.setStrengthFactorForLoops(3f); + birchTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + birchTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + birchTrees.setMaxY(100); DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); - rtgTrees.treeType = DecoTree.TreeType.WORLDGEN; - rtgTrees.strengthFactorForLoops = 3f; - rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - rtgTrees.maxY = 100; + rtgTrees.setTreeType(DecoTree.TreeType.WORLDGEN); + rtgTrees.setStrengthFactorForLoops(3f); + rtgTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + rtgTrees.setMaxY(100); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; @@ -225,21 +226,21 @@ public void initDecos() { this.addDeco(decoHelperRandomSplit); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 8; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(8); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 120; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(120); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 3; + decoBaseBiomeDecorations.setNotEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); @@ -249,8 +250,8 @@ public void initDecos() { this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 20f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(20f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java index cf91395c1..61b23b7e6 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java @@ -10,16 +10,17 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperRandomSplit; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeVanillaBirchForestHillsM extends RealisticBiomeVanillaBase { @@ -120,44 +121,44 @@ else if (depth < 4) { public void initDecos() { TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); - birchSmall.logBlock = BlockUtil.getStateLog(2); - birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); - birchSmall.minTrunkSize = 4; - birchSmall.maxTrunkSize = 10; - birchSmall.minCrownSize = 8; - birchSmall.maxCrownSize = 19; + birchSmall.setLogBlock(BlockUtil.getStateLog(2)); + birchSmall.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchSmall.setMinTrunkSize(4); + birchSmall.setMaxTrunkSize(10); + birchSmall.setMinCrownSize(8); + birchSmall.setMaxCrownSize(19); this.addTree(birchSmall); DecoTree smallBirch = new DecoTree(birchSmall); - smallBirch.strengthNoiseFactorForLoops = true; - smallBirch.treeType = DecoTree.TreeType.RTG_TREE; - smallBirch.distribution.noiseDivisor = 80f; - smallBirch.distribution.noiseFactor = 60f; - smallBirch.distribution.noiseAddend = -15f; - smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - smallBirch.maxY = 120; + smallBirch.setStrengthNoiseFactorForLoops(true); + smallBirch.setTreeType(DecoTree.TreeType.RTG_TREE); + smallBirch.getDistribution().setNoiseDivisor(80f); + smallBirch.getDistribution().setNoiseFactor(60f); + smallBirch.getDistribution().setNoiseAddend(-15f); + smallBirch.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + smallBirch.setMaxY(120); this.addDeco(smallBirch); TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); - birchTree.logBlock = BlockUtil.getStateLog(2); - birchTree.leavesBlock = BlockUtil.getStateLeaf(2); - birchTree.minTrunkSize = 4; - birchTree.maxTrunkSize = 10; - birchTree.minCrownSize = 8; - birchTree.maxCrownSize = 19; + birchTree.setLogBlock(BlockUtil.getStateLog(2)); + birchTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + birchTree.setMinTrunkSize(4); + birchTree.setMaxTrunkSize(10); + birchTree.setMinCrownSize(8); + birchTree.setMaxCrownSize(19); this.addTree(birchTree); DecoTree birchTrees = new DecoTree(birchTree); - birchTrees.strengthFactorForLoops = 3f; - birchTrees.treeType = DecoTree.TreeType.RTG_TREE; - birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - birchTrees.maxY = 100; + birchTrees.setStrengthFactorForLoops(3f); + birchTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + birchTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + birchTrees.setMaxY(100); DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); - rtgTrees.treeType = DecoTree.TreeType.WORLDGEN; - rtgTrees.strengthFactorForLoops = 3f; - rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - rtgTrees.maxY = 100; + rtgTrees.setTreeType(DecoTree.TreeType.WORLDGEN); + rtgTrees.setStrengthFactorForLoops(3f); + rtgTrees.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + rtgTrees.setMaxY(100); DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; @@ -165,21 +166,21 @@ public void initDecos() { this.addDeco(decoHelperRandomSplit); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 8; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(8); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 120; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(120); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 3; + decoBaseBiomeDecorations.setNotEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); @@ -189,8 +190,8 @@ public void initDecos() { this.addDeco(decoFlowersRTG); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 20f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(20f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java index 267d1429c..f1bf0a7a1 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java @@ -9,16 +9,17 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeVanillaBirchForestM extends RealisticBiomeVanillaBase { @@ -170,47 +171,47 @@ else if (cliff == 2) { public void initDecos() { TreeRTG tallBirch = new TreeRTGBetulaPapyrifera(); - tallBirch.logBlock = BlockUtil.getStateLog(2); - tallBirch.leavesBlock = BlockUtil.getStateLeaf(2); - tallBirch.minTrunkSize = 16; - tallBirch.maxTrunkSize = 23; - tallBirch.minCrownSize = 4; - tallBirch.maxCrownSize = 11; + tallBirch.setLogBlock(BlockUtil.getStateLog(2)); + tallBirch.setLeavesBlock(BlockUtil.getStateLeaf(2)); + tallBirch.setMinTrunkSize(16); + tallBirch.setMaxTrunkSize(23); + tallBirch.setMinCrownSize(4); + tallBirch.setMaxCrownSize(11); this.addTree(tallBirch); DecoTree superTallBirch = new DecoTree(tallBirch); - superTallBirch.strengthFactorForLoops = 16f; - superTallBirch.strengthNoiseFactorForLoops = true; - superTallBirch.treeType = DecoTree.TreeType.RTG_TREE; - superTallBirch.distribution.noiseDivisor = 80f; - superTallBirch.distribution.noiseFactor = 60f; - superTallBirch.distribution.noiseAddend = -15f; - superTallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - superTallBirch.maxY = 100; + superTallBirch.setStrengthFactorForLoops(16f); + superTallBirch.setStrengthNoiseFactorForLoops(true); + superTallBirch.setTreeType(DecoTree.TreeType.RTG_TREE); + superTallBirch.getDistribution().setNoiseDivisor(80f); + superTallBirch.getDistribution().setNoiseFactor(60f); + superTallBirch.getDistribution().setNoiseAddend(-15f); + superTallBirch.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + superTallBirch.setMaxY(100); this.addDeco(superTallBirch); DecoLargeFernDoubleTallgrass decoDoublePlants = new DecoLargeFernDoubleTallgrass(); - decoDoublePlants.maxY = 128; - decoDoublePlants.strengthFactor = 8f; + decoDoublePlants.setMaxY(128); + decoDoublePlants.setStrengthFactor(8f); this.addDeco(decoDoublePlants); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 24f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(24f); this.addDeco(decoGrass); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenTree.logConditionChance = 20; - decoFallenTree.logBlock = BlockUtil.getStateLog(2); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLogCondition(RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(20); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(2)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(2)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 2f; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(2f); this.addDeco(decoShrub); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java index 41bbcf5a0..5573d780a 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBoulder; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; @@ -144,10 +144,10 @@ else if (!dirt) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 3f; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(3f); this.addDeco(decoBoulder); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java index 42c7d5203..2da9b9775 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java index 3e8ce5274..fabdf536c 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java index 1d0c3bd9a..e7e625db2 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java @@ -9,9 +9,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java index 6d7eff531..46e6cd90a 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java @@ -9,9 +9,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java index 693cc8f4e..06363da18 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java @@ -9,9 +9,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.collection.DecoCollectionDesert; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java index ff3f76a30..4312fa5e6 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionDesert; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java index 376a7d613..5847de551 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionDesert; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java index 823f5fcec..8d7578068 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaExtremeHills extends RealisticBiomeVanillaBase { @@ -161,67 +162,67 @@ else if (depth < 4) { public void initDecos() { TreeRTG nigraTree = new TreeRTGPinusNigra(); - nigraTree.logBlock = Blocks.LOG.getDefaultState(); - nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - nigraTree.minTrunkSize = 18; - nigraTree.maxTrunkSize = 27; - nigraTree.minCrownSize = 7; - nigraTree.maxCrownSize = 10; + nigraTree.setLogBlock(Blocks.LOG.getDefaultState()); + nigraTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + nigraTree.setMinTrunkSize(18); + nigraTree.setMaxTrunkSize(27); + nigraTree.setMinCrownSize(7); + nigraTree.setMaxCrownSize(10); this.addTree(nigraTree); DecoTree decoTrees = new DecoTree(nigraTree); - decoTrees.strengthFactorForLoops = 4f; - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.distribution.noiseDivisor = 100f; - decoTrees.distribution.noiseFactor = 6f; - decoTrees.distribution.noiseAddend = 0.8f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 24; - decoTrees.maxY = 100; + decoTrees.setStrengthFactorForLoops(4f); + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.getDistribution().setNoiseDivisor(100f); + decoTrees.getDistribution().setNoiseFactor(6f); + decoTrees.getDistribution().setNoiseAddend(0.8f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(24); + decoTrees.setMaxY(100); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); - decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 7; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(7); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 4; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(4); this.addDeco(decoShrub); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 12; - decoBoulder.maxY = 90; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(12); + decoBoulder.setMaxY(90); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 3f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(3f); this.addDeco(decoMushrooms); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 30f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(30f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java index 5045c5c89..1bc1ba13c 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java @@ -9,16 +9,17 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaExtremeHillsEdge extends RealisticBiomeVanillaBase { @@ -163,66 +164,66 @@ else if (depth < 4) { public void initDecos() { TreeRTG nigraTree = new TreeRTGPinusNigra(); - nigraTree.logBlock = Blocks.LOG.getDefaultState(); - nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - nigraTree.minTrunkSize = 18; - nigraTree.maxTrunkSize = 27; - nigraTree.minCrownSize = 7; - nigraTree.maxCrownSize = 10; + nigraTree.setLogBlock(Blocks.LOG.getDefaultState()); + nigraTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + nigraTree.setMinTrunkSize(18); + nigraTree.setMaxTrunkSize(27); + nigraTree.setMinCrownSize(7); + nigraTree.setMaxCrownSize(10); this.addTree(nigraTree); DecoTree decoTrees = new DecoTree(nigraTree); - decoTrees.strengthFactorForLoops = 4f; - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.distribution.noiseDivisor = 100f; - decoTrees.distribution.noiseFactor = 6f; - decoTrees.distribution.noiseAddend = 0.8f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 24; - decoTrees.maxY = 100; + decoTrees.setStrengthFactorForLoops(4f); + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.getDistribution().setNoiseDivisor(100f); + decoTrees.getDistribution().setNoiseFactor(6f); + decoTrees.getDistribution().setNoiseAddend(0.8f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(24); + decoTrees.setMaxY(100); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); this.addDeco(decoShrub); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 12; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(12); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 3f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(3f); this.addDeco(decoMushrooms); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 20f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(20f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java index 4cc67dbb0..00098ca22 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java index 5221e05c4..f9ad1af51 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; @@ -22,6 +22,7 @@ import rtg.world.gen.terrain.JitterEffect; import rtg.world.gen.terrain.MountainsWithPassesEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaExtremeHillsPlus extends RealisticBiomeVanillaBase { @@ -194,55 +195,55 @@ else if (cliff == 2) { public void initDecos() { TreeRTG nigraTree = new TreeRTGPinusNigra(); - nigraTree.logBlock = Blocks.LOG.getDefaultState(); - nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - nigraTree.minTrunkSize = 18; - nigraTree.maxTrunkSize = 27; - nigraTree.minCrownSize = 7; - nigraTree.maxCrownSize = 10; + nigraTree.setLogBlock(Blocks.LOG.getDefaultState()); + nigraTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + nigraTree.setMinTrunkSize(18); + nigraTree.setMaxTrunkSize(27); + nigraTree.setMinCrownSize(7); + nigraTree.setMaxCrownSize(10); this.addTree(nigraTree); DecoTree decoTrees = new DecoTree(nigraTree); - decoTrees.strengthFactorForLoops = 4f; - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.distribution.noiseDivisor = 100f; - decoTrees.distribution.noiseFactor = 6f; - decoTrees.distribution.noiseAddend = 0.8f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 24; - decoTrees.maxY = 100; + decoTrees.setStrengthFactorForLoops(4f); + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.getDistribution().setNoiseDivisor(100f); + decoTrees.getDistribution().setNoiseFactor(6f); + decoTrees.getDistribution().setNoiseAddend(0.8f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(24); + decoTrees.setMaxY(100); this.addDeco(decoTrees); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); this.addDeco(decoShrub); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 12; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(12); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.USE_CHANCE_VALUE; - decoPumpkin.chance = 28; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.USE_CHANCE_VALUE); + decoPumpkin.setChance(28); this.addDeco(decoPumpkin); DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); @@ -252,9 +253,9 @@ public void initDecos() { this.addDeco(decoFlowersRTG); DecoLargeFernDoubleTallgrass decoDoublePlants = new DecoLargeFernDoubleTallgrass(); - decoDoublePlants.maxY = 128; + decoDoublePlants.setMaxY(128); decoDoublePlants.fernChance = 3; - decoDoublePlants.loops = 15; + decoDoublePlants.setLoops(15); this.addDeco(decoDoublePlants); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java index 0f627f76d..181b75508 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java index 234259787..1d81f0793 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionSmallPineTreesForest; import rtg.world.biome.deco.helper.DecoHelper5050; @@ -21,6 +21,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.RANDOM_CHANCE; public class RealisticBiomeVanillaFlowerForest extends RealisticBiomeVanillaBase { @@ -171,9 +172,9 @@ public void initDecos() { // First, let's get a few shrubs in to break things up a bit. DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 4f; - decoShrub.chance = 3; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(4f); + decoShrub.setChance(3); this.addDeco(decoShrub); // Flowers are the most aesthetically important feature of this biome, so let's add those next. @@ -193,44 +194,44 @@ public void initDecos() { // Trees first. TreeRTG ponderosaOakTree = new TreeRTGPinusPonderosa(); - ponderosaOakTree.logBlock = Blocks.LOG.getDefaultState(); - ponderosaOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaOakTree.minTrunkSize = 11; - ponderosaOakTree.maxTrunkSize = 21; - ponderosaOakTree.minCrownSize = 15; - ponderosaOakTree.maxCrownSize = 29; + ponderosaOakTree.setLogBlock(Blocks.LOG.getDefaultState()); + ponderosaOakTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + ponderosaOakTree.setMinTrunkSize(11); + ponderosaOakTree.setMaxTrunkSize(21); + ponderosaOakTree.setMinCrownSize(15); + ponderosaOakTree.setMaxCrownSize(29); this.addTree(ponderosaOakTree); DecoTree oakPines = new DecoTree(ponderosaOakTree); - oakPines.strengthNoiseFactorForLoops = true; - oakPines.treeType = DecoTree.TreeType.RTG_TREE; - oakPines.distribution.noiseDivisor = 80f; - oakPines.distribution.noiseFactor = 60f; - oakPines.distribution.noiseAddend = -15f; - oakPines.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - oakPines.treeConditionNoise = 0f; - oakPines.treeConditionChance = 1; - oakPines.maxY = 140; + oakPines.setStrengthNoiseFactorForLoops(true); + oakPines.setTreeType(DecoTree.TreeType.RTG_TREE); + oakPines.getDistribution().setNoiseDivisor(80f); + oakPines.getDistribution().setNoiseFactor(60f); + oakPines.getDistribution().setNoiseAddend(-15f); + oakPines.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + oakPines.setTreeConditionNoise(0f); + oakPines.setTreeConditionChance(1); + oakPines.setMaxY(140); TreeRTG ponderosaSpruceTree = new TreeRTGPinusPonderosa(); - ponderosaSpruceTree.logBlock = BlockUtil.getStateLog(1); - ponderosaSpruceTree.leavesBlock = BlockUtil.getStateLeaf(1); - ponderosaSpruceTree.minTrunkSize = 11; - ponderosaSpruceTree.maxTrunkSize = 21; - ponderosaSpruceTree.minCrownSize = 15; - ponderosaSpruceTree.maxCrownSize = 29; + ponderosaSpruceTree.setLogBlock(BlockUtil.getStateLog(1)); + ponderosaSpruceTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + ponderosaSpruceTree.setMinTrunkSize(11); + ponderosaSpruceTree.setMaxTrunkSize(21); + ponderosaSpruceTree.setMinCrownSize(15); + ponderosaSpruceTree.setMaxCrownSize(29); this.addTree(ponderosaSpruceTree); DecoTree sprucePines = new DecoTree(ponderosaSpruceTree); - sprucePines.strengthNoiseFactorForLoops = true; - sprucePines.treeType = DecoTree.TreeType.RTG_TREE; - sprucePines.distribution.noiseDivisor = 80f; - sprucePines.distribution.noiseFactor = 60f; - sprucePines.distribution.noiseAddend = -15f; - sprucePines.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; - sprucePines.treeConditionNoise = 0f; - sprucePines.treeConditionChance = 1; - sprucePines.maxY = 140; + sprucePines.setStrengthNoiseFactorForLoops(true); + sprucePines.setTreeType(DecoTree.TreeType.RTG_TREE); + sprucePines.getDistribution().setNoiseDivisor(80f); + sprucePines.getDistribution().setNoiseFactor(60f); + sprucePines.getDistribution().setNoiseAddend(-15f); + sprucePines.setTreeCondition(DecoTree.TreeCondition.ALWAYS_GENERATE); + sprucePines.setTreeConditionNoise(0f); + sprucePines.setTreeConditionChance(1); + sprucePines.setMaxY(140); DecoHelper5050 decoPines = new DecoHelper5050(oakPines, sprucePines); this.addDeco(decoPines); @@ -240,33 +241,33 @@ public void initDecos() { // Not much free space left, so let's give some space to the base biome. DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 4; + decoBaseBiomeDecorations.setNotEqualsZeroChance(4); this.addDeco(decoBaseBiomeDecorations); // Add some fallen trees of the oak and spruce variety (50/50 distribution). DecoFallenTree decoFallenOak = new DecoFallenTree(); - decoFallenOak.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenOak.logConditionChance = 8; - decoFallenOak.maxY = 100; - decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); - decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoFallenOak.minSize = 3; - decoFallenOak.maxSize = 6; + decoFallenOak.setLogCondition(RANDOM_CHANCE); + decoFallenOak.setLogConditionChance(8); + decoFallenOak.setMaxY(100); + decoFallenOak.setLogBlock(Blocks.LOG.getDefaultState()); + decoFallenOak.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoFallenOak.setMinSize(3); + decoFallenOak.setMaxSize(6); DecoFallenTree decoFallenSpruce = new DecoFallenTree(); - decoFallenSpruce.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; - decoFallenSpruce.logConditionChance = 8; - decoFallenSpruce.maxY = 100; - decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); - decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenSpruce.minSize = 3; - decoFallenSpruce.maxSize = 6; + decoFallenSpruce.setLogCondition(RANDOM_CHANCE); + decoFallenSpruce.setLogConditionChance(8); + decoFallenSpruce.setMaxY(100); + decoFallenSpruce.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenSpruce.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenSpruce.setMinSize(3); + decoFallenSpruce.setMaxSize(6); DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenOak, decoFallenSpruce); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 24f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(24f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java index f0e794223..8b78a888c 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionForest; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java index 6bb827c56..8e16dc051 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionForest; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java index a5c62df74..fb6a54d23 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java index 2d31892b6..9923ae2dd 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java @@ -8,9 +8,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java index ccc5497a2..3ea84d460 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java index 0d805d041..d41e68014 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaIcePlains extends RealisticBiomeVanillaBase { @@ -122,21 +123,21 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.checkRiver = true; - decoBoulder.minRiver = 0.87f; - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 5f; + decoBoulder.setCheckRiver(true); + decoBoulder.setMinRiver(0.87f); + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(5f); this.addDeco(decoBoulder); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionChance = 24; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 1; - decoFallenTree.maxSize = 5; + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(24); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(1); + decoFallenTree.setMaxSize(5); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java index cae196fd9..76bbde613 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java @@ -9,9 +9,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java index 200ea4d6c..18fc3b77d 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperThisOrThat; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -22,6 +22,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaJungle extends RealisticBiomeVanillaBase { @@ -179,33 +180,33 @@ public void initDecos() { // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); - mucronataTree.logBlock = BlockUtil.getStateLog(3); - mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); - mucronataTree.minTrunkSize = 3; - mucronataTree.maxTrunkSize = 4; - mucronataTree.minCrownSize = 10; - mucronataTree.maxCrownSize = 27; + mucronataTree.setLogBlock(BlockUtil.getStateLog(3)); + mucronataTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + mucronataTree.setMinTrunkSize(3); + mucronataTree.setMaxTrunkSize(4); + mucronataTree.setMinCrownSize(10); + mucronataTree.setMaxCrownSize(27); this.addTree(mucronataTree); DecoTree mangroves = new DecoTree(new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f)); - mangroves.loops = 3; - mangroves.treeType = DecoTree.TreeType.RTG_TREE; - mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - mangroves.treeConditionChance = 2; - mangroves.maxY = 160; + mangroves.setLoops(3); + mangroves.setTreeType(DecoTree.TreeType.RTG_TREE); + mangroves.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + mangroves.setTreeConditionChance(2); + mangroves.setMaxY(160); DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); - megaJungle.logBlock = BlockUtil.getStateLog(3); - megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); - megaJungle.minTrunkSize = 3; - megaJungle.maxTrunkSize = 4; - megaJungle.minCrownSize = 10; - megaJungle.maxCrownSize = 27; - megaJungle.loops = 3; - megaJungle.treeType = DecoTree.TreeType.WORLDGEN; - megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - megaJungle.treeConditionChance = 2; - megaJungle.maxY = 160; + megaJungle.setLogBlock(BlockUtil.getStateLog(3)); + megaJungle.setLeavesBlock(BlockUtil.getStateLeaf(3)); + megaJungle.setMinTrunkSize(3); + megaJungle.setMaxTrunkSize(4); + megaJungle.setMinCrownSize(10); + megaJungle.setMaxCrownSize(27); + megaJungle.setLoops(3); + megaJungle.setTreeType(DecoTree.TreeType.WORLDGEN); + megaJungle.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + megaJungle.setTreeConditionChance(2); + megaJungle.setMaxY(160); DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); this.addDeco(decoHelperThisOrThat); @@ -213,18 +214,18 @@ public void initDecos() { // Add some palm trees for variety. TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); - nuciferaTree.minTrunkSize = 7; - nuciferaTree.maxTrunkSize = 9; - nuciferaTree.minCrownSize = 6; - nuciferaTree.maxCrownSize = 8; + nuciferaTree.setMinTrunkSize(7); + nuciferaTree.setMaxTrunkSize(9); + nuciferaTree.setMinCrownSize(6); + nuciferaTree.setMaxCrownSize(8); this.addTree(nuciferaTree); DecoTree palmCustom = new DecoTree(nuciferaTree); - palmCustom.loops = 1; - palmCustom.treeType = DecoTree.TreeType.RTG_TREE; - palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - palmCustom.treeConditionChance = 3; - palmCustom.maxY = 160; + palmCustom.setLoops(1); + palmCustom.setTreeType(DecoTree.TreeType.RTG_TREE); + palmCustom.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + palmCustom.setTreeConditionChance(3); + palmCustom.setMaxY(160); this.addDeco(palmCustom); // Another pass of the WorldGenMegaJungle collection for extra jungleness. @@ -232,23 +233,23 @@ public void initDecos() { // Jungle logs. DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 5f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 3; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 9; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(5f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(3); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 6; - decoBaseBiomeDecorations.loops = 1; + decoBaseBiomeDecorations.setNotEqualsZeroChance(6); + decoBaseBiomeDecorations.setLoops(1); this.addDeco(decoBaseBiomeDecorations); // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) @@ -269,25 +270,25 @@ public void initDecos() { // Tall cacti on red sand - matches the colour scheme nicely. DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); - decoJungleCacti.strengthFactor = 8f; - decoJungleCacti.maxY = 120; - decoJungleCacti.sandOnly = false; - decoJungleCacti.extraHeight = 7; - decoJungleCacti.sandMeta = (byte) 1; + decoJungleCacti.setStrengthFactor(8f); + decoJungleCacti.setMaxY(120); + decoJungleCacti.setSandOnly(false); + decoJungleCacti.setExtraHeight(7); + decoJungleCacti.setSandMeta((byte) 1); this.addDeco(decoJungleCacti, this.getConfig().ALLOW_CACTUS.get()); // Mossy boulders for the green. DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java index 578d3eacf..1ea85b0ce 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaJungleEdge extends RealisticBiomeVanillaBase { @@ -122,17 +123,17 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java index cb108491c..583be352a 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java @@ -9,14 +9,15 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaJungleEdgeM extends RealisticBiomeVanillaBase { @@ -119,17 +120,17 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java index 74a50b049..74ad34816 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperThisOrThat; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -22,6 +22,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaJungleHills extends RealisticBiomeVanillaBase { @@ -175,33 +176,33 @@ public void initDecos() { // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); - mucronataTree.logBlock = BlockUtil.getStateLog(3); - mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); - mucronataTree.minTrunkSize = 3; - mucronataTree.maxTrunkSize = 4; - mucronataTree.minCrownSize = 10; - mucronataTree.maxCrownSize = 27; + mucronataTree.setLogBlock(BlockUtil.getStateLog(3)); + mucronataTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + mucronataTree.setMinTrunkSize(3); + mucronataTree.setMaxTrunkSize(4); + mucronataTree.setMinCrownSize(10); + mucronataTree.setMaxCrownSize(27); this.addTree(mucronataTree); DecoTree mangroves = new DecoTree(mucronataTree); - mangroves.loops = 3; - mangroves.treeType = DecoTree.TreeType.RTG_TREE; - mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - mangroves.treeConditionChance = 2; - mangroves.maxY = 160; + mangroves.setLoops(3); + mangroves.setTreeType(DecoTree.TreeType.RTG_TREE); + mangroves.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + mangroves.setTreeConditionChance(2); + mangroves.setMaxY(160); DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); - megaJungle.logBlock = BlockUtil.getStateLog(3); - megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); - megaJungle.minTrunkSize = 3; - megaJungle.maxTrunkSize = 4; - megaJungle.minCrownSize = 10; - megaJungle.maxCrownSize = 27; - megaJungle.loops = 3; - megaJungle.treeType = DecoTree.TreeType.WORLDGEN; - megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - megaJungle.treeConditionChance = 2; - megaJungle.maxY = 160; + megaJungle.setLogBlock(BlockUtil.getStateLog(3)); + megaJungle.setLeavesBlock(BlockUtil.getStateLeaf(3)); + megaJungle.setMinTrunkSize(3); + megaJungle.setMaxTrunkSize(4); + megaJungle.setMinCrownSize(10); + megaJungle.setMaxCrownSize(27); + megaJungle.setLoops(3); + megaJungle.setTreeType(DecoTree.TreeType.WORLDGEN); + megaJungle.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + megaJungle.setTreeConditionChance(2); + megaJungle.setMaxY(160); DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); this.addDeco(decoHelperThisOrThat); @@ -209,18 +210,18 @@ public void initDecos() { // Add some palm trees for variety. TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); - nuciferaTree.minTrunkSize = 7; - nuciferaTree.maxTrunkSize = 9; - nuciferaTree.minCrownSize = 6; - nuciferaTree.maxCrownSize = 8; + nuciferaTree.setMinTrunkSize(7); + nuciferaTree.setMaxTrunkSize(9); + nuciferaTree.setMinCrownSize(6); + nuciferaTree.setMaxCrownSize(8); this.addTree(nuciferaTree); DecoTree palmCustom = new DecoTree(nuciferaTree); - palmCustom.loops = 1; - palmCustom.treeType = DecoTree.TreeType.RTG_TREE; - palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - palmCustom.treeConditionChance = 3; - palmCustom.maxY = 160; + palmCustom.setLoops(1); + palmCustom.setTreeType(DecoTree.TreeType.RTG_TREE); + palmCustom.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + palmCustom.setTreeConditionChance(3); + palmCustom.setMaxY(160); this.addDeco(palmCustom); // Another pass of the WorldGenMegaJungle collection for extra jungleness. @@ -228,23 +229,23 @@ public void initDecos() { // Jungle logs. DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 5f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 3; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 9; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(5f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(3); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 6; - decoBaseBiomeDecorations.loops = 1; + decoBaseBiomeDecorations.setNotEqualsZeroChance(6); + decoBaseBiomeDecorations.setLoops(1); this.addDeco(decoBaseBiomeDecorations); // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) @@ -265,25 +266,25 @@ public void initDecos() { // Tall cacti on red sand - matches the colour scheme nicely. DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); - decoJungleCacti.strengthFactor = 8f; - decoJungleCacti.maxY = 120; - decoJungleCacti.sandOnly = false; - decoJungleCacti.extraHeight = 7; - decoJungleCacti.sandMeta = (byte) 1; + decoJungleCacti.setStrengthFactor(8f); + decoJungleCacti.setMaxY(120); + decoJungleCacti.setSandOnly(false); + decoJungleCacti.setExtraHeight(7); + decoJungleCacti.setSandMeta((byte) 1); this.addDeco(decoJungleCacti, this.getConfig().ALLOW_CACTUS.get()); // Mossy boulders for the green. DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java index 2e3943f4f..1863dc892 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java @@ -10,10 +10,10 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperThisOrThat; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -21,6 +21,7 @@ import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaJungleM extends RealisticBiomeVanillaBase { @@ -126,33 +127,33 @@ public void initDecos() { // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); - mucronataTree.logBlock = BlockUtil.getStateLog(3); - mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); - mucronataTree.minTrunkSize = 3; - mucronataTree.maxTrunkSize = 4; - mucronataTree.minCrownSize = 10; - mucronataTree.maxCrownSize = 27; + mucronataTree.setLogBlock(BlockUtil.getStateLog(3)); + mucronataTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + mucronataTree.setMinTrunkSize(3); + mucronataTree.setMaxTrunkSize(4); + mucronataTree.setMinCrownSize(10); + mucronataTree.setMaxCrownSize(27); this.addTree(mucronataTree); DecoTree mangroves = new DecoTree(mucronataTree); - mangroves.loops = 3; - mangroves.treeType = DecoTree.TreeType.RTG_TREE; - mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - mangroves.treeConditionChance = 2; - mangroves.maxY = 160; + mangroves.setLoops(3); + mangroves.setTreeType(DecoTree.TreeType.RTG_TREE); + mangroves.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + mangroves.setTreeConditionChance(2); + mangroves.setMaxY(160); DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); - megaJungle.logBlock = BlockUtil.getStateLog(3); - megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); - megaJungle.minTrunkSize = 3; - megaJungle.maxTrunkSize = 4; - megaJungle.minCrownSize = 10; - megaJungle.maxCrownSize = 27; - megaJungle.loops = 3; - megaJungle.treeType = DecoTree.TreeType.WORLDGEN; - megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - megaJungle.treeConditionChance = 2; - megaJungle.maxY = 160; + megaJungle.setLogBlock(BlockUtil.getStateLog(3)); + megaJungle.setLeavesBlock(BlockUtil.getStateLeaf(3)); + megaJungle.setMinTrunkSize(3); + megaJungle.setMaxTrunkSize(4); + megaJungle.setMinCrownSize(10); + megaJungle.setMaxCrownSize(27); + megaJungle.setLoops(3); + megaJungle.setTreeType(DecoTree.TreeType.WORLDGEN); + megaJungle.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + megaJungle.setTreeConditionChance(2); + megaJungle.setMaxY(160); DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); this.addDeco(decoHelperThisOrThat); @@ -160,18 +161,18 @@ public void initDecos() { // Add some palm trees for variety. TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); - nuciferaTree.minTrunkSize = 7; - nuciferaTree.maxTrunkSize = 9; - nuciferaTree.minCrownSize = 6; - nuciferaTree.maxCrownSize = 8; + nuciferaTree.setMinTrunkSize(7); + nuciferaTree.setMaxTrunkSize(9); + nuciferaTree.setMinCrownSize(6); + nuciferaTree.setMaxCrownSize(8); this.addTree(nuciferaTree); DecoTree palmCustom = new DecoTree(nuciferaTree); - palmCustom.loops = 1; - palmCustom.treeType = DecoTree.TreeType.RTG_TREE; - palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - palmCustom.treeConditionChance = 3; - palmCustom.maxY = 160; + palmCustom.setLoops(1); + palmCustom.setTreeType(DecoTree.TreeType.RTG_TREE); + palmCustom.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + palmCustom.setTreeConditionChance(3); + palmCustom.setMaxY(160); this.addDeco(palmCustom); // Another pass of the WorldGenMegaJungle collection for extra jungleness. @@ -179,23 +180,23 @@ public void initDecos() { // Jungle logs. DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 5f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 3; - decoFallenTree.logBlock = BlockUtil.getStateLog(3); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 9; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(5f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(3); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(3)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(3)); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 6; - decoBaseBiomeDecorations.loops = 1; + decoBaseBiomeDecorations.setNotEqualsZeroChance(6); + decoBaseBiomeDecorations.setLoops(1); this.addDeco(decoBaseBiomeDecorations); // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) @@ -216,25 +217,25 @@ public void initDecos() { // Tall cacti on red sand - matches the colour scheme nicely. DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); - decoJungleCacti.strengthFactor = 8f; - decoJungleCacti.maxY = 120; - decoJungleCacti.sandOnly = false; - decoJungleCacti.extraHeight = 7; - decoJungleCacti.sandMeta = (byte) 1; + decoJungleCacti.setStrengthFactor(8f); + decoJungleCacti.setMaxY(120); + decoJungleCacti.setSandOnly(false); + decoJungleCacti.setExtraHeight(7); + decoJungleCacti.setSandMeta((byte) 1); this.addDeco(decoJungleCacti, this.getConfig().ALLOW_CACTUS.get()); // Mossy boulders for the green. DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); // Grass filler. DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java index d74c96d73..3bb90614b 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.biome.deco.DecoFallenTree; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaMegaSpruceTaiga extends RealisticBiomeVanillaBase { @@ -150,17 +151,17 @@ public void initDecos() { this.addDeco(decoBaseBiomeDecorations); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.loops = 1; - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.setLoops(1); + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java index 57a7d4ddc..330bfc85d 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaMegaTaiga extends RealisticBiomeVanillaBase { @@ -145,52 +146,52 @@ else if (cliff == 3) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 3f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(3f); this.addDeco(decoBoulder); this.addDecoCollection(new DecoCollectionMegaTaiga()); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 10; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(10); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.equalsZeroChance = 3; + decoBaseBiomeDecorations.setEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 3f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(3f); this.addDeco(decoMushrooms); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 20f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(20f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java index c0fabcf27..9816c6360 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaMegaTaigaHills extends RealisticBiomeVanillaBase { @@ -181,52 +182,52 @@ else if (cliff == 3) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 3f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(3f); this.addDeco(decoBoulder); this.addDecoCollection(new DecoCollectionMegaTaiga()); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 10; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(10); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.equalsZeroChance = 3; + decoBaseBiomeDecorations.setEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 3f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(3f); this.addDeco(decoMushrooms); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 20f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(20f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java index 6d15298d7..84bf542f0 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoCactus; import rtg.world.biome.deco.DecoDeadBush; @@ -158,24 +158,24 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 83; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(83); this.addDeco(decoBoulder); DecoShrub decoShrub = new DecoShrub(); - decoShrub.loops = 3; - decoShrub.maxY = 90; + decoShrub.setLoops(3); + decoShrub.setMaxY(90); addDeco(decoShrub); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.maxY = 100; - decoDeadBush.loops = 3; + decoDeadBush.setMaxY(100); + decoDeadBush.setLoops(3); this.addDeco(decoDeadBush); DecoCactus decoCactus = new DecoCactus(); - decoCactus.soilBlock = BlockUtil.getStateSand(1); - decoCactus.loops = 18; - decoCactus.maxY = 100; + decoCactus.setSoilBlock(BlockUtil.getStateSand(1)); + decoCactus.setLoops(18); + decoCactus.setMaxY(100); this.addDeco(decoCactus); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java index db78891a5..751651332 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.DecoBoulder; import rtg.world.biome.deco.DecoCactus; import rtg.world.biome.deco.DecoDeadBush; @@ -212,24 +212,24 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder.maxY = 83; + decoBoulder.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder.setMaxY(83); this.addDeco(decoBoulder); DecoShrub decoShrub = new DecoShrub(); - decoShrub.loops = 3; - decoShrub.maxY = 90; + decoShrub.setLoops(3); + decoShrub.setMaxY(90); addDeco(decoShrub); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.maxY = 100; - decoDeadBush.loops = 3; + decoDeadBush.setMaxY(100); + decoDeadBush.setLoops(3); this.addDeco(decoDeadBush); DecoCactus decoCactus = new DecoCactus(); - decoCactus.soilBlock = BlockUtil.getStateSand(1); - decoCactus.loops = 18; - decoCactus.maxY = 100; + decoCactus.setSoilBlock(BlockUtil.getStateSand(1)); + decoCactus.setLoops(18); + decoCactus.setMaxY(100); this.addDeco(decoCactus); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java index b0c094369..f50e2c44b 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; @@ -188,34 +188,34 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.chance = 10; + decoShrub.setChance(10); addDeco(decoShrub); DecoCactus decoCactus = new DecoCactus(); - decoCactus.strengthFactor = 25f; - decoCactus.soilBlock = BlockUtil.getStateSand(1); - decoCactus.sandOnly = false; - decoCactus.maxRiver = 0.8f; + decoCactus.setStrengthFactor(25f); + decoCactus.setSoilBlock(BlockUtil.getStateSand(1)); + decoCactus.setSandOnly(false); + decoCactus.setMaxRiver(0.8f); addDeco(decoCactus); DecoReed decoReed = new DecoReed(); - decoReed.loops = 5; - decoReed.maxRiver = 0.8f; + decoReed.setLoops(5); + decoReed.setMaxRiver(0.8f); addDeco(decoReed); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.strengthFactor = 5f; + decoDeadBush.setStrengthFactor(5f); addDeco(decoDeadBush); DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); - decoTree.loops = 20; - decoTree.treeType = DecoTree.TreeType.WORLDGEN; - decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; - decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); - decoTree.treeConditionChance = 0; - decoTree.treeConditionFloat = 4f; - decoTree.treeConditionNoise = 0f; - decoTree.minY = 74; + decoTree.setLoops(20); + decoTree.setTreeType(DecoTree.TreeType.WORLDGEN); + decoTree.setTreeCondition(DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH); + decoTree.setDistribution(new DecoTree.Distribution(24f, 1f, 0f)); + decoTree.setTreeConditionChance(0); + decoTree.setTreeConditionFloat(4f); + decoTree.setTreeConditionNoise(0f); + decoTree.setMinY(74); addDeco(decoTree); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java index c9eec87c5..1252c8f0d 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; @@ -200,34 +200,34 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.chance = 10; + decoShrub.setChance(10); addDeco(decoShrub); DecoCactus decoCactus = new DecoCactus(); - decoCactus.strengthFactor = 25f; - decoCactus.soilBlock = BlockUtil.getStateSand(1); - decoCactus.sandOnly = false; - decoCactus.maxRiver = 0.8f; + decoCactus.setStrengthFactor(25f); + decoCactus.setSoilBlock(BlockUtil.getStateSand(1)); + decoCactus.setSandOnly(false); + decoCactus.setMaxRiver(0.8f); addDeco(decoCactus); DecoReed decoReed = new DecoReed(); - decoReed.loops = 5; - decoReed.maxRiver = 0.8f; + decoReed.setLoops(5); + decoReed.setMaxRiver(0.8f); addDeco(decoReed); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.strengthFactor = 5f; + decoDeadBush.setStrengthFactor(5f); addDeco(decoDeadBush); DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); - decoTree.loops = 24; - decoTree.treeType = DecoTree.TreeType.WORLDGEN; - decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; - decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); - decoTree.treeConditionChance = 0; - decoTree.treeConditionFloat = 4f; - decoTree.treeConditionNoise = 0f; - decoTree.minY = 74; + decoTree.setLoops(24); + decoTree.setTreeType(DecoTree.TreeType.WORLDGEN); + decoTree.setTreeCondition(DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH); + decoTree.setDistribution(new DecoTree.Distribution(24f, 1f, 0f)); + decoTree.setTreeConditionChance(0); + decoTree.setTreeConditionFloat(4f); + decoTree.setTreeConditionNoise(0f); + decoTree.setMinY(74); addDeco(decoTree); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java index a446db798..8ad148f3e 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java @@ -10,11 +10,11 @@ import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.feature.WorldGenTrees; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.surface.SurfaceBase; @@ -193,34 +193,34 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.chance = 10; + decoShrub.setChance(10); addDeco(decoShrub); DecoCactus decoCactus = new DecoCactus(); - decoCactus.strengthFactor = 25f; - decoCactus.soilBlock = BlockUtil.getStateSand(1); - decoCactus.sandOnly = false; - decoCactus.maxRiver = 0.8f; + decoCactus.setStrengthFactor(25f); + decoCactus.setSoilBlock(BlockUtil.getStateSand(1)); + decoCactus.setSandOnly(false); + decoCactus.setMaxRiver(0.8f); addDeco(decoCactus); DecoReed decoReed = new DecoReed(); - decoReed.loops = 5; - decoReed.maxRiver = 0.8f; + decoReed.setLoops(5); + decoReed.setMaxRiver(0.8f); addDeco(decoReed); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.strengthFactor = 5f; + decoDeadBush.setStrengthFactor(5f); addDeco(decoDeadBush); DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); - decoTree.loops = 16; - decoTree.treeType = DecoTree.TreeType.WORLDGEN; - decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; - decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); - decoTree.treeConditionChance = 0; - decoTree.treeConditionFloat = 4f; - decoTree.treeConditionNoise = 0f; - decoTree.minY = 74; + decoTree.setLoops(16); + decoTree.setTreeType(DecoTree.TreeType.WORLDGEN); + decoTree.setTreeCondition(DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH); + decoTree.setDistribution(new DecoTree.Distribution(24f, 1f, 0f)); + decoTree.setTreeConditionChance(0); + decoTree.setTreeConditionFloat(4f); + decoTree.setTreeConditionNoise(0f); + decoTree.setMinY(74); addDeco(decoTree); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java index 426eb0372..34ebf9ce7 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.DecoCactus; import rtg.world.biome.deco.DecoDeadBush; import rtg.world.biome.deco.DecoReed; @@ -185,19 +185,19 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoCactus decoCactus = new DecoCactus(); - decoCactus.strengthFactor = 25f; - decoCactus.soilBlock = BlockUtil.getStateClay(1); - decoCactus.sandOnly = false; - decoCactus.maxRiver = 0.8f; + decoCactus.setStrengthFactor(25f); + decoCactus.setSoilBlock(BlockUtil.getStateClay(1)); + decoCactus.setSandOnly(false); + decoCactus.setMaxRiver(0.8f); addDeco(decoCactus); DecoReed decoReed = new DecoReed(); - decoReed.loops = 5; - decoReed.maxRiver = 0.8f; + decoReed.setLoops(5); + decoReed.setMaxRiver(0.8f); addDeco(decoReed); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.strengthFactor = 5f; + decoDeadBush.setStrengthFactor(5f); addDeco(decoDeadBush); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java index 094b45a5e..cb0226ee0 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java index cdf085ab3..d82766fe5 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java index d9ba5504b..9268384a4 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java index d59cc0b0e..30e56f0de 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperThisOrThat; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -122,22 +122,22 @@ public void initDecos() { //Sparse wheat DecoCrop decoCropWheat = new DecoCrop(); - decoCropWheat.size = 8; - decoCropWheat.density = 5; - decoCropWheat.chance = this.getConfig().WHEAT_CHANCE.get(); - decoCropWheat.type = 3; - decoCropWheat.water = false; - decoCropWheat.minY = this.getConfig().WHEAT_MIN_Y.get(); - decoCropWheat.maxY = this.getConfig().WHEAT_MAX_Y.get(); + decoCropWheat.setSize(8); + decoCropWheat.setDensity(5); + decoCropWheat.setChance(this.getConfig().WHEAT_CHANCE.get()); + decoCropWheat.setType(3); + decoCropWheat.setWater(false); + decoCropWheat.setMinY(this.getConfig().WHEAT_MIN_Y.get()); + decoCropWheat.setMaxY(this.getConfig().WHEAT_MAX_Y.get()); this.addDeco(decoCropWheat, this.getConfig().ALLOW_WHEAT.get()); // Very sparse shrubs. DecoShrub decoShrubOak = new DecoShrub(); - decoShrubOak.logBlock = Blocks.LOG.getDefaultState(); - decoShrubOak.leavesBlock = Blocks.LEAVES.getDefaultState(); - decoShrubOak.maxY = 110; - decoShrubOak.loops = 1; - decoShrubOak.chance = 36; + decoShrubOak.setLogBlock(Blocks.LOG.getDefaultState()); + decoShrubOak.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + decoShrubOak.setMaxY(110); + decoShrubOak.setLoops(1); + decoShrubOak.setChance(36); this.addDeco(decoShrubOak); // The occasional flower. @@ -149,44 +149,44 @@ public void initDecos() { // Lots of grass, but not as much as vanilla. DecoGrass decoGrass = new DecoGrass(); - decoGrass.minY = 60; - decoGrass.maxY = 128; - decoGrass.loops = 6; + decoGrass.setMinY(60); + decoGrass.setMaxY(128); + decoGrass.setLoops(6); this.addDeco(decoGrass); // Very rare fat oak/birch trees. TreeRTG roburTree1 = new TreeRTGQuercusRobur(); - roburTree1.logBlock = Blocks.LOG.getDefaultState(); - roburTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); - roburTree1.minTrunkSize = 3; - roburTree1.maxTrunkSize = 5; - roburTree1.minCrownSize = 7; - roburTree1.maxCrownSize = 9; + roburTree1.setLogBlock(Blocks.LOG.getDefaultState()); + roburTree1.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + roburTree1.setMinTrunkSize(3); + roburTree1.setMaxTrunkSize(5); + roburTree1.setMinCrownSize(7); + roburTree1.setMaxCrownSize(9); this.addTree(roburTree1); DecoTree oakTrees = new DecoTree(roburTree1); - oakTrees.treeType = DecoTree.TreeType.RTG_TREE; - oakTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - oakTrees.distribution = new DecoTree.Distribution(100f, 6f, 0.8f); - oakTrees.treeConditionNoise = 0.4f; - oakTrees.treeConditionChance = 48; + oakTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + oakTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + oakTrees.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f)); + oakTrees.setTreeConditionNoise(0.4f); + oakTrees.setTreeConditionChance(48); TreeRTG roburTree2 = new TreeRTGQuercusRobur(); - roburTree2.logBlock = BlockUtil.getStateLog(2); - roburTree2.leavesBlock = BlockUtil.getStateLeaf(2); - roburTree2.minTrunkSize = 3; - roburTree2.maxTrunkSize = 5; - roburTree2.minCrownSize = 7; - roburTree2.maxCrownSize = 9; + roburTree2.setLogBlock(BlockUtil.getStateLog(2)); + roburTree2.setLeavesBlock(BlockUtil.getStateLeaf(2)); + roburTree2.setMinTrunkSize(3); + roburTree2.setMaxTrunkSize(5); + roburTree2.setMinCrownSize(7); + roburTree2.setMaxCrownSize(9); this.addTree(roburTree2); DecoTree birchTrees = new DecoTree(roburTree2); - birchTrees.treeType = DecoTree.TreeType.RTG_TREE; - birchTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - birchTrees.distribution = new DecoTree.Distribution(100f, 6f, 0.8f); - birchTrees.treeConditionNoise = 0.4f; - birchTrees.treeConditionChance = 48; + birchTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + birchTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + birchTrees.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f)); + birchTrees.setTreeConditionNoise(0.4f); + birchTrees.setTreeConditionChance(48); this.addDeco(new DecoHelperThisOrThat(4, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, oakTrees, birchTrees)); diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java index 53ec855f4..ccf93cab3 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaRedwoodTaigaHills extends RealisticBiomeVanillaBase { @@ -178,52 +179,52 @@ else if (cliff == 3) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 95; - decoBoulder.strengthFactor = 3f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(95); + decoBoulder.setStrengthFactor(3f); this.addDeco(decoBoulder); this.addDecoCollection(new DecoCollectionMegaTaiga()); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 100f; - decoFallenTree.distribution.noiseFactor = 6f; - decoFallenTree.distribution.noiseAddend = 0.8f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(100f); + decoFallenTree.getDistribution().setNoiseFactor(6f); + decoFallenTree.getDistribution().setNoiseAddend(0.8f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 2f; - decoShrub.chance = 10; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(2f); + decoShrub.setChance(10); this.addDeco(decoShrub); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.equalsZeroChance = 3; + decoBaseBiomeDecorations.setEqualsZeroChance(3); this.addDeco(decoBaseBiomeDecorations); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; - decoMushrooms.randomFloat = 3f; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH); + decoMushrooms.setRandomFloat(3f); this.addDeco(decoMushrooms); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 20f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(20f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java index 895ffed12..0e8eefadb 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java @@ -8,9 +8,9 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.noise.OpenSimplexNoise; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java index d653383fc..ef8b98860 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.biome.deco.helper.DecoHelperThisOrThat; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -23,6 +23,7 @@ import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaRoofedForest extends RealisticBiomeVanillaBase { @@ -180,125 +181,125 @@ else if (cliff == 2) { public void initDecos() { DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.chance = 4; - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE; + decoMushrooms.setChance(4); + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE); this.addDeco(decoMushrooms); TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f); - mucronataTree.logBlock = BlockUtil.getStateLog2(1); - mucronataTree.leavesBlock = BlockUtil.getStateLeaf2(1); - mucronataTree.minTrunkSize = 2; - mucronataTree.maxTrunkSize = 3; - mucronataTree.minCrownSize = 10; - mucronataTree.maxCrownSize = 18; - mucronataTree.noLeaves = false; + mucronataTree.setLogBlock(BlockUtil.getStateLog2(1)); + mucronataTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + mucronataTree.setMinTrunkSize(2); + mucronataTree.setMaxTrunkSize(3); + mucronataTree.setMinCrownSize(10); + mucronataTree.setMaxCrownSize(18); + mucronataTree.setNoLeaves(false); this.addTree(mucronataTree); DecoTree mangroveTree = new DecoTree(mucronataTree); - mangroveTree.treeType = DecoTree.TreeType.RTG_TREE; - mangroveTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - mangroveTree.treeConditionChance = 1; - mangroveTree.strengthFactorForLoops = 12f; - mangroveTree.maxY = 110; - mangroveTree.scatter = new DecoTree.Scatter(16, 0); + mangroveTree.setTreeType(DecoTree.TreeType.RTG_TREE); + mangroveTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + mangroveTree.setTreeConditionChance(1); + mangroveTree.setStrengthFactorForLoops(12f); + mangroveTree.setMaxY(110); + mangroveTree.setScatter(new DecoTree.Scatter(16, 0)); this.addDeco(mangroveTree); TreeRTG pentandraTree = new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f); - pentandraTree.logBlock = BlockUtil.getStateLog2(1); - pentandraTree.leavesBlock = BlockUtil.getStateLeaf2(1); - pentandraTree.minTrunkSize = 2; - pentandraTree.maxTrunkSize = 3; - pentandraTree.minCrownSize = 10; - pentandraTree.maxCrownSize = 18; - pentandraTree.noLeaves = false; + pentandraTree.setLogBlock(BlockUtil.getStateLog2(1)); + pentandraTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + pentandraTree.setMinTrunkSize(2); + pentandraTree.setMaxTrunkSize(3); + pentandraTree.setMinCrownSize(10); + pentandraTree.setMaxCrownSize(18); + pentandraTree.setNoLeaves(false); this.addTree(pentandraTree); DecoTree ceibaPentandraTree = new DecoTree(pentandraTree); - ceibaPentandraTree.treeType = DecoTree.TreeType.RTG_TREE; - ceibaPentandraTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - ceibaPentandraTree.treeConditionChance = 1; - ceibaPentandraTree.strengthFactorForLoops = 12f; - ceibaPentandraTree.maxY = 110; - ceibaPentandraTree.scatter = new DecoTree.Scatter(16, 0); + ceibaPentandraTree.setTreeType(DecoTree.TreeType.RTG_TREE); + ceibaPentandraTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + ceibaPentandraTree.setTreeConditionChance(1); + ceibaPentandraTree.setStrengthFactorForLoops(12f); + ceibaPentandraTree.setMaxY(110); + ceibaPentandraTree.setScatter(new DecoTree.Scatter(16, 0)); this.addDeco(ceibaPentandraTree); TreeRTG roseaTree = new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f); - roseaTree.logBlock = BlockUtil.getStateLog2(1); - roseaTree.leavesBlock = BlockUtil.getStateLeaf2(1); - roseaTree.minTrunkSize = 2; - roseaTree.maxTrunkSize = 3; - roseaTree.minCrownSize = 10; - roseaTree.maxCrownSize = 18; - roseaTree.noLeaves = false; + roseaTree.setLogBlock(BlockUtil.getStateLog2(1)); + roseaTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + roseaTree.setMinTrunkSize(2); + roseaTree.setMaxTrunkSize(3); + roseaTree.setMinCrownSize(10); + roseaTree.setMaxCrownSize(18); + roseaTree.setNoLeaves(false); this.addTree(roseaTree); DecoTree ceibaRoseaTree = new DecoTree(roseaTree); - ceibaRoseaTree.treeType = DecoTree.TreeType.RTG_TREE; - ceibaRoseaTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - ceibaRoseaTree.treeConditionChance = 1; - ceibaRoseaTree.strengthFactorForLoops = 12f; - ceibaRoseaTree.maxY = 110; - ceibaRoseaTree.scatter = new DecoTree.Scatter(16, 0); + ceibaRoseaTree.setTreeType(DecoTree.TreeType.RTG_TREE); + ceibaRoseaTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + ceibaRoseaTree.setTreeConditionChance(1); + ceibaRoseaTree.setStrengthFactorForLoops(12f); + ceibaRoseaTree.setMaxY(110); + ceibaRoseaTree.setScatter(new DecoTree.Scatter(16, 0)); this.addDeco(ceibaRoseaTree); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionChance = 16; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 9; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(16); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub darkOakShrub = new DecoShrub(); - darkOakShrub.logBlock = BlockUtil.getStateLog2(1); - darkOakShrub.leavesBlock = BlockUtil.getStateLeaf2(1); - darkOakShrub.maxY = 100; - darkOakShrub.strengthFactor = 8f; + darkOakShrub.setLogBlock(BlockUtil.getStateLog2(1)); + darkOakShrub.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + darkOakShrub.setMaxY(100); + darkOakShrub.setStrengthFactor(8f); DecoShrub oakShrub = new DecoShrub(); - oakShrub.logBlock = Blocks.LOG.getDefaultState(); - oakShrub.leavesBlock = Blocks.LEAVES.getDefaultState(); - oakShrub.maxY = 100; - oakShrub.strengthFactor = 8f; + oakShrub.setLogBlock(Blocks.LOG.getDefaultState()); + oakShrub.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + oakShrub.setMaxY(100); + oakShrub.setStrengthFactor(8f); this.addDeco(new DecoHelperThisOrThat(4, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, darkOakShrub, oakShrub)); DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 16; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(16); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); DecoCobwebs decoCobwebs = new DecoCobwebs(); - decoCobwebs.chance = 1; - decoCobwebs.minY = 63; - decoCobwebs.maxY = 76; - decoCobwebs.strengthFactor = 24f; - decoCobwebs.adjacentBlock = BlockUtil.getStateLog2(1); - decoCobwebs.minAdjacents = 2; + decoCobwebs.setChance(1); + decoCobwebs.setMinY(63); + decoCobwebs.setMaxY(76); + decoCobwebs.setStrengthFactor(24f); + decoCobwebs.setAdjacentBlock(BlockUtil.getStateLog2(1)); + decoCobwebs.setMinAdjacents(2); this.addDeco(decoCobwebs, this.getConfig().ALLOW_COBWEBS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); - decoBaseBiomeDecorations.notEqualsZeroChance = 2; - decoBaseBiomeDecorations.maxY = 100; + decoBaseBiomeDecorations.setNotEqualsZeroChance(2); + decoBaseBiomeDecorations.setMaxY(100); this.addDeco(decoBaseBiomeDecorations); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 100; - decoGrass.strengthFactor = 20f; + decoGrass.setMaxY(100); + decoGrass.setStrengthFactor(20f); this.addDeco(decoGrass); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.maxY = 100; - decoDeadBush.chance = 2; - decoDeadBush.strengthFactor = 2f; + decoDeadBush.setMaxY(100); + decoDeadBush.setChance(2); + decoDeadBush.setStrengthFactor(2f); this.addDeco(decoDeadBush); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java index 86f121a9c..b971ddb59 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java @@ -9,15 +9,16 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.ALWAYS_GENERATE; public class RealisticBiomeVanillaRoofedForestM extends RealisticBiomeVanillaBase { @@ -119,78 +120,78 @@ else if (depth < 4) { public void initDecos() { DecoBoulder decoBoulder = new DecoBoulder(); - decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); - decoBoulder.chance = 20; - decoBoulder.maxY = 80; - decoBoulder.strengthFactor = 2f; + decoBoulder.setBoulderBlock(Blocks.MOSSY_COBBLESTONE.getDefaultState()); + decoBoulder.setChance(20); + decoBoulder.setMaxY(80); + decoBoulder.setStrengthFactor(2f); this.addDeco(decoBoulder); TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f); - mucronataTree.logBlock = BlockUtil.getStateLog2(1); - mucronataTree.leavesBlock = BlockUtil.getStateLeaf2(1); - mucronataTree.minTrunkSize = 3; - mucronataTree.maxTrunkSize = 4; - mucronataTree.minCrownSize = 7; - mucronataTree.maxCrownSize = 12; + mucronataTree.setLogBlock(BlockUtil.getStateLog2(1)); + mucronataTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + mucronataTree.setMinTrunkSize(3); + mucronataTree.setMaxTrunkSize(4); + mucronataTree.setMinCrownSize(7); + mucronataTree.setMaxCrownSize(12); this.addTree(mucronataTree); DecoTree decoTrees = new DecoTree(mucronataTree); - decoTrees.strengthFactorForLoops = 24f; - decoTrees.distribution.noiseDivisor = 80f; - decoTrees.distribution.noiseFactor = 60f; - decoTrees.distribution.noiseAddend = -15f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoTrees.treeConditionNoise = 0f; - decoTrees.treeConditionChance = 1; - decoTrees.maxY = 120; + decoTrees.setStrengthFactorForLoops(24f); + decoTrees.getDistribution().setNoiseDivisor(80f); + decoTrees.getDistribution().setNoiseFactor(60f); + decoTrees.getDistribution().setNoiseAddend(-15f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoTrees.setTreeConditionNoise(0f); + decoTrees.setTreeConditionChance(1); + decoTrees.setMaxY(120); this.addDeco(decoTrees); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.logCondition = DecoFallenTree.LogCondition.ALWAYS_GENERATE; - decoFallenTree.logConditionChance = 1; - decoFallenTree.loops = 4; - decoFallenTree.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); - decoFallenTree.minSize = 4; - decoFallenTree.maxSize = 9; + decoFallenTree.setLogCondition(ALWAYS_GENERATE); + decoFallenTree.setLogConditionChance(1); + decoFallenTree.setLoops(4); + decoFallenTree.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoFallenTree.setMinSize(4); + decoFallenTree.setMaxSize(9); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 110; - decoShrub.strengthFactor = 1f; + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(1f); this.addDeco(decoShrub); DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); - decoGrassDoubleTallgrass.maxY = 128; - decoGrassDoubleTallgrass.strengthFactor = 8f; - decoGrassDoubleTallgrass.doubleGrassChance = 6; + decoGrassDoubleTallgrass.setMaxY(128); + decoGrassDoubleTallgrass.setStrengthFactor(8f); + decoGrassDoubleTallgrass.setDoubleGrassChance(6); this.addDeco(decoGrassDoubleTallgrass); DecoDeadBush decoDeadBush = new DecoDeadBush(); - decoDeadBush.maxY = 128; - decoDeadBush.chance = 16; - decoDeadBush.strengthFactor = 1f; + decoDeadBush.setMaxY(128); + decoDeadBush.setChance(16); + decoDeadBush.setStrengthFactor(1f); this.addDeco(decoDeadBush); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 4f; - decoGrass.chance = 2; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(4f); + decoGrass.setChance(2); this.addDeco(decoGrass); DecoGrass decoFern = new DecoGrass(2); - decoFern.maxY = 128; - decoFern.strengthFactor = 4f; - decoFern.chance = 2; + decoFern.setMaxY(128); + decoFern.setStrengthFactor(4f); + decoFern.setChance(2); this.addDeco(decoFern); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); this.addDeco(decoBaseBiomeDecorations); DecoMushrooms decoMushrooms = new DecoMushrooms(); - decoMushrooms.maxY = 90; - decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE; + decoMushrooms.setMaxY(90); + decoMushrooms.setRandomType(rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE); this.addDeco(decoMushrooms); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java index da1416544..eeec28f5a 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.biome.deco.collection.DecoCollectionSavanna; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java index 1022c613c..5c6a3afa6 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.biome.deco.collection.DecoCollectionSavanna; import rtg.world.gen.surface.SurfaceBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java index 17ab67aac..0b0274aad 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; import rtg.api.world.RTGWorld; -import rtg.api.config.BiomeConfig; import rtg.util.CanyonColour; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; @@ -199,54 +199,54 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoBoulder decoBoulder1 = new DecoBoulder(); - decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.maxY = 80; - decoBoulder1.chance = 24; + decoBoulder1.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMaxY(80); + decoBoulder1.setChance(24); this.addDeco(decoBoulder1); DecoBoulder decoBoulder2 = new DecoBoulder(); - decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.minY = 110; - decoBoulder2.chance = 24; + decoBoulder2.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMinY(110); + decoBoulder2.setChance(24); this.addDeco(decoBoulder2); DecoShrub acaciaShrub = new DecoShrub(); - acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); - acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaShrub.maxY = 160; - acaciaShrub.strengthFactor = 3f; - acaciaShrub.chance = 9; + acaciaShrub.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaShrub.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaShrub.setMaxY(160); + acaciaShrub.setStrengthFactor(3f); + acaciaShrub.setChance(9); this.addDeco(acaciaShrub); TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); - acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); - acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaTree.minTrunkSize = 12; - acaciaTree.maxTrunkSize = 16; + acaciaTree.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaTree.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaTree.setMinTrunkSize(12); + acaciaTree.setMaxTrunkSize(16); this.addTree(acaciaTree); DecoTree acaciaTrees = new DecoTree(acaciaTree); - acaciaTrees.strengthFactorForLoops = 2f; - acaciaTrees.treeType = DecoTree.TreeType.RTG_TREE; - acaciaTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - acaciaTrees.treeConditionChance = 12; - acaciaTrees.maxY = 160; + acaciaTrees.setStrengthFactorForLoops(2f); + acaciaTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + acaciaTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + acaciaTrees.setTreeConditionChance(12); + acaciaTrees.setMaxY(160); this.addDeco(acaciaTrees); DecoCactus decoCactus = new DecoCactus(); - decoCactus.maxY = 160; - decoCactus.loops = 60; - decoCactus.chance = 8; + decoCactus.setMaxY(160); + decoCactus.setLoops(60); + decoCactus.setChance(8); this.addDeco(decoCactus); DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); - decoDoubleGrass.maxY = 128; - decoDoubleGrass.strengthFactor = 3f; + decoDoubleGrass.setMaxY(128); + decoDoubleGrass.setStrengthFactor(3f); this.addDeco(decoDoubleGrass); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java index 9e73c764b..d103b9adb 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; -import rtg.util.CanyonColour; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; +import rtg.util.CanyonColour; import rtg.world.biome.deco.*; import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; import rtg.world.gen.feature.tree.rtg.TreeRTG; @@ -192,54 +192,54 @@ public void initDecos() { this.addDecoCollection(new DecoCollectionDesertRiver()); DecoBoulder decoBoulder1 = new DecoBoulder(); - decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.maxY = 80; - decoBoulder1.chance = 24; + decoBoulder1.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMaxY(80); + decoBoulder1.setChance(24); this.addDeco(decoBoulder1); DecoBoulder decoBoulder2 = new DecoBoulder(); - decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); - decoBoulder1.minY = 110; - decoBoulder2.chance = 24; + decoBoulder2.setBoulderBlock(Blocks.COBBLESTONE.getDefaultState()); + decoBoulder1.setMinY(110); + decoBoulder2.setChance(24); this.addDeco(decoBoulder2); DecoShrub acaciaShrub = new DecoShrub(); - acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); - acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaShrub.maxY = 160; - acaciaShrub.strengthFactor = 3f; - acaciaShrub.chance = 9; + acaciaShrub.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaShrub.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaShrub.setMaxY(160); + acaciaShrub.setStrengthFactor(3f); + acaciaShrub.setChance(9); this.addDeco(acaciaShrub); TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); - acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); - acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); - acaciaTree.minTrunkSize = 12; - acaciaTree.maxTrunkSize = 16; + acaciaTree.setLogBlock(Blocks.LOG2.getDefaultState()); + acaciaTree.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); + acaciaTree.setMinTrunkSize(12); + acaciaTree.setMaxTrunkSize(16); this.addTree(acaciaTree); DecoTree acaciaTrees = new DecoTree(acaciaTree); - acaciaTrees.strengthFactorForLoops = 2f; - acaciaTrees.treeType = DecoTree.TreeType.RTG_TREE; - acaciaTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - acaciaTrees.treeConditionChance = 12; - acaciaTrees.maxY = 160; + acaciaTrees.setStrengthFactorForLoops(2f); + acaciaTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + acaciaTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + acaciaTrees.setTreeConditionChance(12); + acaciaTrees.setMaxY(160); this.addDeco(acaciaTrees); DecoCactus decoCactus = new DecoCactus(); - decoCactus.maxY = 160; - decoCactus.loops = 60; - decoCactus.chance = 8; + decoCactus.setMaxY(160); + decoCactus.setLoops(60); + decoCactus.setChance(8); this.addDeco(decoCactus); DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); - decoDoubleGrass.maxY = 128; - decoDoubleGrass.strengthFactor = 3f; + decoDoubleGrass.setMaxY(128); + decoDoubleGrass.setStrengthFactor(3f); this.addDeco(decoDoubleGrass); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 10f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(10f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java index 795266947..dd688a2a0 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java index bb1e4c97e..0ca63dc5d 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.DecoBaseBiomeDecorations; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.GroundEffect; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java index ae98a04ce..171347e16 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java @@ -9,17 +9,18 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; import rtg.world.gen.feature.tree.rtg.TreeRTGSalixMyrtilloides; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; +import static rtg.world.biome.deco.DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; public class RealisticBiomeVanillaSwampland extends RealisticBiomeVanillaBase { @@ -117,69 +118,69 @@ else if (depth < 4) { public void initDecos() { TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); - myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); - myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + myrtilloidesTree.setLogBlock(Blocks.LOG.getDefaultState()); + myrtilloidesTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.addTree(myrtilloidesTree); DecoTree decoTrees = new DecoTree(myrtilloidesTree); - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.strengthFactorForLoops = 1f; - decoTrees.distribution.noiseDivisor = 80f; - decoTrees.distribution.noiseFactor = 60f; - decoTrees.distribution.noiseAddend = -15f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 12; - decoTrees.maxY = 70; + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.setStrengthFactorForLoops(1f); + decoTrees.getDistribution().setNoiseDivisor(80f); + decoTrees.getDistribution().setNoiseFactor(60f); + decoTrees.getDistribution().setNoiseAddend(-15f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(12); + decoTrees.setMaxY(70); this.addDeco(decoTrees); TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); - ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); - ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaTree.minTrunkSize = 3; - ponderosaTree.maxTrunkSize = 6; - ponderosaTree.minCrownSize = 6; - ponderosaTree.maxCrownSize = 14; - ponderosaTree.noLeaves = true; + ponderosaTree.setLogBlock(Blocks.LOG.getDefaultState()); + ponderosaTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + ponderosaTree.setMinTrunkSize(3); + ponderosaTree.setMaxTrunkSize(6); + ponderosaTree.setMinCrownSize(6); + ponderosaTree.setMaxCrownSize(14); + ponderosaTree.setNoLeaves(true); this.addTree(ponderosaTree); DecoTree deadPineTree = new DecoTree(ponderosaTree); - deadPineTree.treeType = DecoTree.TreeType.RTG_TREE; - deadPineTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - deadPineTree.treeConditionChance = 18; - deadPineTree.maxY = 100; + deadPineTree.setTreeType(DecoTree.TreeType.RTG_TREE); + deadPineTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + deadPineTree.setTreeConditionChance(18); + deadPineTree.setMaxY(100); this.addDeco(deadPineTree); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); this.addDeco(decoBaseBiomeDecorations); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 50f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(50f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java index a44a8ea3c..b5ac681d7 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java @@ -9,10 +9,10 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.*; import rtg.world.gen.feature.tree.rtg.TreeRTG; import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; @@ -122,69 +122,69 @@ else if (depth < 4) { public void initDecos() { TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); - myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); - myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + myrtilloidesTree.setLogBlock(Blocks.LOG.getDefaultState()); + myrtilloidesTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.addTree(myrtilloidesTree); DecoTree decoTrees = new DecoTree(myrtilloidesTree); - decoTrees.strengthNoiseFactorXForLoops = true; - decoTrees.strengthFactorForLoops = 1f; - decoTrees.distribution.noiseDivisor = 80f; - decoTrees.distribution.noiseFactor = 60f; - decoTrees.distribution.noiseAddend = -15f; - decoTrees.treeType = DecoTree.TreeType.RTG_TREE; - decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - decoTrees.treeConditionChance = 12; - decoTrees.maxY = 100; + decoTrees.setStrengthNoiseFactorXForLoops(true); + decoTrees.setStrengthFactorForLoops(1f); + decoTrees.getDistribution().setNoiseDivisor(80f); + decoTrees.getDistribution().setNoiseFactor(60f); + decoTrees.getDistribution().setNoiseAddend(-15f); + decoTrees.setTreeType(DecoTree.TreeType.RTG_TREE); + decoTrees.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + decoTrees.setTreeConditionChance(12); + decoTrees.setMaxY(100); this.addDeco(decoTrees); TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); - ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); - ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); - ponderosaTree.minTrunkSize = 3; - ponderosaTree.maxTrunkSize = 6; - ponderosaTree.minCrownSize = 6; - ponderosaTree.maxCrownSize = 14; - ponderosaTree.noLeaves = true; + ponderosaTree.setLogBlock(Blocks.LOG.getDefaultState()); + ponderosaTree.setLeavesBlock(Blocks.LEAVES.getDefaultState()); + ponderosaTree.setMinTrunkSize(3); + ponderosaTree.setMaxTrunkSize(6); + ponderosaTree.setMinCrownSize(6); + ponderosaTree.setMaxCrownSize(14); + ponderosaTree.setNoLeaves(true); this.addTree(ponderosaTree); DecoTree deadPineTree = new DecoTree(ponderosaTree); - deadPineTree.treeType = DecoTree.TreeType.RTG_TREE; - deadPineTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; - deadPineTree.treeConditionChance = 18; - deadPineTree.maxY = 100; + deadPineTree.setTreeType(DecoTree.TreeType.RTG_TREE); + deadPineTree.setTreeCondition(DecoTree.TreeCondition.RANDOM_CHANCE); + deadPineTree.setTreeConditionChance(18); + deadPineTree.setMaxY(100); this.addDeco(deadPineTree); DecoShrub decoShrub = new DecoShrub(); - decoShrub.maxY = 100; - decoShrub.strengthFactor = 3f; + decoShrub.setMaxY(100); + decoShrub.setStrengthFactor(3f); this.addDeco(decoShrub); DecoFallenTree decoFallenTree = new DecoFallenTree(); - decoFallenTree.distribution.noiseDivisor = 80f; - decoFallenTree.distribution.noiseFactor = 60f; - decoFallenTree.distribution.noiseAddend = -15f; - decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; - decoFallenTree.logConditionNoise = 0f; - decoFallenTree.logConditionChance = 6; - decoFallenTree.logBlock = BlockUtil.getStateLog2(1); - decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); - decoFallenTree.minSize = 3; - decoFallenTree.maxSize = 6; + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogBlock(BlockUtil.getStateLog2(1)); + decoFallenTree.setLeavesBlock(BlockUtil.getStateLeaf2(1)); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(6); this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); this.addDeco(decoBaseBiomeDecorations); DecoPumpkin decoPumpkin = new DecoPumpkin(); - decoPumpkin.maxY = 90; - decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; - decoPumpkin.randomFloat = 50f; + decoPumpkin.setMaxY(90); + decoPumpkin.setRandomType(DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH); + decoPumpkin.setRandomFloat(50f); this.addDeco(decoPumpkin); DecoGrass decoGrass = new DecoGrass(); - decoGrass.maxY = 128; - decoGrass.strengthFactor = 12f; + decoGrass.setMaxY(128); + decoGrass.setStrengthFactor(12f); this.addDeco(decoGrass); } } diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java index 6bbaa37d1..181c75dbb 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java index ad14cb1bd..c0aa0f049 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java index a33f9841c..c14d5cd99 100644 --- a/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java +++ b/src/main/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java @@ -9,11 +9,11 @@ import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; -import rtg.api.util.noise.OpenSimplexNoise; -import rtg.api.world.RTGWorld; import rtg.api.config.BiomeConfig; import rtg.api.util.BlockUtil; import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; import rtg.world.biome.deco.collection.DecoCollectionTaiga; import rtg.world.gen.surface.SurfaceBase; import rtg.world.gen.terrain.TerrainBase; diff --git a/src/main/java/rtg/world/gen/feature/WorldGenBlob.java b/src/main/java/rtg/world/gen/feature/WorldGenBlob.java index cbc1ef52a..de6c3b7a5 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenBlob.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenBlob.java @@ -11,8 +11,8 @@ import rtg.api.RTGAPI; import rtg.api.config.RTGConfig; -import rtg.util.BoulderUtil; import rtg.api.util.RandomUtil; +import rtg.util.BoulderUtil; public class WorldGenBlob extends WorldGenerator { diff --git a/src/main/java/rtg/world/gen/feature/WorldGenBlock.java b/src/main/java/rtg/world/gen/feature/WorldGenBlock.java index 02a11ca2a..ba062c7af 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenBlock.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenBlock.java @@ -20,8 +20,8 @@ public WorldGenBlock(IBlockState placeBlock, IBlockState replaceBlock, IBlockSta this.placeBlock = placeBlock; this.replaceBlock = replaceBlock; - this.adjacentBlock = adjacentBlock; - this.minAdjacents = minAdjacents; + this.setAdjacentBlock(adjacentBlock); + this.setMinAdjacents(minAdjacents); } @Override @@ -79,4 +79,48 @@ protected boolean isAdjacent(World world, int x, int y, int z) { return (adjacentCount > 0 && adjacentCount >= this.minAdjacents); } + + public IBlockState getPlaceBlock() { + + return placeBlock; + } + + public WorldGenBlock setPlaceBlock(IBlockState placeBlock) { + + this.placeBlock = placeBlock; + return this; + } + + public IBlockState getReplaceBlock() { + + return replaceBlock; + } + + public WorldGenBlock setReplaceBlock(IBlockState replaceBlock) { + + this.replaceBlock = replaceBlock; + return this; + } + + public IBlockState getAdjacentBlock() { + + return adjacentBlock; + } + + public WorldGenBlock setAdjacentBlock(IBlockState adjacentBlock) { + + this.adjacentBlock = adjacentBlock; + return this; + } + + public int getMinAdjacents() { + + return minAdjacents; + } + + public WorldGenBlock setMinAdjacents(int minAdjacents) { + + this.minAdjacents = minAdjacents; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/gen/feature/WorldGenCacti.java b/src/main/java/rtg/world/gen/feature/WorldGenCacti.java index faa85b65d..865ec7f97 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenCacti.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenCacti.java @@ -28,7 +28,7 @@ public WorldGenCacti(boolean sandOnly, int extraHeight, IBlockState soilBlock) { sand = sandOnly; eHeight = extraHeight; - this.soilBlock = soilBlock; + this.setSoilBlock(soilBlock); } @Override @@ -63,4 +63,15 @@ public boolean generate(World world, Random rand, BlockPos pos) { return true; } + + public IBlockState getSoilBlock() { + + return soilBlock; + } + + public WorldGenCacti setSoilBlock(IBlockState soilBlock) { + + this.soilBlock = soilBlock; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/gen/feature/WorldGenLayers.java b/src/main/java/rtg/world/gen/feature/WorldGenLayers.java index 7da264989..d3e41c211 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenLayers.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenLayers.java @@ -31,7 +31,7 @@ public WorldGenLayers(IBlockState block, PropertyInteger prop, int dropHeight, i this.layerProperty = prop; this.dropHeight = dropHeight; this.layerRange = range; - this.scatter = scatter < 1 ? 1 : scatter; + this.setScatter(scatter < 1 ? 1 : scatter); this.validGroundBlocks = new ArrayList(Arrays.asList( Blocks.GRASS.getDefaultState(), @@ -45,7 +45,7 @@ public WorldGenLayers(IBlockState block, PropertyInteger prop, int dropHeight, i this(block, prop, dropHeight, range, scatter); - this.validGroundBlocks = validGroundBlocks; + this.setValidGroundBlocks(validGroundBlocks); } @Override @@ -94,4 +94,70 @@ public boolean generate(World world, Random rand, BlockPos pos) { return true; } + + public IBlockState getLayerBlock() { + + return layerBlock; + } + + public WorldGenLayers setLayerBlock(IBlockState layerBlock) { + + this.layerBlock = layerBlock; + return this; + } + + public PropertyInteger getLayerProperty() { + + return layerProperty; + } + + public WorldGenLayers setLayerProperty(PropertyInteger layerProperty) { + + this.layerProperty = layerProperty; + return this; + } + + public int getDropHeight() { + + return dropHeight; + } + + public WorldGenLayers setDropHeight(int dropHeight) { + + this.dropHeight = dropHeight; + return this; + } + + public int getLayerRange() { + + return layerRange; + } + + public WorldGenLayers setLayerRange(int layerRange) { + + this.layerRange = layerRange; + return this; + } + + public int getScatter() { + + return scatter; + } + + public WorldGenLayers setScatter(int scatter) { + + this.scatter = scatter; + return this; + } + + public ArrayList getValidGroundBlocks() { + + return validGroundBlocks; + } + + public WorldGenLayers setValidGroundBlocks(ArrayList validGroundBlocks) { + + this.validGroundBlocks = validGroundBlocks; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/gen/feature/WorldGenLog.java b/src/main/java/rtg/world/gen/feature/WorldGenLog.java index 7266eac08..930f65713 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenLog.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenLog.java @@ -27,8 +27,8 @@ public class WorldGenLog extends WorldGenerator { */ public WorldGenLog(IBlockState logBlock, IBlockState leavesBlock, int logLength) { - this.logBlock = logBlock; - this.leavesBlock = leavesBlock; + this.setLogBlock(logBlock); + this.setLeavesBlock(leavesBlock); this.logLength = logLength; this.generateLeaves = false; @@ -166,4 +166,26 @@ private void addLeaves(World world, Random rand, int dir, int x, int y, int z) { world.setBlockState(new BlockPos(x, y + 1, z), leavesBlock, 2); } } + + public IBlockState getLogBlock() { + + return logBlock; + } + + public WorldGenLog setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public IBlockState getLeavesBlock() { + + return leavesBlock; + } + + public WorldGenLog setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } } diff --git a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java index bcca2997a..478fe59fd 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -24,7 +24,7 @@ public class WorldGenVinesRTG extends WorldGenerator { public WorldGenVinesRTG() { this.vineBlock = Blocks.VINE; - this.maxY = 254; + this.setMaxY(254); this.propNorth = BlockVine.NORTH; this.propEast = BlockVine.EAST; this.propSouth = BlockVine.SOUTH; @@ -36,7 +36,7 @@ public WorldGenVinesRTG(Block vineBlock, int maxY, PropertyBool propNorth, Prope this(); this.vineBlock = vineBlock; - this.maxY = maxY; + this.setMaxY(maxY); this.propNorth = propNorth; this.propEast = propEast; this.propSouth = propSouth; @@ -85,4 +85,70 @@ protected void addVine(World worldIn, Random rand, BlockPos pos, EnumFacing enum pos = pos.down(); } } + + public Block getVineBlock() { + + return vineBlock; + } + + public WorldGenVinesRTG setVineBlock(Block vineBlock) { + + this.vineBlock = vineBlock; + return this; + } + + public int getMaxY() { + + return maxY; + } + + public WorldGenVinesRTG setMaxY(int maxY) { + + this.maxY = maxY; + return this; + } + + public PropertyBool getPropNorth() { + + return propNorth; + } + + public WorldGenVinesRTG setPropNorth(PropertyBool propNorth) { + + this.propNorth = propNorth; + return this; + } + + public PropertyBool getPropEast() { + + return propEast; + } + + public WorldGenVinesRTG setPropEast(PropertyBool propEast) { + + this.propEast = propEast; + return this; + } + + public PropertyBool getPropSouth() { + + return propSouth; + } + + public WorldGenVinesRTG setPropSouth(PropertyBool propSouth) { + + this.propSouth = propSouth; + return this; + } + + public PropertyBool getPropWest() { + + return propWest; + } + + public WorldGenVinesRTG setPropWest(PropertyBool propWest) { + + this.propWest = propWest; + return this; + } } \ No newline at end of file diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java index 86255413a..8eec12787 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java @@ -26,22 +26,22 @@ */ public class TreeRTG extends WorldGenAbstractTree { - public IBlockState logBlock; - public IBlockState leavesBlock; - public int trunkSize; - public int crownSize; - public boolean noLeaves; + protected IBlockState logBlock; + protected IBlockState leavesBlock; + protected int trunkSize; + protected int crownSize; + protected boolean noLeaves; - public IBlockState saplingBlock; + protected IBlockState saplingBlock; - public int generateFlag; + protected int generateFlag; - public int minTrunkSize; - public int maxTrunkSize; - public int minCrownSize; - public int maxCrownSize; + protected int minTrunkSize; + protected int maxTrunkSize; + protected int minCrownSize; + protected int maxCrownSize; - public ArrayList validGroundBlocks; + protected ArrayList validGroundBlocks; protected RTGConfig rtgConfig = RTGAPI.config(); private boolean allowBarkCoveredLogs; @@ -55,21 +55,21 @@ public TreeRTG() { this(false); - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.trunkSize = 2; this.crownSize = 4; - this.noLeaves = false; + this.setNoLeaves(false); this.saplingBlock = Blocks.SAPLING.getDefaultState(); this.generateFlag = 2; // These need to default to zero as they're only used when generating trees from saplings. - this.minTrunkSize = 0; - this.maxTrunkSize = 0; - this.minCrownSize = 0; - this.maxCrownSize = 0; + this.setMinTrunkSize(0); + this.setMaxTrunkSize(0); + this.setMinCrownSize(0); + this.setMaxCrownSize(0); // Each tree sub-class is responsible for using (or not using) this list as part of its generation logic. this.validGroundBlocks = new ArrayList(Arrays.asList( @@ -231,7 +231,7 @@ public IBlockState getLogBlock() { public TreeRTG setLogBlock(IBlockState logBlock) { - this.logBlock = logBlock; + this.setLogBlock(logBlock); return this; } @@ -242,7 +242,7 @@ public IBlockState getLeavesBlock() { public TreeRTG setLeavesBlock(IBlockState leavesBlock) { - this.leavesBlock = leavesBlock; + this.setLeavesBlock(leavesBlock); return this; } @@ -275,7 +275,7 @@ public boolean getNoLeaves() { public TreeRTG setNoLeaves(boolean noLeaves) { - this.noLeaves = noLeaves; + this.setNoLeaves(noLeaves); return this; } @@ -308,7 +308,7 @@ public int getMinTrunkSize() { public TreeRTG setMinTrunkSize(int minTrunkSize) { - this.minTrunkSize = minTrunkSize; + this.setMinTrunkSize(minTrunkSize); return this; } @@ -319,7 +319,7 @@ public int getMaxTrunkSize() { public TreeRTG setMaxTrunkSize(int maxTrunkSize) { - this.maxTrunkSize = maxTrunkSize; + this.setMaxTrunkSize(maxTrunkSize); return this; } @@ -330,7 +330,7 @@ public int getMinCrownSize() { public TreeRTG setMinCrownSize(int minCrownSize) { - this.minCrownSize = minCrownSize; + this.setMinCrownSize(minCrownSize); return this; } @@ -341,18 +341,7 @@ public int getMaxCrownSize() { public TreeRTG setMaxCrownSize(int maxCrownSize) { - this.maxCrownSize = maxCrownSize; - return this; - } - - public boolean isAllowBarkCoveredLogs() { - - return allowBarkCoveredLogs; - } - - public TreeRTG setAllowBarkCoveredLogs(boolean allowBarkCoveredLogs) { - - this.allowBarkCoveredLogs = allowBarkCoveredLogs; + this.setMaxCrownSize(maxCrownSize); return this; } @@ -363,7 +352,7 @@ public ArrayList getValidGroundBlocks() { public TreeRTG setValidGroundBlocks(ArrayList validGroundBlocks) { - this.validGroundBlocks = validGroundBlocks; + this.setValidGroundBlocks(validGroundBlocks); return this; } } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java index b27a520dd..80a2377b0 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java @@ -18,26 +18,26 @@ public class TreeRTGAcaciaAbyssinica extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGAcaciaAbyssinica());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG2;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG2);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES2;
+ * decoTree.setLeavesBlock(Blocks.LEAVES2);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 6;
- * decoTree.maxTrunkSize = 16;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(6);
+ * decoTree.setMaxTrunkSize(16);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGAcaciaAbyssinica() { super(); - this.logBlock = Blocks.LOG2.getDefaultState(); - this.leavesBlock = Blocks.LEAVES2.getDefaultState(); + this.setLogBlock(Blocks.LOG2.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); this.trunkSize = 12; } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java index cfb883f52..787af0072 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java @@ -18,26 +18,26 @@ public class TreeRTGAcaciaBucheri extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGAcaciaBucheri());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG2;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG2);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES2;
+ * decoTree.setLeavesBlock(Blocks.LEAVES2);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 6;
- * decoTree.maxTrunkSize = 16;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(6);
+ * decoTree.setMaxTrunkSize(16);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGAcaciaBucheri() { super(); - this.logBlock = Blocks.LOG2.getDefaultState(); - this.leavesBlock = Blocks.LEAVES2.getDefaultState(); + this.setLogBlock(Blocks.LOG2.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES2.getDefaultState()); this.trunkSize = 10; } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java index 8f2acb946..2ecf8ba6e 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java @@ -18,28 +18,28 @@ public class TreeRTGBetulaPapyrifera extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGBetulaPapyrifera());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)2;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)2;
- * decoTree.minTrunkSize = 6;
- * decoTree.maxTrunkSize = 8;
- * decoTree.minCrownSize = 8;
- * decoTree.maxCrownSize = 24;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(6);
+ * decoTree.setMaxTrunkSize(8);
+ * decoTree.setMinCrownSize(8);
+ * decoTree.setMaxCrownSize(24);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGBetulaPapyrifera() { super(); - this.logBlock = BlockUtil.getStateLog(2); - this.leavesBlock = BlockUtil.getStateLeaf(2); + this.setLogBlock(BlockUtil.getStateLog(2)); + this.setLeavesBlock(BlockUtil.getStateLeaf(2)); } @Override diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java index 72e89a2eb..973e24f8b 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java @@ -24,20 +24,20 @@ public class TreeRTGCeibaPentandra extends TreeRTG { * length, branch, verStart, verRand

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f));
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 4;
- * decoTree.minCrownSize = 10;
- * decoTree.maxCrownSize = 24;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(3);
+ * decoTree.setMaxTrunkSize(4);
+ * decoTree.setMinCrownSize(10);
+ * decoTree.setMaxCrownSize(24);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGCeibaPentandra() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java index e97aa1f7e..c0b022f1f 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java @@ -25,20 +25,20 @@ public class TreeRTGCeibaRosea extends TreeRTG { * length, branch, verStart, verRand

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f));
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 4;
- * decoTree.minCrownSize = 10;
- * decoTree.maxCrownSize = 24;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(3);
+ * decoTree.setMaxTrunkSize(4);
+ * decoTree.setMinCrownSize(10);
+ * decoTree.setMaxCrownSize(24);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGCeibaRosea() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java index 86e330347..0cf027654 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java @@ -79,28 +79,28 @@ public class TreeRTGCocosNucifera extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGCocosNucifera());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)3;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)3;
- * decoTree.minTrunkSize = 7;
- * decoTree.maxTrunkSize = 8;
- * decoTree.minCrownSize = 7;
- * decoTree.maxCrownSize = 10;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(7);
+ * decoTree.setMaxTrunkSize(8);
+ * decoTree.setMinCrownSize(7);
+ * decoTree.setMaxCrownSize(10);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGCocosNucifera() { super(); - this.logBlock = BlockUtil.getStateLog(3); - this.leavesBlock = BlockUtil.getStateLeaf(3); + this.setLogBlock(BlockUtil.getStateLog(3)); + this.setLeavesBlock(BlockUtil.getStateLeaf(3)); this.trunkSize = 8; this.crownSize = 7; } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java index 9a600b4f1..acb97bbad 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java @@ -16,20 +16,20 @@ public class TreeRTGCupressusSempervirens extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGCupressusSempervirens());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)1;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)1;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 6;
- * decoTree.minCrownSize = 5;
- * decoTree.maxCrownSize = 10;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(3);
+ * decoTree.setMaxTrunkSize(6);
+ * decoTree.setMinCrownSize(5);
+ * decoTree.setMaxCrownSize(10);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGCupressusSempervirens() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java index 3e7b9c50e..e3568b23d 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java @@ -16,20 +16,20 @@ public class TreeRTGPiceaPungens extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGPiceaPungens());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)1;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)1;
- * decoTree.minTrunkSize = 2;
- * decoTree.maxTrunkSize = 7;
- * decoTree.minCrownSize = 6;
- * decoTree.maxCrownSize = 17;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(2);
+ * decoTree.setMaxTrunkSize(7);
+ * decoTree.setMinCrownSize(6);
+ * decoTree.setMaxCrownSize(17);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGPiceaPungens() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java index 5e33a0f51..d1e3e86c0 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java @@ -18,31 +18,31 @@ public class TreeRTGPiceaSitchensis extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGPiceaSitchensis());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)1;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)1;
- * decoTree.minTrunkSize = 4;
- * decoTree.maxTrunkSize = 9;
- * decoTree.minCrownSize = 5;
- * decoTree.maxCrownSize = 14;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(4);
+ * decoTree.setMaxTrunkSize(9);
+ * decoTree.setMinCrownSize(5);
+ * decoTree.setMaxCrownSize(14);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGPiceaSitchensis() { super(); - this.logBlock = BlockUtil.getStateLog(1); - this.leavesBlock = BlockUtil.getStateLeaf(1); + this.setLogBlock(BlockUtil.getStateLog(1)); + this.setLeavesBlock(BlockUtil.getStateLeaf(1)); this.trunkSize = 8; this.crownSize = 10; - this.noLeaves = false; + this.setNoLeaves(false); } @Override diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java index ea8674744..5860487ef 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java @@ -26,20 +26,20 @@ public class TreeRTGPinusMonticola extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGPinusMonticola());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 2;
- * decoTree.maxTrunkSize = 3;
- * decoTree.minCrownSize = 5;
- * decoTree.maxCrownSize = 12;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(2);
+ * decoTree.setMaxTrunkSize(3);
+ * decoTree.setMinCrownSize(5);
+ * decoTree.setMaxCrownSize(12);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGPinusMonticola() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java index e89f3ee32..a1958340b 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java @@ -20,20 +20,20 @@ public class TreeRTGPinusNigra extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGPinusNigra());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 18;
- * decoTree.maxTrunkSize = 27;
- * decoTree.minCrownSize = 7;
- * decoTree.maxCrownSize = 10;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(18);
+ * decoTree.setMaxTrunkSize(27);
+ * decoTree.setMinCrownSize(7);
+ * decoTree.setMaxCrownSize(10);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGPinusNigra() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java index 37113a1f5..61aa08fe7 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java @@ -21,20 +21,20 @@ public class TreeRTGPinusPonderosa extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGPinusPonderosa());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.minTrunkSize = 11;
- * decoTree.maxTrunkSize = 21;
- * decoTree.minCrownSize = 15;
- * decoTree.maxCrownSize = 29;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(11);
+ * decoTree.setMaxTrunkSize(21);
+ * decoTree.setMinCrownSize(15);
+ * decoTree.setMaxCrownSize(29);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGPinusPonderosa() { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java index e032630dc..db0437bbf 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java @@ -41,24 +41,24 @@ public class TreeRTGQuercusRobur extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGQuercusRobur());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.noLeaves = false;
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGQuercusRobur() { super(); - this.logBlock = Blocks.LOG.getDefaultState(); - this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.setLogBlock(Blocks.LOG.getDefaultState()); + this.setLeavesBlock(Blocks.LEAVES.getDefaultState()); this.trunkSize = 4; this.crownSize = 8; } diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java index 650ebba26..c496728f1 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java @@ -26,20 +26,20 @@ public class TreeRTGRhizophoraMucronata extends TreeRTG { * minBranches, maxBranches, branchLength, verStart, verRand

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f));
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)3;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)3;
- * decoTree.minTrunkSize = 3;
- * decoTree.maxTrunkSize = 4;
- * decoTree.minCrownSize = 10;
- * decoTree.maxCrownSize = 27;
- * decoTree.noLeaves = false;
+ * decoTree.setMinTrunkSize(3);
+ * decoTree.setMaxTrunkSize(4);
+ * decoTree.setMinCrownSize(10);
+ * decoTree.setMaxCrownSize(27);
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGRhizophoraMucronata(int minBranches, int maxBranches, float branchLength, float verStart, float verRand) { diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java index 2b63a8228..3d01e7ca0 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java @@ -22,16 +22,16 @@ public class TreeRTGSalixMyrtilloides extends TreeRTG { * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

* DecoTree example:
* DecoTree decoTree = new DecoTree(new TreeRTGSalixMyrtilloides());
- * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
- * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
- * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
- * decoTree.treeConditionNoise = 0f;
- * decoTree.treeConditionChance = 4;
- * decoTree.logBlock = Blocks.LOG;
+ * decoTree.setTreeType(DecoTree.TreeType.RTG_TREE);
+ * decoTree.setTreeCondition(DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE);
+ * decoTree.setDistribution(new DecoTree.Distribution(100f, 6f, 0.8f));
+ * decoTree.setTreeConditionNoise(0f);
+ * decoTree.setTreeConditionChance(4);
+ * decoTree.setLogBlock(Blocks.LOG);
* decoTree.logMeta = (byte)0;
- * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.setLeavesBlock(Blocks.LEAVES);
* decoTree.leavesMeta = (byte)0;
- * decoTree.noLeaves = false;
+ * decoTree.setNoLeaves(false);
* this.addDeco(decoTree); */ public TreeRTGSalixMyrtilloides() { From d8d5dfc4e6565b2c95049979f74c6345e3874e8e Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Wed, 14 Dec 2016 16:23:11 +0000 Subject: [PATCH 15/22] Fixed overloaded constructor in DecoTree. --- src/main/java/rtg/world/biome/deco/DecoTree.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index 62e0e4acd..cf605995a 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -94,9 +94,11 @@ public DecoTree(DecoTree source) { this.strengthNoiseFactorXForLoops = source.strengthNoiseFactorXForLoops; this.treeType = source.treeType; this.tree = source.tree; + this.worldGen = source.worldGen; this.distribution = source.distribution; this.treeCondition = source.treeCondition; this.treeConditionNoise = source.treeConditionNoise; + this.treeConditionFloat = source.treeConditionFloat; this.treeConditionChance = source.treeConditionChance; this.minY = source.minY; this.maxY = source.maxY; From 5ecea208ca2992052df3d0ee54ba58e50378afd6 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sat, 24 Dec 2016 02:52:21 +0000 Subject: [PATCH 16/22] Fixed infinite setter recursion in decos & worldgen. --- .../java/rtg/world/biome/deco/DecoBase.java | 2 +- .../biome/deco/DecoBaseBiomeDecorations.java | 4 +- .../rtg/world/biome/deco/DecoBoulder.java | 6 +-- .../java/rtg/world/biome/deco/DecoCactus.java | 8 ++-- .../rtg/world/biome/deco/DecoCobwebs.java | 8 ++-- .../java/rtg/world/biome/deco/DecoCrop.java | 4 +- .../rtg/world/biome/deco/DecoDeadBush.java | 4 +- .../rtg/world/biome/deco/DecoDesertWell.java | 4 +- .../rtg/world/biome/deco/DecoDoubleGrass.java | 2 +- .../rtg/world/biome/deco/DecoFallenTree.java | 20 ++++----- .../rtg/world/biome/deco/DecoFlowersRTG.java | 12 ++--- .../java/rtg/world/biome/deco/DecoGrass.java | 4 +- .../biome/deco/DecoGrassDoubleTallgrass.java | 4 +- .../rtg/world/biome/deco/DecoJungleCacti.java | 8 ++-- .../deco/DecoLargeFernDoubleTallgrass.java | 2 +- .../java/rtg/world/biome/deco/DecoLayer.java | 4 +- .../rtg/world/biome/deco/DecoMushrooms.java | 8 ++-- .../rtg/world/biome/deco/DecoPumpkin.java | 8 ++-- .../java/rtg/world/biome/deco/DecoReed.java | 2 +- .../java/rtg/world/biome/deco/DecoShrub.java | 28 ++++++------ .../java/rtg/world/biome/deco/DecoTree.java | 44 +++++++++---------- .../java/rtg/world/biome/deco/DecoVines.java | 8 ++-- .../deco/helper/DecoHelperThisOrThat.java | 2 +- .../rtg/world/gen/feature/WorldGenLog.java | 4 +- .../world/gen/feature/WorldGenVinesRTG.java | 2 +- .../world/gen/feature/tree/rtg/TreeRTG.java | 16 +++---- 26 files changed, 109 insertions(+), 109 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoBase.java b/src/main/java/rtg/world/biome/deco/DecoBase.java index 148a54619..118f79f33 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBase.java +++ b/src/main/java/rtg/world/biome/deco/DecoBase.java @@ -198,7 +198,7 @@ public float getMaxRiver() { public DecoBase setMaxRiver(float maxRiver) { - this.setMaxRiver(maxRiver); + this.maxRiver = maxRiver; return this; } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java index c551ee8d9..22cd8002d 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java +++ b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java @@ -110,7 +110,7 @@ public int getEqualsZeroChance() { public DecoBaseBiomeDecorations setEqualsZeroChance(int equalsZeroChance) { - this.setEqualsZeroChance(equalsZeroChance); + this.equalsZeroChance = equalsZeroChance; return this; } @@ -121,7 +121,7 @@ public int getNotEqualsZeroChance() { public DecoBaseBiomeDecorations setNotEqualsZeroChance(int notEqualsZeroChance) { - this.setNotEqualsZeroChance(notEqualsZeroChance); + this.notEqualsZeroChance = notEqualsZeroChance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoBoulder.java b/src/main/java/rtg/world/biome/deco/DecoBoulder.java index c27062a6b..d513b8d28 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBoulder.java +++ b/src/main/java/rtg/world/biome/deco/DecoBoulder.java @@ -77,7 +77,7 @@ public IBlockState getBoulderBlock() { public DecoBoulder setBoulderBlock(IBlockState boulderBlock) { - this.setBoulderBlock(boulderBlock); + this.boulderBlock = boulderBlock; return this; } @@ -88,7 +88,7 @@ public float getStrengthFactor() { public DecoBoulder setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -121,7 +121,7 @@ public int getChance() { public DecoBoulder setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoCactus.java b/src/main/java/rtg/world/biome/deco/DecoCactus.java index 9521b5438..9c5cc6579 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCactus.java +++ b/src/main/java/rtg/world/biome/deco/DecoCactus.java @@ -86,7 +86,7 @@ public int getChance() { public DecoCactus setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } @@ -97,7 +97,7 @@ public float getStrengthFactor() { public DecoCactus setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -119,7 +119,7 @@ public boolean isSandOnly() { public DecoCactus setSandOnly(boolean sandOnly) { - this.setSandOnly(sandOnly); + this.sandOnly = sandOnly; return this; } @@ -130,7 +130,7 @@ public IBlockState getSoilBlock() { public DecoCactus setSoilBlock(IBlockState soilBlock) { - this.setSoilBlock(soilBlock); + this.soilBlock = soilBlock; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoCobwebs.java b/src/main/java/rtg/world/biome/deco/DecoCobwebs.java index 1649b33d3..4268122be 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCobwebs.java +++ b/src/main/java/rtg/world/biome/deco/DecoCobwebs.java @@ -68,7 +68,7 @@ public float getStrengthFactor() { public DecoCobwebs setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -101,7 +101,7 @@ public int getChance() { public DecoCobwebs setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } @@ -112,7 +112,7 @@ public IBlockState getAdjacentBlock() { public DecoCobwebs setAdjacentBlock(IBlockState adjacentBlock) { - this.setAdjacentBlock(adjacentBlock); + this.adjacentBlock = adjacentBlock; return this; } @@ -123,7 +123,7 @@ public int getMinAdjacents() { public DecoCobwebs setMinAdjacents(int minAdjacents) { - this.setMinAdjacents(minAdjacents); + this.minAdjacents = minAdjacents; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoCrop.java b/src/main/java/rtg/world/biome/deco/DecoCrop.java index f82d35e3a..490d922b2 100644 --- a/src/main/java/rtg/world/biome/deco/DecoCrop.java +++ b/src/main/java/rtg/world/biome/deco/DecoCrop.java @@ -130,7 +130,7 @@ public float getStrengthFactor() { public DecoCrop setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -163,7 +163,7 @@ public int getChance() { public DecoCrop setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoDeadBush.java b/src/main/java/rtg/world/biome/deco/DecoDeadBush.java index 3603c267c..d1e98a2be 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDeadBush.java +++ b/src/main/java/rtg/world/biome/deco/DecoDeadBush.java @@ -69,7 +69,7 @@ public float getStrengthFactor() { public DecoDeadBush setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -91,7 +91,7 @@ public int getChance() { public DecoDeadBush setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoDesertWell.java b/src/main/java/rtg/world/biome/deco/DecoDesertWell.java index 1e298af7d..0a1d0bdf3 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDesertWell.java +++ b/src/main/java/rtg/world/biome/deco/DecoDesertWell.java @@ -65,7 +65,7 @@ public float getStrengthFactor() { public DecoDesertWell setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -98,7 +98,7 @@ public int getChance() { public DecoDesertWell setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java b/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java index 598752e96..be9794717 100644 --- a/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoDoubleGrass.java @@ -67,7 +67,7 @@ public float getStrengthFactor() { public DecoDoubleGrass setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java index 2ae93afd6..1dd351975 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFallenTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoFallenTree.java @@ -215,7 +215,7 @@ public int getLoops() { public DecoFallenTree setLoops(int loops) { - this.setLoops(loops); + this.loops = loops; return this; } @@ -226,7 +226,7 @@ public Distribution getDistribution() { public DecoFallenTree setDistribution(Distribution distribution) { - this.setDistribution(distribution); + this.distribution = distribution; return this; } @@ -237,7 +237,7 @@ public LogCondition getLogCondition() { public DecoFallenTree setLogCondition(LogCondition logCondition) { - this.setLogCondition(logCondition); + this.logCondition = logCondition; return this; } @@ -248,7 +248,7 @@ public float getLogConditionNoise() { public DecoFallenTree setLogConditionNoise(float logConditionNoise) { - this.setLogConditionNoise(logConditionNoise); + this.logConditionNoise = logConditionNoise; return this; } @@ -259,7 +259,7 @@ public int getLogConditionChance() { public DecoFallenTree setLogConditionChance(int logConditionChance) { - this.setLogConditionChance(logConditionChance); + this.logConditionChance = logConditionChance; return this; } @@ -270,7 +270,7 @@ public int getMaxY() { public DecoFallenTree setMaxY(int maxY) { - this.setMaxY(maxY); + this.maxY = maxY; return this; } @@ -281,7 +281,7 @@ public IBlockState getLogBlock() { public DecoFallenTree setLogBlock(IBlockState logBlock) { - this.setLogBlock(logBlock); + this.logBlock = logBlock; return this; } @@ -292,7 +292,7 @@ public IBlockState getLeavesBlock() { public DecoFallenTree setLeavesBlock(IBlockState leavesBlock) { - this.setLeavesBlock(leavesBlock); + this.leavesBlock = leavesBlock; return this; } @@ -303,7 +303,7 @@ public int getMinSize() { public DecoFallenTree setMinSize(int minSize) { - this.setMinSize(minSize); + this.minSize = minSize; return this; } @@ -314,7 +314,7 @@ public int getMaxSize() { public DecoFallenTree setMaxSize(int maxSize) { - this.setMaxSize(maxSize); + this.maxSize = maxSize; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java index 152c27fed..1f1cad4a3 100644 --- a/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java +++ b/src/main/java/rtg/world/biome/deco/DecoFlowersRTG.java @@ -139,7 +139,7 @@ public float getStrengthFactor() { public DecoFlowersRTG setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -150,7 +150,7 @@ public int getMinY() { public DecoFlowersRTG setMinY(int minY) { - this.setMinY(minY); + this.minY = minY; return this; } @@ -161,7 +161,7 @@ public int getMaxY() { public DecoFlowersRTG setMaxY(int maxY) { - this.setMaxY(maxY); + this.maxY = maxY; return this; } @@ -183,7 +183,7 @@ public int getChance() { public DecoFlowersRTG setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } @@ -194,7 +194,7 @@ public int getNotEqualsZeroChance() { public DecoFlowersRTG setNotEqualsZeroChance(int notEqualsZeroChance) { - this.setNotEqualsZeroChance(notEqualsZeroChance); + this.notEqualsZeroChance = notEqualsZeroChance; return this; } @@ -205,7 +205,7 @@ public int getLoops() { public DecoFlowersRTG setLoops(int loops) { - this.setLoops(loops); + this.loops = loops; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoGrass.java b/src/main/java/rtg/world/biome/deco/DecoGrass.java index 77cfe6dcd..8b30c08c2 100644 --- a/src/main/java/rtg/world/biome/deco/DecoGrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoGrass.java @@ -128,7 +128,7 @@ public float getStrengthFactor() { public DecoGrass setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -172,7 +172,7 @@ public int getChance() { public DecoGrass setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java b/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java index f73fdde2a..b09a27542 100644 --- a/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java @@ -105,7 +105,7 @@ public float getStrengthFactor() { public DecoGrassDoubleTallgrass setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -149,7 +149,7 @@ public int getDoubleGrassChance() { public DecoGrassDoubleTallgrass setDoubleGrassChance(int doubleGrassChance) { - this.setDoubleGrassChance(doubleGrassChance); + this.doubleGrassChance = doubleGrassChance; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java b/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java index 50b57031c..8e02f99cb 100644 --- a/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java +++ b/src/main/java/rtg/world/biome/deco/DecoJungleCacti.java @@ -69,7 +69,7 @@ public float getStrengthFactor() { public DecoJungleCacti setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -91,7 +91,7 @@ public boolean isSandOnly() { public DecoJungleCacti setSandOnly(boolean sandOnly) { - this.setSandOnly(sandOnly); + this.sandOnly = sandOnly; return this; } @@ -102,7 +102,7 @@ public int getExtraHeight() { public DecoJungleCacti setExtraHeight(int extraHeight) { - this.setExtraHeight(extraHeight); + this.extraHeight = extraHeight; return this; } @@ -113,7 +113,7 @@ public byte getSandMeta() { public DecoJungleCacti setSandMeta(byte sandMeta) { - this.setSandMeta(sandMeta); + this.sandMeta = sandMeta; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java b/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java index e3b69baa1..d1a6b3391 100644 --- a/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java +++ b/src/main/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java @@ -108,7 +108,7 @@ public float getStrengthFactor() { public DecoLargeFernDoubleTallgrass setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoLayer.java b/src/main/java/rtg/world/biome/deco/DecoLayer.java index 9c1cc3e54..f6710365e 100644 --- a/src/main/java/rtg/world/biome/deco/DecoLayer.java +++ b/src/main/java/rtg/world/biome/deco/DecoLayer.java @@ -159,7 +159,7 @@ public float getStrengthFactor() { public DecoLayer setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -192,7 +192,7 @@ public int getChance() { public DecoLayer setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoMushrooms.java b/src/main/java/rtg/world/biome/deco/DecoMushrooms.java index e0c04c06e..14dad558c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoMushrooms.java +++ b/src/main/java/rtg/world/biome/deco/DecoMushrooms.java @@ -106,7 +106,7 @@ public float getStrengthFactor() { public DecoMushrooms setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -128,7 +128,7 @@ public float getRandomFloat() { public DecoMushrooms setRandomFloat(float randomFloat) { - this.setRandomFloat(randomFloat); + this.randomFloat = randomFloat; return this; } @@ -139,7 +139,7 @@ public RandomType getRandomType() { public DecoMushrooms setRandomType(RandomType randomType) { - this.setRandomType(randomType); + this.randomType = randomType; return this; } @@ -150,7 +150,7 @@ public int getChance() { public DecoMushrooms setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoPumpkin.java b/src/main/java/rtg/world/biome/deco/DecoPumpkin.java index c84a49def..ae8d5750c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoPumpkin.java +++ b/src/main/java/rtg/world/biome/deco/DecoPumpkin.java @@ -98,7 +98,7 @@ public float getStrengthFactor() { public DecoPumpkin setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -120,7 +120,7 @@ public float getRandomFloat() { public DecoPumpkin setRandomFloat(float randomFloat) { - this.setRandomFloat(randomFloat); + this.randomFloat = randomFloat; return this; } @@ -131,7 +131,7 @@ public RandomType getRandomType() { public DecoPumpkin setRandomType(RandomType randomType) { - this.setRandomType(randomType); + this.randomType = randomType; return this; } @@ -142,7 +142,7 @@ public int getChance() { public DecoPumpkin setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoReed.java b/src/main/java/rtg/world/biome/deco/DecoReed.java index 3954523c7..32b1809e8 100644 --- a/src/main/java/rtg/world/biome/deco/DecoReed.java +++ b/src/main/java/rtg/world/biome/deco/DecoReed.java @@ -66,7 +66,7 @@ public float getStrengthFactor() { public DecoReed setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } diff --git a/src/main/java/rtg/world/biome/deco/DecoShrub.java b/src/main/java/rtg/world/biome/deco/DecoShrub.java index 3422ee305..99bf4e46c 100644 --- a/src/main/java/rtg/world/biome/deco/DecoShrub.java +++ b/src/main/java/rtg/world/biome/deco/DecoShrub.java @@ -21,7 +21,7 @@ public class DecoShrub extends DecoBase { private int size; private boolean useDefaultRandom; - private boolean Sand; + private boolean sand; private IBlockState[] randomLogBlocks; private IBlockState[] randomLeavesBlocks; private float strengthFactor; // Higher = more/bigger shrubs. @@ -45,7 +45,7 @@ public DecoShrub() { */ this.size = -1; this.useDefaultRandom = false; - this.Sand = true; //Whether shrubs generate on sand + this.sand = true; //Whether shrubs generate on sand this.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}; this.randomLeavesBlocks = new IBlockState[]{Blocks.LEAVES.getDefaultState(), BlockUtil.getStateLeaf(1)}; this.setStrengthFactor(3f); // Not sure why it was done like this, but... the higher the value, the more there will be. @@ -92,7 +92,7 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i } WorldUtil worldUtil = new WorldUtil(rtgWorld.world); - WorldGenerator worldGenerator = new WorldGenShrubRTG(this.size, this.logBlock, this.leavesBlock, this.Sand); + WorldGenerator worldGenerator = new WorldGenShrubRTG(this.size, this.logBlock, this.leavesBlock, this.sand); int loopCount = this.loops; loopCount = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : loopCount; @@ -152,12 +152,12 @@ public DecoShrub setUseDefaultRandom(boolean useDefaultRandom) { public boolean isSand() { - return Sand; + return sand; } public DecoShrub setSand(boolean sand) { - Sand = sand; + this.sand = sand; return this; } @@ -190,7 +190,7 @@ public float getStrengthFactor() { public DecoShrub setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -201,7 +201,7 @@ public int getMinY() { public DecoShrub setMinY(int minY) { - this.setMinY(minY); + this.minY = minY; return this; } @@ -212,7 +212,7 @@ public int getMaxY() { public DecoShrub setMaxY(int maxY) { - this.setMaxY(maxY); + this.maxY = maxY; return this; } @@ -223,7 +223,7 @@ public int getChance() { public DecoShrub setChance(int chance) { - this.setChance(chance); + this.chance = chance; return this; } @@ -245,7 +245,7 @@ public int getLoops() { public DecoShrub setLoops(int loops) { - this.setLoops(loops); + this.loops = loops; return this; } @@ -256,7 +256,7 @@ public int getMinSize() { public DecoShrub setMinSize(int minSize) { - this.setMinSize(minSize); + this.minSize = minSize; return this; } @@ -267,7 +267,7 @@ public int getMaxSize() { public DecoShrub setMaxSize(int maxSize) { - this.setMaxSize(maxSize); + this.maxSize = maxSize; return this; } @@ -278,7 +278,7 @@ public IBlockState getLogBlock() { public DecoShrub setLogBlock(IBlockState logBlock) { - this.setLogBlock(logBlock); + this.logBlock = logBlock; return this; } @@ -289,7 +289,7 @@ public IBlockState getLeavesBlock() { public DecoShrub setLeavesBlock(IBlockState leavesBlock) { - this.setLeavesBlock(leavesBlock); + this.leavesBlock = leavesBlock; return this; } } \ No newline at end of file diff --git a/src/main/java/rtg/world/biome/deco/DecoTree.java b/src/main/java/rtg/world/biome/deco/DecoTree.java index a78442d62..015162f00 100644 --- a/src/main/java/rtg/world/biome/deco/DecoTree.java +++ b/src/main/java/rtg/world/biome/deco/DecoTree.java @@ -373,7 +373,7 @@ public int getLoops() { public DecoTree setLoops(int loops) { - this.setLoops(loops); + this.loops = loops; return this; } @@ -384,7 +384,7 @@ public float getStrengthFactorForLoops() { public DecoTree setStrengthFactorForLoops(float strengthFactorForLoops) { - this.setStrengthFactorForLoops(strengthFactorForLoops); + this.strengthFactorForLoops = strengthFactorForLoops; return this; } @@ -395,7 +395,7 @@ public boolean isStrengthNoiseFactorForLoops() { public DecoTree setStrengthNoiseFactorForLoops(boolean strengthNoiseFactorForLoops) { - this.setStrengthNoiseFactorForLoops(strengthNoiseFactorForLoops); + this.strengthNoiseFactorForLoops = strengthNoiseFactorForLoops; return this; } @@ -406,7 +406,7 @@ public boolean isStrengthNoiseFactorXForLoops() { public DecoTree setStrengthNoiseFactorXForLoops(boolean strengthNoiseFactorXForLoops) { - this.setStrengthNoiseFactorXForLoops(strengthNoiseFactorXForLoops); + this.strengthNoiseFactorXForLoops = strengthNoiseFactorXForLoops; return this; } @@ -417,7 +417,7 @@ public TreeType getTreeType() { public DecoTree setTreeType(TreeType treeType) { - this.setTreeType(treeType); + this.treeType = treeType; return this; } @@ -450,7 +450,7 @@ public Distribution getDistribution() { public DecoTree setDistribution(Distribution distribution) { - this.setDistribution(distribution); + this.distribution = distribution; return this; } @@ -461,7 +461,7 @@ public TreeCondition getTreeCondition() { public DecoTree setTreeCondition(TreeCondition treeCondition) { - this.setTreeCondition(treeCondition); + this.treeCondition = treeCondition; return this; } @@ -472,7 +472,7 @@ public float getTreeConditionNoise() { public DecoTree setTreeConditionNoise(float treeConditionNoise) { - this.setTreeConditionNoise(treeConditionNoise); + this.treeConditionNoise = treeConditionNoise; return this; } @@ -483,7 +483,7 @@ public float getTreeConditionNoise2() { public DecoTree setTreeConditionNoise2(float treeConditionNoise2) { - this.setTreeConditionNoise2(treeConditionNoise2); + this.treeConditionNoise2 = treeConditionNoise2; return this; } @@ -505,7 +505,7 @@ public float getTreeConditionFloat() { public DecoTree setTreeConditionFloat(float treeConditionFloat) { - this.setTreeConditionFloat(treeConditionFloat); + this.treeConditionFloat = treeConditionFloat; return this; } @@ -516,7 +516,7 @@ public int getMinY() { public DecoTree setMinY(int minY) { - this.setMinY(minY); + this.minY = minY; return this; } @@ -527,7 +527,7 @@ public int getMaxY() { public DecoTree setMaxY(int maxY) { - this.setMaxY(maxY); + this.maxY = maxY; return this; } @@ -538,7 +538,7 @@ public IBlockState getLogBlock() { public DecoTree setLogBlock(IBlockState logBlock) { - this.setLogBlock(logBlock); + this.logBlock = logBlock; return this; } @@ -549,7 +549,7 @@ public IBlockState getLeavesBlock() { public DecoTree setLeavesBlock(IBlockState leavesBlock) { - this.setLeavesBlock(leavesBlock); + this.leavesBlock = leavesBlock; return this; } @@ -560,7 +560,7 @@ public int getMinSize() { public DecoTree setMinSize(int minSize) { - this.setMinSize(minSize); + this.minSize = minSize; return this; } @@ -571,7 +571,7 @@ public int getMaxSize() { public DecoTree setMaxSize(int maxSize) { - this.setMaxSize(maxSize); + this.maxSize = maxSize; return this; } @@ -582,7 +582,7 @@ public int getMinTrunkSize() { public DecoTree setMinTrunkSize(int minTrunkSize) { - this.setMinTrunkSize(minTrunkSize); + this.minTrunkSize = minTrunkSize; return this; } @@ -593,7 +593,7 @@ public int getMaxTrunkSize() { public DecoTree setMaxTrunkSize(int maxTrunkSize) { - this.setMaxTrunkSize(maxTrunkSize); + this.maxTrunkSize = maxTrunkSize; return this; } @@ -604,7 +604,7 @@ public int getMinCrownSize() { public DecoTree setMinCrownSize(int minCrownSize) { - this.setMinCrownSize(minCrownSize); + this.minCrownSize = minCrownSize; return this; } @@ -615,7 +615,7 @@ public int getMaxCrownSize() { public DecoTree setMaxCrownSize(int maxCrownSize) { - this.setMaxCrownSize(maxCrownSize); + this.maxCrownSize = maxCrownSize; return this; } @@ -626,7 +626,7 @@ public boolean isNoLeaves() { public DecoTree setNoLeaves(boolean noLeaves) { - this.setNoLeaves(noLeaves); + this.noLeaves = noLeaves; return this; } @@ -637,7 +637,7 @@ public Scatter getScatter() { public DecoTree setScatter(Scatter scatter) { - this.setScatter(scatter); + this.scatter = scatter; return this; } } diff --git a/src/main/java/rtg/world/biome/deco/DecoVines.java b/src/main/java/rtg/world/biome/deco/DecoVines.java index 92744135e..8242aae0d 100644 --- a/src/main/java/rtg/world/biome/deco/DecoVines.java +++ b/src/main/java/rtg/world/biome/deco/DecoVines.java @@ -97,7 +97,7 @@ public int getLoops() { public DecoVines setLoops(int loops) { - this.setLoops(loops); + this.loops = loops; return this; } @@ -108,7 +108,7 @@ public float getStrengthFactor() { public DecoVines setStrengthFactor(float strengthFactor) { - this.setStrengthFactor(strengthFactor); + this.strengthFactor = strengthFactor; return this; } @@ -130,7 +130,7 @@ public int getMinY() { public DecoVines setMinY(int minY) { - this.setMinY(minY); + this.minY = minY; return this; } @@ -141,7 +141,7 @@ public int getMaxY() { public DecoVines setMaxY(int maxY) { - this.setMaxY(maxY); + this.maxY = maxY; return this; } diff --git a/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java b/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java index 4fe9e0791..6a31f432a 100644 --- a/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java +++ b/src/main/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java @@ -23,7 +23,7 @@ public DecoHelperThisOrThat(int chance, ChanceType chanceType, DecoBase decoThis super(); - this.setChance(chance); + this.chance = chance; this.chanceType = chanceType; this.decoThis = decoThis; this.decoThat = decoThat; diff --git a/src/main/java/rtg/world/gen/feature/WorldGenLog.java b/src/main/java/rtg/world/gen/feature/WorldGenLog.java index 930f65713..3c717d0c1 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenLog.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenLog.java @@ -27,8 +27,8 @@ public class WorldGenLog extends WorldGenerator { */ public WorldGenLog(IBlockState logBlock, IBlockState leavesBlock, int logLength) { - this.setLogBlock(logBlock); - this.setLeavesBlock(leavesBlock); + this.logBlock = logBlock; + this.leavesBlock = leavesBlock; this.logLength = logLength; this.generateLeaves = false; diff --git a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java index 478fe59fd..3e5116767 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -36,7 +36,7 @@ public WorldGenVinesRTG(Block vineBlock, int maxY, PropertyBool propNorth, Prope this(); this.vineBlock = vineBlock; - this.setMaxY(maxY); + this.maxY = maxY; this.propNorth = propNorth; this.propEast = propEast; this.propSouth = propSouth; diff --git a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java index 8eec12787..40c1dd233 100644 --- a/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java +++ b/src/main/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java @@ -231,7 +231,7 @@ public IBlockState getLogBlock() { public TreeRTG setLogBlock(IBlockState logBlock) { - this.setLogBlock(logBlock); + this.logBlock = logBlock; return this; } @@ -242,7 +242,7 @@ public IBlockState getLeavesBlock() { public TreeRTG setLeavesBlock(IBlockState leavesBlock) { - this.setLeavesBlock(leavesBlock); + this.leavesBlock = leavesBlock; return this; } @@ -275,7 +275,7 @@ public boolean getNoLeaves() { public TreeRTG setNoLeaves(boolean noLeaves) { - this.setNoLeaves(noLeaves); + this.noLeaves = noLeaves; return this; } @@ -308,7 +308,7 @@ public int getMinTrunkSize() { public TreeRTG setMinTrunkSize(int minTrunkSize) { - this.setMinTrunkSize(minTrunkSize); + this.minTrunkSize = minTrunkSize; return this; } @@ -319,7 +319,7 @@ public int getMaxTrunkSize() { public TreeRTG setMaxTrunkSize(int maxTrunkSize) { - this.setMaxTrunkSize(maxTrunkSize); + this.maxTrunkSize = maxTrunkSize; return this; } @@ -330,7 +330,7 @@ public int getMinCrownSize() { public TreeRTG setMinCrownSize(int minCrownSize) { - this.setMinCrownSize(minCrownSize); + this.minCrownSize = minCrownSize; return this; } @@ -341,7 +341,7 @@ public int getMaxCrownSize() { public TreeRTG setMaxCrownSize(int maxCrownSize) { - this.setMaxCrownSize(maxCrownSize); + this.maxCrownSize = maxCrownSize; return this; } @@ -352,7 +352,7 @@ public ArrayList getValidGroundBlocks() { public TreeRTG setValidGroundBlocks(ArrayList validGroundBlocks) { - this.setValidGroundBlocks(validGroundBlocks); + this.validGroundBlocks = validGroundBlocks; return this; } } From 0a37d664a514dfd700320990fd92cb725ce15a6b Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Sat, 24 Dec 2016 02:52:52 +0000 Subject: [PATCH 17/22] Added biome support for Ars Magica 2. --- mod_deps.properties | 1 + src/main/java/rtg/RTG.java | 2 + .../arsmagica/RealisticBiomeAMBase.java | 48 ++++ .../RealisticBiomeAMWitchwoodForest.java | 224 ++++++++++++++++++ 4 files changed, 275 insertions(+) create mode 100644 src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMBase.java create mode 100644 src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMWitchwoodForest.java diff --git a/mod_deps.properties b/mod_deps.properties index dc5b6b61d..1a1a9518a 100644 --- a/mod_deps.properties +++ b/mod_deps.properties @@ -4,6 +4,7 @@ bopver=1.10.2-5.0.0.2085 acver=1.10.2-1.9.2.9 depstring=after:BiomesOPlenty@[5.0.0.2085,);\ after:AbyssalCraftAPI@[1.8.1,);\ + after:arsmagica2@[1.5.012,);\ after:betteragriculture@[0.16,);\ after:BiomesYouGo@[4.0.0,);\ after:CookingPlus@[0.8.7,);\ diff --git a/src/main/java/rtg/RTG.java b/src/main/java/rtg/RTG.java index 1c4fe8be1..75ecbd6d6 100644 --- a/src/main/java/rtg/RTG.java +++ b/src/main/java/rtg/RTG.java @@ -26,6 +26,7 @@ import rtg.world.WorldTypeRTG; import rtg.world.biome.realistic.abyssalcraft.RealisticBiomeACBase; import rtg.world.biome.realistic.agriculturalrevolution.RealisticBiomeARBase; +import rtg.world.biome.realistic.arsmagica.RealisticBiomeAMBase; import rtg.world.biome.realistic.betteragriculture.RealisticBiomeBABase; import rtg.world.biome.realistic.biomesoplenty.RealisticBiomeBOPBase; import rtg.world.biome.realistic.biomesyougo.RealisticBiomeBYGBase; @@ -96,6 +97,7 @@ public void initPost(FMLPostInitializationEvent event) { RealisticBiomeVanillaBase.addBiomes(); RealisticBiomeACBase.addBiomes(); + RealisticBiomeAMBase.addBiomes(); RealisticBiomeARBase.addBiomes(); RealisticBiomeBABase.addBiomes(); RealisticBiomeBOPBase.addBiomes(); diff --git a/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMBase.java b/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMBase.java new file mode 100644 index 000000000..c8e623698 --- /dev/null +++ b/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMBase.java @@ -0,0 +1,48 @@ +package rtg.world.biome.realistic.arsmagica; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; + +@SuppressWarnings("WeakerAccess") +public abstract class RealisticBiomeAMBase extends RealisticBiomeBase { + + public static RealisticBiomeBase amWitchwoodForest; + + public RealisticBiomeAMBase(Biome b, Biome river) { + + super(b, river); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + } + + @Override + public String modSlug() { + return "arsmagica2"; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("arsmagica2")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("WitchwoodForest") && biomeClass.equals("am2.world.BiomeWitchwoodForest")) { + amWitchwoodForest = new RealisticBiomeAMWitchwoodForest(biome); + } + } + } + } +} diff --git a/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMWitchwoodForest.java b/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMWitchwoodForest.java new file mode 100644 index 000000000..108cc1383 --- /dev/null +++ b/src/main/java/rtg/world/biome/realistic/arsmagica/RealisticBiomeAMWitchwoodForest.java @@ -0,0 +1,224 @@ +package rtg.world.biome.realistic.arsmagica; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.config.BiomeConfig; +import rtg.api.util.CliffCalculator; +import rtg.api.util.noise.OpenSimplexNoise; +import rtg.api.world.RTGWorld; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeAMWitchwoodForest extends RealisticBiomeAMBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeAMWitchwoodForest(Biome biome) { + + super(biome, river); + } + + @Override + public void initConfig() { + + this.getConfig().addProperty(this.getConfig().ALLOW_LOGS).set(true); + } + + @Override + public TerrainBase initTerrain() { + + return new TerrainAMWitchwoodForest(); + } + + public class TerrainAMWitchwoodForest extends TerrainBase + { + private float hillStrength = 10f;// this needs to be linked to the + + public TerrainAMWitchwoodForest() + { + + } + + @Override + public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundVariation, rtgWorld.simplex); + + float m = hills(x, y, hillStrength, rtgWorld.simplex, river); + + float floNoise = 65f + groundNoise + m; + + return riverized(floNoise,river); + } + } + + @Override + public SurfaceBase initSurface() { + + return new SurfaceAMWitchwoodForest(config, + this.baseBiome.topBlock, //Block top + this.baseBiome.fillerBlock, //Block filler, + this.baseBiome.topBlock, //IBlockState mixTop, + this.baseBiome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ); + } + + public class SurfaceAMWitchwoodForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceAMWitchwoodForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] base) { + + Random rand = rtgWorld.rand; + OpenSimplexNoise simplex = rtgWorld.simplex; + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(rtgWorld, i, j, x, z, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, z, hcStone(rtgWorld, i, j, x, z, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, z, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, z, blockMixFiller); + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } + } + } + + @Override + public void initDecos() { + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.setLogBlock(this.witchwoodLogBlock()); + decoShrub.setLeavesBlock(this.witchwoodLeavesBlock()); + decoShrub.setMaxY(110); + decoShrub.setStrengthFactor(4f); + decoShrub.setChance(6); + this.addDeco(decoShrub); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.getDistribution().setNoiseDivisor(80f); + decoFallenTree.getDistribution().setNoiseFactor(60f); + decoFallenTree.getDistribution().setNoiseAddend(-15f); + decoFallenTree.setLogCondition(DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE); + decoFallenTree.setLogConditionChance(6); + decoFallenTree.setLogConditionNoise(0f); + decoFallenTree.setLogBlock(this.witchwoodLogBlock()); + decoFallenTree.setLeavesBlock(this.witchwoodLeavesBlock()); + decoFallenTree.setMinSize(3); + decoFallenTree.setMaxSize(5); + this.addDeco(decoFallenTree, this.getConfig().ALLOW_LOGS.get()); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.setMaxY(128); + decoGrass.setLoops(8); + this.addDeco(decoGrass); + } + + private IBlockState witchwoodLogBlock() { + + IBlockState witchwoodLogBlock; + + try { + witchwoodLogBlock = Block.getBlockFromName("arsmagica2:witchwood_log").getDefaultState(); + } + catch (Exception e) { + witchwoodLogBlock = Blocks.LOG.getDefaultState(); + } + + return witchwoodLogBlock; + } + + private IBlockState witchwoodLeavesBlock() { + + IBlockState witchwoodLeavesBlock; + + try { + witchwoodLeavesBlock = Block.getBlockFromName("arsmagica2:witchwood_leaves").getDefaultState(); + } + catch (Exception e) { + witchwoodLeavesBlock = Blocks.LEAVES.getDefaultState(); + } + + return witchwoodLeavesBlock; + } +} From 15b78ab637d147bbc5111711c7db1284aaab35b4 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Mon, 26 Dec 2016 02:18:34 +0000 Subject: [PATCH 18/22] Better ore gen distribution in chunks that contain more than one biome. --- src/main/java/rtg/event/EventManagerRTG.java | 16 ++++++++++++++ .../biome/deco/DecoBaseBiomeDecorations.java | 22 +++++++++++-------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/main/java/rtg/event/EventManagerRTG.java b/src/main/java/rtg/event/EventManagerRTG.java index cc012e0ec..472971cda 100644 --- a/src/main/java/rtg/event/EventManagerRTG.java +++ b/src/main/java/rtg/event/EventManagerRTG.java @@ -86,75 +86,91 @@ public void generateMinableRTG(OreGenEvent.GenerateMinable event) { return; } + String eventName = null; OreGenEvent.GenerateMinable.EventType eventType = event.getType(); // No switch statements allowed! - Pink if (eventType == ANDESITE) { + eventName = "ANDESITE"; if (!rtgConfig.GENERATE_ORE_ANDESITE.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == COAL) { + eventName = "COAL"; if (!rtgConfig.GENERATE_ORE_COAL.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == DIAMOND) { + eventName = "DIAMOND"; if (!rtgConfig.GENERATE_ORE_DIAMOND.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == DIORITE) { + eventName = "DIORITE"; if (!rtgConfig.GENERATE_ORE_DIORITE.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == DIRT) { + eventName = "DIRT"; if (!rtgConfig.GENERATE_ORE_DIRT.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == EMERALD) { + eventName = "EMERALD"; if (!rtgConfig.GENERATE_ORE_EMERALD.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == GOLD) { + eventName = "GOLD"; if (!rtgConfig.GENERATE_ORE_GOLD.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == GRANITE) { + eventName = "GRANITE"; if (!rtgConfig.GENERATE_ORE_GRANITE.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == GRAVEL) { + eventName = "GRAVEL"; if (!rtgConfig.GENERATE_ORE_GRAVEL.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == IRON) { + eventName = "IRON"; if (!rtgConfig.GENERATE_ORE_IRON.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == LAPIS) { + eventName = "LAPIS"; if (!rtgConfig.GENERATE_ORE_LAPIS.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == REDSTONE) { + eventName = "REDSTONE"; if (!rtgConfig.GENERATE_ORE_REDSTONE.get()) { event.setResult(Event.Result.DENY); } } else if (eventType == SILVERFISH) { + eventName = "SILVERFISH"; if (!rtgConfig.GENERATE_ORE_SILVERFISH.get()) { event.setResult(Event.Result.DENY); } } + + //Logger.debug("%s EVENT @ %d %d %d (%d %d)", eventName, event.getPos().getX(), event.getPos().getY(), event.getPos().getZ(), (event.getPos().getX() / 16), (event.getPos().getZ() / 16)); } } diff --git a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java index 22cd8002d..9539978a4 100644 --- a/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java +++ b/src/main/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java @@ -60,12 +60,16 @@ public DecoBaseBiomeDecorations() { @Override public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, int worldX, int worldZ, float strength, float river, boolean hasPlacedVillageBlocks) { + // The X and Z coords need to be randomized here to prevent massive ore veins. + int intX = worldX + rand.nextInt(16);// + 8; + int intZ = worldZ + rand.nextInt(16);// + 8; + if (this.allowed) { for (int i = 0; i < loops; i++) { - int intX = worldX + rand.nextInt(16);// + 8; - int intZ = worldZ + rand.nextInt(16);// + 8; + intX = worldX + rand.nextInt(16);// + 8; + intZ = worldZ + rand.nextInt(16);// + 8; int intY = rtgWorld.world.getHeight(new BlockPos(intX, 0, intZ)).getY(); if (intY >= this.minY && intY <= this.maxY) { @@ -73,33 +77,33 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i if (this.equalsZeroChance > 0) { if (rand.nextInt(this.equalsZeroChance) == 0) { - biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river); + biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river); } else { - biome.rDecorator.decorateOres(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); + biome.rDecorator.decorateOres(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); } } else if (this.notEqualsZeroChance > 0) { if (rand.nextInt(this.notEqualsZeroChance) != 0) { - biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river); + biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river); } else { - biome.rDecorator.decorateOres(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); + biome.rDecorator.decorateOres(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); } } else { - biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river); + biome.rDecorator.rDecorateSeedBiome(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river); } } else { - biome.rDecorator.decorateOres(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); + biome.rDecorator.decorateOres(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); } } } else { - biome.rDecorator.decorateOres(rtgWorld.world, rand, worldX, worldZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); + biome.rDecorator.decorateOres(rtgWorld.world, rand, intX, intZ, rtgWorld.simplex, rtgWorld.cell, strength, river, hasPlacedVillageBlocks); } } From b4e107e6e1899b9f79eaab1abd9c4beecd6c1fda Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Mon, 26 Dec 2016 10:44:03 +0000 Subject: [PATCH 19/22] Removed vines from forest decorations. --- .../world/biome/deco/collection/DecoCollectionForest.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java index a37938ab9..2fd7cff35 100644 --- a/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java +++ b/src/main/java/rtg/world/biome/deco/collection/DecoCollectionForest.java @@ -37,7 +37,6 @@ public DecoCollectionForest(boolean fallenTrees) { this .addDeco(tallTrees(tallMin, tallMax)) // Tall trees first. - .addDeco(vines()) // Some vines. .addDeco(shortTrees(short1Min, short1Max)) // Short trees next. .addDeco(shortTrees(short2Min, short2Max)) // More short trees (on the other 'side' of the noise spectrum). .addDeco(randomTrees()) // More trees. @@ -147,11 +146,6 @@ private DecoTree randomVanillaTrees() { .setMaxY(120); } - private DecoVines vines() { - return new DecoVines() - .setStrengthFactor(6f); - } - private DecoHelper5050 logs() { return new DecoHelper5050(oakLogs(), spruceLogs()); } From 46c3b454c25e1c65de0b1c8cb932b01e4fa8a748 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Mon, 26 Dec 2016 10:44:16 +0000 Subject: [PATCH 20/22] Updated example configs. --- etc/config/RTG/rtg.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/config/RTG/rtg.cfg b/etc/config/RTG/rtg.cfg index 0a48c65bc..eb7f50c46 100644 --- a/etc/config/RTG/rtg.cfg +++ b/etc/config/RTG/rtg.cfg @@ -402,7 +402,7 @@ strongholds { B:"Generate Strongholds"=true # This setting is the number of strongholds that exist per world. - # HIGHER values = MORE strongholds & MORE lag. (3 = Vanilla) + # HIGHER values = MORE strongholds & MORE lag. (128 = Vanilla) # [range: 1 ~ 2147483647, default: 128] I:"Stronghold Count"=128 From 56e8f709e94d915f95e2100e6419a56ee8191d76 Mon Sep 17 00:00:00 2001 From: srs-bsns Date: Mon, 26 Dec 2016 13:25:34 -0500 Subject: [PATCH 21/22] fix Logger so that fatal level logging just logs instead of creating a crash report --- src/main/java/rtg/util/Logger.java | 9 +-- .../java/rtg/world/gen/ChunkProviderRTG.java | 60 ++++++++++++++----- 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/main/java/rtg/util/Logger.java b/src/main/java/rtg/util/Logger.java index 5e8e196e5..13ad7a7b7 100644 --- a/src/main/java/rtg/util/Logger.java +++ b/src/main/java/rtg/util/Logger.java @@ -1,7 +1,5 @@ package rtg.util; -import net.minecraft.crash.CrashReport; - import net.minecraftforge.fml.common.FMLLog; import org.apache.logging.log4j.Level; @@ -14,7 +12,7 @@ public class Logger { public static void debug(String format, Object... data) { if (RTGAPI.config().ENABLE_DEBUGGING.get()) { - FMLLog.log(Level.INFO, "[RTG-DEBUG] " + format, data); + FMLLog.log(Level.WARN, "[RTG-DEBUG] " + format, data); } } @@ -33,9 +31,8 @@ public static void error(String format, Object... data) { FMLLog.log(Level.ERROR, "[RTG-ERROR] " + format, data); } - public static void fatal(String message, Throwable throwable, Object... data) { + public static void fatal(String format, Object... data) { - CrashReport crashreport = CrashReport.makeCrashReport(throwable, message); - FMLLog.bigWarning("[RTG-FATAL] " + crashreport.getCompleteReport(), data); + FMLLog.log(Level.FATAL, "[RTG-FATAL] " + format, data); } } \ No newline at end of file diff --git a/src/main/java/rtg/world/gen/ChunkProviderRTG.java b/src/main/java/rtg/world/gen/ChunkProviderRTG.java index f3e97376f..2aa370082 100644 --- a/src/main/java/rtg/world/gen/ChunkProviderRTG.java +++ b/src/main/java/rtg/world/gen/ChunkProviderRTG.java @@ -319,10 +319,12 @@ public Chunk provideChunk(final int cx, final int cz) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in mineshaftGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in mineshaftGenerator"); + e.printStackTrace(); } } } @@ -333,10 +335,12 @@ public Chunk provideChunk(final int cx, final int cz) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in strongholdGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in strongholdGenerator"); + e.printStackTrace(); } } } @@ -347,10 +351,12 @@ public Chunk provideChunk(final int cx, final int cz) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in villageGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in villageGenerator"); + e.printStackTrace(); } } } @@ -361,10 +367,12 @@ public Chunk provideChunk(final int cx, final int cz) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in scatteredFeatureGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in scatteredFeatureGenerator"); + e.printStackTrace(); } } } @@ -375,10 +383,12 @@ public Chunk provideChunk(final int cx, final int cz) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in oceanMonumentGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in oceanMonumentGenerator"); + e.printStackTrace(); } } } @@ -562,10 +572,12 @@ private void doPopulate(int chunkX, int chunkZ) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in mineshaftGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in mineshaftGenerator"); + e.printStackTrace(); } } } @@ -578,10 +590,12 @@ private void doPopulate(int chunkX, int chunkZ) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in strongholdGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in strongholdGenerator"); + e.printStackTrace(); } } } @@ -595,10 +609,12 @@ private void doPopulate(int chunkX, int chunkZ) { catch (Exception e) { hasPlacedVillageBlocks = false; if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in villageGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in villageGenerator"); + e.printStackTrace(); } } } @@ -611,10 +627,12 @@ private void doPopulate(int chunkX, int chunkZ) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in scatteredFeatureGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in scatteredFeatureGenerator"); + e.printStackTrace(); } } } @@ -627,10 +645,12 @@ private void doPopulate(int chunkX, int chunkZ) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in oceanMonumentGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in oceanMonumentGenerator"); + e.printStackTrace(); } } } @@ -841,10 +861,12 @@ public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in mineshaftGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in mineshaftGenerator"); + e.printStackTrace(); } } } @@ -855,10 +877,12 @@ public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in strongholdGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in strongholdGenerator"); + e.printStackTrace(); } } } @@ -869,10 +893,12 @@ public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in villageGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in villageGenerator"); + e.printStackTrace(); } } } @@ -883,10 +909,12 @@ public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in scatteredFeatureGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in scatteredFeatureGenerator"); + e.printStackTrace(); } } } @@ -897,10 +925,12 @@ public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { } catch (Exception e) { if (rtgConfig.CRASH_ON_STRUCTURE_EXCEPTIONS.get()) { + Logger.fatal("Exception in oceanMonumentGenerator"); throw new RuntimeException(e.getMessage()); } else { - Logger.fatal(e.getMessage(), e); + Logger.error("Exception in oceanMonumentGenerator"); + e.printStackTrace(); } } } From 1597c0ebdd7359590749b20da8f523ca6a812a16 Mon Sep 17 00:00:00 2001 From: WhichOnesPink Date: Tue, 27 Dec 2016 00:51:22 +0000 Subject: [PATCH 22/22] No more vines on volcanoes. --- .../biome/deco/DecoJungleLilypadVines.java | 12 ----------- .../world/gen/feature/WorldGenVinesRTG.java | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java b/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java index 9150df2ae..80e4ebed5 100644 --- a/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java +++ b/src/main/java/rtg/world/biome/deco/DecoJungleLilypadVines.java @@ -10,7 +10,6 @@ import net.minecraftforge.event.terraingen.TerrainGen; import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD; -import rtg.api.RTGAPI; import rtg.api.world.RTGWorld; import rtg.world.biome.realistic.RealisticBiomeBase; import rtg.world.gen.feature.WorldGenVinesRTG; @@ -20,11 +19,6 @@ */ public class DecoJungleLilypadVines extends DecoBase { - private static final Block volcanoBlock = Block.getBlockFromName(RTGAPI.config().VOLCANO_BLOCK_ID.get()); - private static final Block volcanoMix1Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX1_BLOCK_ID.get()); - private static final Block volcanoMix2Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX2_BLOCK_ID.get()); - private static final Block volcanoMix3Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX3_BLOCK_ID.get()); - public DecoJungleLilypadVines() { super(); @@ -60,12 +54,6 @@ public void generate(RealisticBiomeBase biome, RTGWorld rtgWorld, Random rand, i for (int h44 = 100; h44 > 0; h44--) { - vb = rtgWorld.world.getBlockState(new BlockPos(j6, h44, k10)).getBlock(); - - if (vb == volcanoBlock || vb == volcanoMix1Block || vb == volcanoMix2Block || vb == volcanoMix3Block) { - return; - } - worldgeneratorVines.generate(rtgWorld.world, rand, new BlockPos(j6, z52, k10)); } } diff --git a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java index 3e5116767..22089a5b8 100644 --- a/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java +++ b/src/main/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -12,6 +12,8 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.api.RTGAPI; + public class WorldGenVinesRTG extends WorldGenerator { protected Block vineBlock; @@ -21,6 +23,11 @@ public class WorldGenVinesRTG extends WorldGenerator { protected PropertyBool propSouth; protected PropertyBool propWest; + private static final Block volcanoBlock = Block.getBlockFromName(RTGAPI.config().VOLCANO_BLOCK_ID.get()); + private static final Block volcanoMix1Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX1_BLOCK_ID.get()); + private static final Block volcanoMix2Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX2_BLOCK_ID.get()); + private static final Block volcanoMix3Block = Block.getBlockFromName(RTGAPI.config().VOLCANO_MIX3_BLOCK_ID.get()); + public WorldGenVinesRTG() { this.vineBlock = Blocks.VINE; @@ -50,6 +57,19 @@ public boolean generate(World worldIn, Random rand, BlockPos position) { if (worldIn.isAirBlock(position)) { + Block north = worldIn.getBlockState(position.north()).getBlock(); + Block south = worldIn.getBlockState(position.south()).getBlock(); + Block east = worldIn.getBlockState(position.east()).getBlock(); + Block west = worldIn.getBlockState(position.west()).getBlock(); + + // No vines on volcanoes. + if (north == volcanoBlock || north == volcanoMix1Block || north == volcanoMix2Block || north == volcanoMix3Block + || south == volcanoBlock || south == volcanoMix1Block || south == volcanoMix2Block || south == volcanoMix3Block + || east == volcanoBlock || east == volcanoMix1Block || east == volcanoMix2Block || east == volcanoMix3Block + || west == volcanoBlock || west == volcanoMix1Block || west == volcanoMix2Block || west == volcanoMix3Block) { + return false; + } + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) { if (this.vineBlock.canPlaceBlockOnSide(worldIn, position, enumfacing)) {