Updated Upstream (Bukkit/Spigot) (#8445)
This commit is contained in:
@@ -38,25 +38,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||
@@ -0,0 +0,0 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements
|
||||
|
||||
@Override
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
- if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (100.0D / world.spigotConfig.kelpModifier) * this.growPerTickProbability) { // Spigot
|
||||
+ // Paper start
|
||||
+ final int modifier;
|
||||
+ if (state.is(Blocks.TWISTING_VINES) || state.is(Blocks.TWISTING_VINES_PLANT)) {
|
||||
+ modifier = world.spigotConfig.twistingVinesModifier;
|
||||
+ } else if (state.is(Blocks.WEEPING_VINES) || state.is(Blocks.WEEPING_VINES_PLANT)) {
|
||||
+ modifier = world.spigotConfig.weepingVinesModifier;
|
||||
+ } else if (state.is(Blocks.CAVE_VINES) || state.is(Blocks.CAVE_VINES_PLANT)) {
|
||||
+ modifier = world.spigotConfig.caveVinesModifier;
|
||||
+ } else if (state.is(Blocks.KELP) || state.is(Blocks.KELP_PLANT)) {
|
||||
+ modifier = world.spigotConfig.kelpModifier;
|
||||
+ } else {
|
||||
+ modifier = 100; // Above cases are exhaustive as of 1.18
|
||||
+ }
|
||||
+ if ((Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25 && random.nextDouble() < (modifier / 100.0D) * this.growPerTickProbability) { // Spigot // Paper - fix growth modifier having the reverse effect
|
||||
+ // Paper end
|
||||
BlockPos blockposition1 = pos.relative(this.growthDirection);
|
||||
|
||||
if (this.canGrowInto(world.getBlockState(blockposition1))) {
|
||||
@@ -81,28 +62,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
||||
public int bambooModifier;
|
||||
public int sweetBerryModifier;
|
||||
public int kelpModifier;
|
||||
+ // Paper start
|
||||
+ public int twistingVinesModifier;
|
||||
+ public int weepingVinesModifier;
|
||||
+ public int caveVinesModifier;
|
||||
+ public int glowBerryModifier;
|
||||
+ // Paper end
|
||||
public int twistingVinesModifier;
|
||||
public int weepingVinesModifier;
|
||||
public int caveVinesModifier;
|
||||
+ public int glowBerryModifier; // Paper
|
||||
private int getAndValidateGrowth(String crop)
|
||||
{
|
||||
int modifier = this.getInt( "growth." + crop.toLowerCase(java.util.Locale.ENGLISH) + "-modifier", 100 );
|
||||
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
||||
this.bambooModifier = this.getAndValidateGrowth( "Bamboo" );
|
||||
this.sweetBerryModifier = this.getAndValidateGrowth( "SweetBerry" );
|
||||
this.kelpModifier = this.getAndValidateGrowth( "Kelp" );
|
||||
+ // Paper start
|
||||
+ this.twistingVinesModifier = this.getAndValidateGrowth("TwistingVines");
|
||||
+ this.weepingVinesModifier = this.getAndValidateGrowth("WeepingVines");
|
||||
+ this.caveVinesModifier = this.getAndValidateGrowth("CaveVines");
|
||||
+ this.glowBerryModifier = this.getAndValidateGrowth("GlowBerry");
|
||||
+ // Paper end
|
||||
this.twistingVinesModifier = this.getAndValidateGrowth( "TwistingVines" );
|
||||
this.weepingVinesModifier = this.getAndValidateGrowth( "WeepingVines" );
|
||||
this.caveVinesModifier = this.getAndValidateGrowth( "CaveVines" );
|
||||
+ this.glowBerryModifier = this.getAndValidateGrowth("GlowBerry"); // Paper
|
||||
}
|
||||
|
||||
public double itemMerge;
|
||||
|
||||
Reference in New Issue
Block a user