13
0
geforkt von Mirrors/Paper

Updated Upstream (Bukkit/Spigot) (#8445)

Dieser Commit ist enthalten in:
Jake Potrebic 2022-10-23 10:41:34 -07:00
Ursprung 0aa7d1a07f
Commit bac7ba4c5a
7 geänderte Dateien mit 14 neuen und 1777 gelöschten Zeilen

Datei anzeigen

@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class YamlConfigurationOptions extends FileConfigurationOptions {
private int indent = 2;
private int width = 80;
+ private int codePointLimit = 64 * 1024 * 1024; // 64 MB // Paper
+ private int codePointLimit = Integer.MAX_VALUE; // Paper - use upstream's default from YamlConfiguration
protected YamlConfigurationOptions(@NotNull YamlConfiguration configuration) {
super(configuration);

Datei anzeigen

@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Wed, 5 Jan 2022 12:12:58 -0800
Subject: [PATCH] Remove upstream snakeyaml fix
See Server Patch: Fix saving configs with more long comments
diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java
+++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java
@@ -0,0 +0,0 @@ public class YamlConfiguration extends FileConfiguration {
yamlLoaderOptions = new LoaderOptions();
yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26
- yaml = new BukkitYaml(constructor, representer, yamlDumperOptions, yamlLoaderOptions);
+ yaml = new /*BukkitYaml*/Yaml(constructor, representer, yamlDumperOptions, yamlLoaderOptions); // Paper - don't use upstream BukkitYaml fix, add the whole snakeyaml Emitter class itself with the fix
}
@NotNull
diff --git a/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java b/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java
+++ b/src/test/java/org/bukkit/configuration/file/YamlConfigurationTest.java
@@ -0,0 +0,0 @@ public class YamlConfigurationTest extends FileConfigurationTest {
}
@Test
+ @org.junit.Ignore // Paper - ignore test because our fix doesn't work in testing environment
public void test100Comments() throws InvalidConfigurationException {
StringBuilder commentBuilder = new StringBuilder();
for (int i = 0; i < 100; i++) {

Datei anzeigen

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java
@@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock {
if (random.nextInt(Math.max(1, (int) (100.0F / world.spigotConfig.bambooModifier) * 3)) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot
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) {
@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable growth height
int j = (Integer) state.getValue(CactusBlock.AGE);
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.cactusModifier) * 15) + 0.5F, 15)) { // Spigot
int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution
diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
@ -89,4 +89,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable growth height
int j = (Integer) state.getValue(SugarCaneBlock.AGE);
if (j >= (byte) range(3, ((100.0F / world.spigotConfig.caneModifier) * 15) + 0.5F, 15)) { // Spigot
int modifier = world.spigotConfig.caneModifier; // Spigot - SPIGOT-7159: Better modifier resolution

Datei anzeigen

@ -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;

@ -1 +1 @@
Subproject commit 0994345029c4d127696616de3bab3e8044b03749
Subproject commit 006049902d41e91d01844126dd968ca92fb99c8a

@ -1 +1 @@
Subproject commit 4aa5ead2377692b934a84b6853d188e2d9cbd53a
Subproject commit 89741d3e9ff89cb2aa3b2e34a714a3a073b60d95