mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-17 13:00:04 +08:00
83 lines
5.8 KiB
Diff
83 lines
5.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Sun, 12 Jun 2022 09:18:57 -0500
|
|
Subject: [PATCH] Fix pufferfish issues
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
index 0485d126f799789b5d5abcaf96da96df25a12dfd..692789a473665c1fc7be56b8913cd208ae27d2e5 100644
|
|
--- a/build.gradle.kts
|
|
+++ b/build.gradle.kts
|
|
@@ -49,8 +49,8 @@ dependencies {
|
|
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
|
|
|
// Pufferfish start
|
|
- implementation("org.yaml:snakeyaml:1.30")
|
|
- implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8") {
|
|
+ implementation("org.yaml:snakeyaml:1.32")// Purpur
|
|
+ implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8.2") { // Purpur
|
|
exclude(group="org.yaml", module="snakeyaml")
|
|
}
|
|
// Pufferfish end
|
|
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
|
index ed9c8e882739c02d0d04129d251e4c726b422c07..5426e57ed67b0d144818a7e3b917c90d45f548ce 100644
|
|
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
|
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
|
@@ -222,7 +222,7 @@ public class PufferfishConfig {
|
|
public static int activationDistanceMod;
|
|
|
|
private static void dynamicActivationOfBrains() throws IOException {
|
|
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", true);
|
|
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
|
|
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
|
|
"This value determines how far away an entity has to be",
|
|
"from the player to start being effected by DEAR.");
|
|
@@ -266,7 +266,7 @@ public class PufferfishConfig {
|
|
|
|
public static boolean throttleInactiveGoalSelectorTick;
|
|
private static void inactiveGoalSelectorThrottle() {
|
|
- getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", true,
|
|
+ getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur
|
|
"Throttles the AI goal selector in entity inactive ticks.",
|
|
"This can improve performance by a few percent, but has minor gameplay implications.");
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index f8750675044708e71dbf6293be6ce36bd6c510ca..b69799d0ae0ce8b176b910da886e71c4d25c94aa 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -805,7 +805,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
}
|
|
// Paper start - optimise random block ticking
|
|
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
|
|
- // private final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(); // Pufferfish - moved to super
|
|
+ private final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - moved to super // Purpur - dont break ABI
|
|
// Paper end
|
|
|
|
private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Pufferfish
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
index 0277633fd328ef9993fea4ac29df83b5b00c0f42..35d6a8fe168caa5b68b471bd78cc95b99758d1b0 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -271,7 +271,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
|
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
|
|
|
- protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter
|
|
+ //protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI
|
|
|
|
// Pufferfish start - ensure these get inlined
|
|
private final int minBuildHeight, minSection, height, maxBuildHeight, maxSection;
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
index 34334c139176e0aa9f6d93a87821508d17567cfc..df2786516fe641edff7bbe9fe0665bf07502d830 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -130,7 +130,7 @@ public class LevelChunk extends ChunkAccess {
|
|
this.fluidTicks = fluidTickScheduler;
|
|
// CraftBukkit start
|
|
this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);
|
|
- this.lightningTick = this.level.getThreadUnsafeRandom().nextInt(100000) << 1; // Pufferfish - initialize lightning tick
|
|
+ this.lightningTick = java.util.concurrent.ThreadLocalRandom.current().nextInt(100000) << 1; // Pufferfish - initialize lightning tick // Purpur - any random will do
|
|
}
|
|
|
|
public org.bukkit.Chunk bukkitChunk;
|