mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
101 lines
5.9 KiB
Diff
101 lines
5.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@Gmail.com>
|
|
Date: Tue, 4 Jan 2022 23:05:41 -0600
|
|
Subject: [PATCH] Fix pufferfish issues
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
index 96d831791edbe6ae07325008b760f70f75c4d713..83e2c8784eaa77851e9efc6b889d673c1fd046d0 100644
|
|
--- a/build.gradle.kts
|
|
+++ b/build.gradle.kts
|
|
@@ -63,7 +63,7 @@ dependencies {
|
|
|
|
// Pufferfish start
|
|
implementation("org.yaml:snakeyaml:1.32")
|
|
- implementation ("me.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
|
|
+ implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur - Fix pufferfish issues
|
|
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 f5a43a1e1a78b3eaabbcadc7af09750ee478eeb6..68fec1c808a16ecbf2451daa3bb8f02c1bdfe7c4 100644
|
|
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
|
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
|
|
@@ -229,7 +229,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 - Fix pufferfish issues
|
|
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.");
|
|
@@ -256,7 +256,7 @@ public class PufferfishConfig {
|
|
|
|
public static boolean throttleInactiveGoalSelectorTick;
|
|
private static void inactiveGoalSelectorThrottle() {
|
|
- throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", true,
|
|
+ throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur - Fix pufferfish issues
|
|
"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/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
index 790bad0494454ca12ee152e3de6da3da634d9b20..19d602e4e6fa5abf59559eab4132677b09a967a1 100644
|
|
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
|
@@ -31,6 +31,7 @@ public record ServerBuildInfoImpl(
|
|
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
|
|
|
|
private static final String BRAND_PAPER_NAME = "Paper";
|
|
+ private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues
|
|
|
|
private static final String BUILD_DEV = "DEV";
|
|
|
|
@@ -42,9 +43,9 @@ public record ServerBuildInfoImpl(
|
|
this(
|
|
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
|
|
.map(Key::key)
|
|
- .orElse(BRAND_PAPER_ID),
|
|
+ .orElse(BRAND_PUFFERFISH_ID), // Purpur - Fix pufferfish issues
|
|
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
|
- .orElse(BRAND_PAPER_NAME),
|
|
+ .orElse(BRAND_PUFFERFISH_NAME), // Purpur - Fix pufferfish issues
|
|
SharedConstants.getCurrentVersion().getId(),
|
|
SharedConstants.getCurrentVersion().getName(),
|
|
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
|
@@ -61,7 +62,7 @@ public record ServerBuildInfoImpl(
|
|
|
|
@Override
|
|
public boolean isBrandCompatible(final @NotNull Key brandId) {
|
|
- return brandId.equals(this.brandId);
|
|
+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID); // Purpur - Fix pufferfish issues
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
index 593b343b7cd5a24e34ad19a9e93eb9258f862357..80ff364514d071d1862c4b3aa5d01b9c39062946 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
@@ -77,7 +77,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
if (!isLoaded) {
|
|
if (Projectile.loadedThisTick > gg.pufferfish.pufferfish.PufferfishConfig.maxProjectileLoadsPerTick) {
|
|
if (++this.loadedLifetime > gg.pufferfish.pufferfish.PufferfishConfig.maxProjectileLoadsPerProjectile) {
|
|
- this.discard();
|
|
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Purpur - Fix pufferfish issues
|
|
}
|
|
return;
|
|
}
|
|
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 99a95d77f44dddfd7be6c2ebd60e827d9de956b7..00ea1c2037c7c7780764bfcc3e07b6554e910db2 100644
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
|
@@ -135,7 +135,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
|
this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE;
|
|
// Paper end - get block chunk optimisation
|
|
|
|
- this.lightningTick = new java.util.Random().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 - Fix pufferfish issues
|
|
}
|
|
|
|
// CraftBukkit start
|