From df403168ff84fe47642bbb014742605271f0c143 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 7 Mar 2016 22:14:13 +1100 Subject: [PATCH] Crop Growth Rates Allows configuring the growth rates of crops as a percentage of their normal growth rate. By: md_5 --- .../level/block/BambooSaplingBlock.java.patch | 9 +++ .../level/block/BambooStalkBlock.java.patch | 9 +++ .../world/level/block/Block.java.patch | 14 ++++- .../world/level/block/CactusBlock.java.patch | 15 ++++- .../world/level/block/CocoaBlock.java.patch | 7 ++- .../world/level/block/CropBlock.java.patch | 26 +++++++-- .../block/GrowingPlantHeadBlock.java.patch | 19 ++++++- .../level/block/MushroomBlock.java.patch | 9 +++ .../level/block/NetherWartBlock.java.patch | 7 ++- .../world/level/block/SaplingBlock.java.patch | 3 +- .../world/level/block/StemBlock.java.patch | 8 ++- .../level/block/SugarCaneBlock.java.patch | 12 +++- .../block/SweetBerryBushBlock.java.patch | 8 ++- .../world/level/block/VineBlock.java.patch | 14 ++++- .../java/org/spigotmc/SpigotWorldConfig.java | 55 +++++++++++++++++++ 15 files changed, 192 insertions(+), 23 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/BambooSaplingBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/BambooSaplingBlock.java.patch index 9c470c3248..88344a70cd 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/BambooSaplingBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/BambooSaplingBlock.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/block/BambooSaplingBlock.java +++ b/net/minecraft/world/level/block/BambooSaplingBlock.java +@@ -45,7 +45,7 @@ + + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { +- if (random.nextInt(3) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { ++ if (random.nextFloat() < (world.spigotConfig.bambooModifier / (100.0f * 3)) && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution + this.growBamboo(world, pos); + } + @@ -87,6 +87,6 @@ } diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/BambooStalkBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/BambooStalkBlock.java.patch index 56388a35ef..36b85ce839 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/BambooStalkBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/BambooStalkBlock.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/block/BambooStalkBlock.java +++ b/net/minecraft/world/level/block/BambooStalkBlock.java +@@ -134,7 +134,7 @@ + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if ((Integer) state.getValue(BambooStalkBlock.STAGE) == 0) { +- if (random.nextInt(3) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { ++ if (random.nextFloat() < (world.spigotConfig.bambooModifier / (100.0f * 3)) && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution + int i = this.getHeightBelowUpToMax(world, pos) + 1; + + if (i < 16) { @@ -183,7 +183,7 @@ BlockPos blockposition1 = pos.above(i); BlockState iblockdata1 = world.getBlockState(blockposition1); diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/Block.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/Block.java.patch index 9c6a87013a..c401e3135b 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/Block.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/Block.java.patch @@ -24,7 +24,7 @@ Block.dropResources(state, world, pos, blockEntity, player, tool); } -@@ -490,15 +496,23 @@ +@@ -490,15 +496,35 @@ return this.builtInRegistryHolder; } @@ -47,6 +47,18 @@ + return 0; + } + // CraftBukkit end ++ ++ // Spigot start ++ public static float range(float min, float value, float max) { ++ if (value < min) { ++ return min; ++ } ++ if (value > max) { ++ return max; ++ } ++ return value; ++ } ++ // Spigot end + private static record ShapePairKey(VoxelShape first, VoxelShape second) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch index 206249b0ba..f5a12c0dcb 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch @@ -8,16 +8,25 @@ public class CactusBlock extends Block { -@@ -65,7 +66,7 @@ +@@ -64,13 +65,14 @@ + if (i < 3) { int j = (Integer) state.getValue(CactusBlock.AGE); - if (j == 15) { +- if (j == 15) { - world.setBlockAndUpdate(blockposition1, this.defaultBlockState()); ++ int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution ++ if (j >= 15 || (modifier != 100 && random.nextFloat() < (modifier / (100.0f * 16)))) { // Spigot - SPIGOT-7159: Better modifier resolution + CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.defaultBlockState()); // CraftBukkit BlockState iblockdata1 = (BlockState) state.setValue(CactusBlock.AGE, 0); world.setBlock(pos, iblockdata1, 4); -@@ -120,7 +121,7 @@ + world.neighborChanged(iblockdata1, blockposition1, this, (Orientation) null, false); +- } else { ++ } else if (modifier == 100 || random.nextFloat() < (modifier / (100.0f * 16))) { // Spigot - SPIGOT-7159: Better modifier resolution + world.setBlock(pos, (BlockState) state.setValue(CactusBlock.AGE, j + 1), 4); + } + +@@ -120,7 +122,7 @@ @Override protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/CocoaBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/CocoaBlock.java.patch index d330ea5bcf..963cb2ef7b 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/CocoaBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/CocoaBlock.java.patch @@ -8,7 +8,12 @@ public class CocoaBlock extends HorizontalDirectionalBlock implements BonemealableBlock { -@@ -61,7 +62,7 @@ +@@ -57,11 +58,11 @@ + + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { +- if (world.random.nextInt(5) == 0) { ++ if (world.random.nextFloat() < (world.spigotConfig.cocoaModifier / (100.0f * 5))) { // Spigot - SPIGOT-7159: Better modifier resolution int i = (Integer) state.getValue(CocoaBlock.AGE); if (i < 2) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/CropBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/CropBlock.java.patch index d4ca1f405d..cfbc7970f6 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/CropBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/CropBlock.java.patch @@ -8,16 +8,32 @@ public class CropBlock extends BushBlock implements BonemealableBlock { -@@ -83,7 +84,7 @@ +@@ -82,9 +83,22 @@ + if (i < this.getMaxAge()) { float f = CropBlock.getGrowthSpeed(this, world, pos); - if (random.nextInt((int) (25.0F / f) + 1) == 0) { +- if (random.nextInt((int) (25.0F / f) + 1) == 0) { - world.setBlock(pos, this.getStateForAge(i + 1), 2); -+ CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(i + 1), 2); // CraftBukkit ++ // Spigot start ++ int modifier; ++ if (this == Blocks.BEETROOTS) { ++ modifier = world.spigotConfig.beetrootModifier; ++ } else if (this == Blocks.CARROTS) { ++ modifier = world.spigotConfig.carrotModifier; ++ } else if (this == Blocks.POTATOES) { ++ modifier = world.spigotConfig.potatoModifier; ++ } else { ++ modifier = world.spigotConfig.wheatModifier; } ++ ++ if (random.nextFloat() < (modifier / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution ++ // Spigot end ++ CraftEventFactory.handleBlockGrowEvent(world, pos, this.getStateForAge(i + 1), 2); // CraftBukkit ++ } } } -@@ -98,7 +99,7 @@ + +@@ -98,7 +112,7 @@ i = j; } @@ -26,7 +42,7 @@ } protected int getBonemealAgeIncrease(Level world) { -@@ -161,7 +162,7 @@ +@@ -161,7 +175,7 @@ @Override protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (world instanceof ServerLevel worldserver) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch index 042b294aae..738beeeb32 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch @@ -1,6 +1,23 @@ --- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -@@ -48,7 +48,7 @@ +@@ -44,11 +44,23 @@ + + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { +- if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < this.growPerTickProbability) { ++ // Spigot start ++ int modifier; ++ if (this == Blocks.KELP) { ++ modifier = world.spigotConfig.kelpModifier; ++ } else if (this == Blocks.TWISTING_VINES) { ++ modifier = world.spigotConfig.twistingVinesModifier; ++ } else if (this == Blocks.WEEPING_VINES) { ++ modifier = world.spigotConfig.weepingVinesModifier; ++ } else { ++ modifier = world.spigotConfig.caveVinesModifier; ++ } ++ if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution ++ // Spigot end BlockPos blockposition1 = pos.relative(this.growthDirection); if (this.canGrowInto(world.getBlockState(blockposition1))) { diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/MushroomBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/MushroomBlock.java.patch index 9260145b24..0f0b4c4c3a 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/MushroomBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/MushroomBlock.java.patch @@ -10,6 +10,15 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock { +@@ -48,7 +51,7 @@ + + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { +- if (random.nextInt(25) == 0) { ++ if (random.nextFloat() < (world.spigotConfig.mushroomModifier / (100.0f * 25))) { // Spigot - SPIGOT-7159: Better modifier resolution + int i = 5; + boolean flag = true; + Iterator iterator = BlockPos.betweenClosed(pos.offset(-4, -1, -4), pos.offset(4, 1, 4)).iterator(); @@ -75,7 +78,7 @@ } diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch index 33c887cdf8..849dc04024 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch @@ -1,8 +1,11 @@ --- a/net/minecraft/world/level/block/NetherWartBlock.java +++ b/net/minecraft/world/level/block/NetherWartBlock.java -@@ -54,7 +54,7 @@ +@@ -52,9 +52,9 @@ + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + int i = (Integer) state.getValue(NetherWartBlock.AGE); - if (i < 3 && random.nextInt(10) == 0) { +- if (i < 3 && random.nextInt(10) == 0) { ++ if (i < 3 && random.nextFloat() < (world.spigotConfig.wartModifier / (100.0f * 10))) { // Spigot - SPIGOT-7159: Better modifier resolution state = (BlockState) state.setValue(NetherWartBlock.AGE, i + 1); - world.setBlock(pos, state, 2); + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, pos, state, 2); // CraftBukkit diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/SaplingBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/SaplingBlock.java.patch index d2d4ec0d05..b3d3dcc429 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/SaplingBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/SaplingBlock.java.patch @@ -45,8 +45,9 @@ @Override - protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { +- if (world.getMaxLocalRawBrightness(pos.above()) >= 9 && random.nextInt(7) == 0) { + protected void randomTick(net.minecraft.world.level.block.state.BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { - if (world.getMaxLocalRawBrightness(pos.above()) >= 9 && random.nextInt(7) == 0) { ++ if (world.getMaxLocalRawBrightness(pos.above()) >= 9 && random.nextFloat() < (world.spigotConfig.saplingModifier / (100.0f * 7))) { // Spigot - SPIGOT-7159: Better modifier resolution this.advanceTree(world, pos, state, random); } diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/StemBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/StemBlock.java.patch index 4aac7cf266..625e104922 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/StemBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/StemBlock.java.patch @@ -8,7 +8,13 @@ public class StemBlock extends BushBlock implements BonemealableBlock { -@@ -79,7 +80,7 @@ +@@ -74,12 +75,12 @@ + if (world.getRawBrightness(pos, 0) >= 9) { + float f = CropBlock.getGrowthSpeed(this, world, pos); + +- if (random.nextInt((int) (25.0F / f) + 1) == 0) { ++ if (random.nextFloat() < ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution + int i = (Integer) state.getValue(StemBlock.AGE); if (i < 7) { state = (BlockState) state.setValue(StemBlock.AGE, i + 1); diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch index 81984fbc44..ec6ff2f591 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch @@ -1,11 +1,17 @@ --- a/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/net/minecraft/world/level/block/SugarCaneBlock.java -@@ -63,7 +63,7 @@ +@@ -62,10 +62,11 @@ + if (i < 3) { int j = (Integer) state.getValue(SugarCaneBlock.AGE); - if (j == 15) { +- if (j == 15) { - world.setBlockAndUpdate(pos.above(), this.defaultBlockState()); ++ int modifier = world.spigotConfig.caneModifier; // Spigot - SPIGOT-7159: Better modifier resolution ++ if (j >= 15 || (modifier != 100 && random.nextFloat() < (modifier / (100.0f * 16)))) { // Spigot - SPIGOT-7159: Better modifier resolution + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, pos.above(), this.defaultBlockState()); // CraftBukkit world.setBlock(pos, (BlockState) state.setValue(SugarCaneBlock.AGE, 0), 4); - } else { +- } else { ++ } else if (modifier == 100 || random.nextFloat() < (modifier / (100.0f * 16))) { // Spigot - SPIGOT-7159: Better modifier resolution world.setBlock(pos, (BlockState) state.setValue(SugarCaneBlock.AGE, j + 1), 4); + } + } diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch index 9cc5f5bd7b..706470d9ec 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/SweetBerryBushBlock.java.patch @@ -13,8 +13,12 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock { -@@ -70,7 +76,7 @@ - if (i < 3 && random.nextInt(5) == 0 && world.getRawBrightness(pos.above(), 0) >= 9) { +@@ -67,10 +73,10 @@ + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + int i = (Integer) state.getValue(SweetBerryBushBlock.AGE); + +- if (i < 3 && random.nextInt(5) == 0 && world.getRawBrightness(pos.above(), 0) >= 9) { ++ if (i < 3 && random.nextFloat() < (world.spigotConfig.sweetBerryModifier / (100.0f * 5)) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - SPIGOT-7159: Better modifier resolution BlockState iblockdata1 = (BlockState) state.setValue(SweetBerryBushBlock.AGE, i + 1); - world.setBlock(pos, iblockdata1, 2); diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/VineBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/VineBlock.java.patch index 8ff0aff9aa..0403549dc8 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/VineBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/VineBlock.java.patch @@ -8,6 +8,15 @@ public class VineBlock extends Block { +@@ -184,7 +185,7 @@ + @Override + protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if (world.getGameRules().getBoolean(GameRules.RULE_DO_VINES_SPREAD)) { +- if (random.nextInt(4) == 0) { ++ if (random.nextFloat() < (world.spigotConfig.vineModifier / (100.0f * 4))) { // Spigot - SPIGOT-7159: Better modifier resolution + Direction enumdirection = Direction.getRandom(random); + BlockPos blockposition1 = pos.above(); + BlockPos blockposition2; @@ -203,30 +204,34 @@ BlockPos blockposition3 = blockposition2.relative(enumdirection1); BlockPos blockposition4 = blockposition2.relative(enumdirection2); @@ -29,10 +38,9 @@ + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition3, (BlockState) this.defaultBlockState().setValue(VineBlock.getPropertyForFace(enumdirection3), true), 2); } else if (flag1 && world.isEmptyBlock(blockposition4) && VineBlock.isAcceptableNeighbour(world, pos.relative(enumdirection2), enumdirection3)) { - world.setBlock(blockposition4, (BlockState) this.defaultBlockState().setValue(VineBlock.getPropertyForFace(enumdirection3), true), 2); -- } else if ((double) random.nextFloat() < 0.05D && VineBlock.isAcceptableNeighbour(world, blockposition2.above(), Direction.UP)) { -- world.setBlock(blockposition2, (BlockState) this.defaultBlockState().setValue(VineBlock.UP, true), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition4, (BlockState) this.defaultBlockState().setValue(VineBlock.getPropertyForFace(enumdirection3), true), 2); -+ } else if ((double) random.nextFloat() < 0.05D && VineBlock.isAcceptableNeighbour(world, blockposition2.above(), Direction.UP)) { + } else if ((double) random.nextFloat() < 0.05D && VineBlock.isAcceptableNeighbour(world, blockposition2.above(), Direction.UP)) { +- world.setBlock(blockposition2, (BlockState) this.defaultBlockState().setValue(VineBlock.UP, true), 2); + CraftEventFactory.handleBlockSpreadEvent(world, source, blockposition2, (BlockState) this.defaultBlockState().setValue(VineBlock.UP, true), 2); } + // CraftBukkit end diff --git a/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java b/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java index 3ca59d6d70..5d2a783039 100644 --- a/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/paper-server/src/main/java/org/spigotmc/SpigotWorldConfig.java @@ -79,4 +79,59 @@ public class SpigotWorldConfig this.config.addDefault( "world-settings.default." + path, def ); return this.config.get( "world-settings." + this.worldName + "." + path, this.config.get( "world-settings.default." + path ) ); } + + // Crop growth rates + public int cactusModifier; + public int caneModifier; + public int melonModifier; + public int mushroomModifier; + public int pumpkinModifier; + public int saplingModifier; + public int beetrootModifier; + public int carrotModifier; + public int potatoModifier; + public int wheatModifier; + public int wartModifier; + public int vineModifier; + public int cocoaModifier; + public int bambooModifier; + public int sweetBerryModifier; + public int kelpModifier; + public int twistingVinesModifier; + public int weepingVinesModifier; + public int caveVinesModifier; + private int getAndValidateGrowth(String crop) + { + int modifier = this.getInt( "growth." + crop.toLowerCase(java.util.Locale.ENGLISH) + "-modifier", 100 ); + if ( modifier == 0 ) + { + this.log( "Cannot set " + crop + " growth to zero, defaulting to 100" ); + modifier = 100; + } + this.log( crop + " Growth Modifier: " + modifier + "%" ); + + return modifier; + } + private void growthModifiers() + { + this.cactusModifier = this.getAndValidateGrowth( "Cactus" ); + this.caneModifier = this.getAndValidateGrowth( "Cane" ); + this.melonModifier = this.getAndValidateGrowth( "Melon" ); + this.mushroomModifier = this.getAndValidateGrowth( "Mushroom" ); + this.pumpkinModifier = this.getAndValidateGrowth( "Pumpkin" ); + this.saplingModifier = this.getAndValidateGrowth( "Sapling" ); + this.beetrootModifier = this.getAndValidateGrowth( "Beetroot" ); + this.carrotModifier = this.getAndValidateGrowth( "Carrot" ); + this.potatoModifier = this.getAndValidateGrowth( "Potato" ); + this.wheatModifier = this.getAndValidateGrowth( "Wheat" ); + this.wartModifier = this.getAndValidateGrowth( "NetherWart" ); + this.vineModifier = this.getAndValidateGrowth( "Vine" ); + this.cocoaModifier = this.getAndValidateGrowth( "Cocoa" ); + this.bambooModifier = this.getAndValidateGrowth( "Bamboo" ); + this.sweetBerryModifier = this.getAndValidateGrowth( "SweetBerry" ); + this.kelpModifier = this.getAndValidateGrowth( "Kelp" ); + this.twistingVinesModifier = this.getAndValidateGrowth( "TwistingVines" ); + this.weepingVinesModifier = this.getAndValidateGrowth( "WeepingVines" ); + this.caveVinesModifier = this.getAndValidateGrowth( "CaveVines" ); + } }