geforkt von Mirrors/Paper
Updated Upstream (Bukkit/Spigot) (#8445)
Dieser Commit ist enthalten in:
Ursprung
0aa7d1a07f
Commit
bac7ba4c5a
@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public class YamlConfigurationOptions extends FileConfigurationOptions {
|
public class YamlConfigurationOptions extends FileConfigurationOptions {
|
||||||
private int indent = 2;
|
private int indent = 2;
|
||||||
private int width = 80;
|
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) {
|
protected YamlConfigurationOptions(@NotNull YamlConfiguration configuration) {
|
||||||
super(configuration);
|
super(configuration);
|
||||||
|
@ -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++) {
|
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/BambooBlock.java
|
||||||
+++ b/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 {
|
@@ -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;
|
int i = this.getHeightBelowUpToMax(world, pos) + 1;
|
||||||
|
|
||||||
- if (i < 16) {
|
- if (i < 16) {
|
||||||
@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable growth height
|
+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable growth height
|
||||||
int j = (Integer) state.getValue(CactusBlock.AGE);
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java
|
--- 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
|
+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable growth height
|
||||||
int j = (Integer) state.getValue(SugarCaneBlock.AGE);
|
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
|
||||||
|
@ -38,25 +38,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
|
||||||
+++ b/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
|
@@ -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);
|
BlockPos blockposition1 = pos.relative(this.growthDirection);
|
||||||
|
|
||||||
if (this.canGrowInto(world.getBlockState(blockposition1))) {
|
if (this.canGrowInto(world.getBlockState(blockposition1))) {
|
||||||
@ -81,28 +62,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||||
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
||||||
public int bambooModifier;
|
public int twistingVinesModifier;
|
||||||
public int sweetBerryModifier;
|
public int weepingVinesModifier;
|
||||||
public int kelpModifier;
|
public int caveVinesModifier;
|
||||||
+ // Paper start
|
+ public int glowBerryModifier; // Paper
|
||||||
+ public int twistingVinesModifier;
|
|
||||||
+ public int weepingVinesModifier;
|
|
||||||
+ public int caveVinesModifier;
|
|
||||||
+ public int glowBerryModifier;
|
|
||||||
+ // Paper end
|
|
||||||
private int getAndValidateGrowth(String crop)
|
private int getAndValidateGrowth(String crop)
|
||||||
{
|
{
|
||||||
int modifier = this.getInt( "growth." + crop.toLowerCase(java.util.Locale.ENGLISH) + "-modifier", 100 );
|
int modifier = this.getInt( "growth." + crop.toLowerCase(java.util.Locale.ENGLISH) + "-modifier", 100 );
|
||||||
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
||||||
this.bambooModifier = this.getAndValidateGrowth( "Bamboo" );
|
this.twistingVinesModifier = this.getAndValidateGrowth( "TwistingVines" );
|
||||||
this.sweetBerryModifier = this.getAndValidateGrowth( "SweetBerry" );
|
this.weepingVinesModifier = this.getAndValidateGrowth( "WeepingVines" );
|
||||||
this.kelpModifier = this.getAndValidateGrowth( "Kelp" );
|
this.caveVinesModifier = this.getAndValidateGrowth( "CaveVines" );
|
||||||
+ // Paper start
|
+ this.glowBerryModifier = this.getAndValidateGrowth("GlowBerry"); // Paper
|
||||||
+ this.twistingVinesModifier = this.getAndValidateGrowth("TwistingVines");
|
|
||||||
+ this.weepingVinesModifier = this.getAndValidateGrowth("WeepingVines");
|
|
||||||
+ this.caveVinesModifier = this.getAndValidateGrowth("CaveVines");
|
|
||||||
+ this.glowBerryModifier = this.getAndValidateGrowth("GlowBerry");
|
|
||||||
+ // Paper end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public double itemMerge;
|
public double itemMerge;
|
||||||
|
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
@ -1 +1 @@
|
|||||||
Subproject commit 0994345029c4d127696616de3bab3e8044b03749
|
Subproject commit 006049902d41e91d01844126dd968ca92fb99c8a
|
@ -1 +1 @@
|
|||||||
Subproject commit 4aa5ead2377692b934a84b6853d188e2d9cbd53a
|
Subproject commit 89741d3e9ff89cb2aa3b2e34a714a3a073b60d95
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren