mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Clean up config
This commit is contained in:
@@ -51,7 +51,7 @@ index cafc4391d2ed3df7b0b8d73c663777cdbb3a5de9..8ba7f4aad1ff28d5f38b895e8eb47e14
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f9805f6e247a01b2c6d6771c2f33cdd40e84690f
|
||||
index 0000000000000000000000000000000000000000..d924db6378b2c60c7b96cf5c45a6d50a091f9790
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -0,0 +1,171 @@
|
||||
@@ -109,11 +109,11 @@ index 0000000000000000000000000000000000000000..f9805f6e247a01b2c6d6771c2f33cdd4
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ getString("info.version", "1.1");
|
||||
+ getString("info.version", "1.2");
|
||||
+ setComment("info",
|
||||
+ "Leaf Config",
|
||||
+ "Github Repo: https://github.com/Winds-Studio/Leaf",
|
||||
+ "Discord: Dreeam#0851 | QQ: 2682173972");
|
||||
+ "Discord: dreeam___ | QQ: 2682173972");
|
||||
+
|
||||
+ for (Method method : LeafConfig.class.getDeclaredMethods()) {
|
||||
+ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers()) && method.getParameterCount() == 0 &&
|
||||
|
||||
@@ -149,16 +149,15 @@ index 0000000000000000000000000000000000000000..731ef11c7a025ae95ed8a757b530d834
|
||||
+}
|
||||
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..bcacccd9d47697bea0405f2544be94fca863c494
|
||||
index 0000000000000000000000000000000000000000..ab7a4acec52320c30623023c5fc9423e73f77a3b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryManager.java
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,39 @@
|
||||
+package gg.pufferfish.pufferfish.sentry;
|
||||
+
|
||||
+import io.sentry.Sentry;
|
||||
+import org.apache.logging.log4j.LogManager;
|
||||
+import org.apache.logging.log4j.Logger;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
+
|
||||
+public class SentryManager {
|
||||
+
|
||||
@@ -178,7 +177,7 @@ index 0000000000000000000000000000000000000000..bcacccd9d47697bea0405f2544be94fc
|
||||
+ initialized = true;
|
||||
+
|
||||
+ Sentry.init(options -> {
|
||||
+ options.setDsn(LeafConfig.sentryDsn);
|
||||
+ options.setDsn(org.dreeam.leaf.LeafConfig.sentryDsn);
|
||||
+ options.setMaxBreadcrumbs(100);
|
||||
+ });
|
||||
+
|
||||
@@ -194,21 +193,21 @@ index 0000000000000000000000000000000000000000..bcacccd9d47697bea0405f2544be94fc
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index f9805f6e247a01b2c6d6771c2f33cdd40e84690f..e8b770ad0f7b715deeeb6469a881d65640fd3bf5 100644
|
||||
index d924db6378b2c60c7b96cf5c45a6d50a091f9790..b1fcd3588c22143f9852805a6cea3b6cf6c33a1f 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -163,7 +163,14 @@ public class LeafConfig {
|
||||
private static void removal() {
|
||||
}
|
||||
@@ -168,4 +168,14 @@ public class LeafConfig {
|
||||
|
||||
private static void network() {
|
||||
}
|
||||
+
|
||||
+ public static String sentryDsn = "";
|
||||
private static void performance() {
|
||||
+ private static void sentryDsn() {
|
||||
+ String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
+ String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
+ String sentryConfig = getString("sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/welcome/");
|
||||
+ sentryDsn = sentryEnvironment == null ? sentryConfig : sentryEnvironment;
|
||||
+ if (sentryDsn != null && !sentryDsn.isBlank()) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryManager.init();
|
||||
+ }
|
||||
}
|
||||
|
||||
private static void network() {
|
||||
+ }
|
||||
}
|
||||
|
||||
@@ -32,27 +32,19 @@ index ff5c9492f2933cc9ba5a4e15998ba756497eac89..b2cb60cfffbe2b6c5ff4b29f8d242cfb
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 8ba7f4aad1ff28d5f38b895e8eb47e141390e5ea..69c594bbd52335d6779b06f9273a1ef8e8138a67 100644
|
||||
index 8ba7f4aad1ff28d5f38b895e8eb47e141390e5ea..2298fc54be24f5464632066be14c68356e37ab71 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -47,6 +47,7 @@ import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.GameType;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.galemc.gale.command.GaleCommands;
|
||||
import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
@@ -358,6 +359,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -358,6 +358,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.info("JMX monitoring enabled");
|
||||
}
|
||||
|
||||
+ if (LeafConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
|
||||
+ if (org.dreeam.leaf.LeafConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
|
||||
return true;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 780deea4805dfdd80d47e20ca1c2fcac17e5cabc..be9110a4ac4717956c07f37ee5ab8cbed3b771a7 100644
|
||||
index 767f27759c3372b80d65f00195fcb49e8215fdf4..1984b29fc2830a6dcc8e443f241f24987c0d0c9d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -342,7 +342,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -165,24 +157,17 @@ index 4cdfc433df67afcd455422e9baf56f167dd712ae..57fcf3910f45ce371ac2e237b277b103
|
||||
private void ensureActiveIsNotIterated() {
|
||||
// Paper - replace with better logic, do not delay removals
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index e8b770ad0f7b715deeeb6469a881d65640fd3bf5..3f399cd0fa0c1b90f775a004bb2c6e7b6bd6c74e 100644
|
||||
index b1fcd3588c22143f9852805a6cea3b6cf6c33a1f..5d161351e7517acf57e98203bab8c9f9ab9d4005 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -164,6 +164,8 @@ public class LeafConfig {
|
||||
@@ -163,7 +163,20 @@ public class LeafConfig {
|
||||
private static void removal() {
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
+ public static boolean enableAsyncMobSpawning;
|
||||
+ public static boolean enableAsyncMobSpawning = true;
|
||||
+ public static boolean asyncMobSpawningInitialized;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -171,6 +173,18 @@ public class LeafConfig {
|
||||
if (sentryDsn != null && !sentryDsn.isBlank()) {
|
||||
gg.pufferfish.pufferfish.sentry.SentryManager.init();
|
||||
}
|
||||
+ boolean temp = getBoolean("performance.enable-async-mob-spawning", true,
|
||||
+ "Async mob spawning is unstable on Leaf, uses as your own risk!",
|
||||
+ boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
+ "Whether or not asynchronous mob spawning should be enabled.",
|
||||
+ "On servers with many entities, this can improve performance by up to 15%. You must have",
|
||||
+ "paper's per-player-mob-spawns setting set to true for this to work.",
|
||||
@@ -191,7 +176,7 @@ index e8b770ad0f7b715deeeb6469a881d65640fd3bf5..3f399cd0fa0c1b90f775a004bb2c6e7b
|
||||
+ // This prevents us from changing the value during a reload.
|
||||
+ if (!asyncMobSpawningInitialized) {
|
||||
+ asyncMobSpawningInitialized = true;
|
||||
+ enableAsyncMobSpawning = temp;
|
||||
+ enableAsyncMobSpawning = asyncMobSpawning;
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -42,24 +42,16 @@ index 1462f9d4f2cdf4071fb002d602783866a5a3d285..5d6c0f5d2d993ae3a044a1a02716a266
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d16afd229700563ff81b283625f31a3fbd14cfd1..b818da9c6f0617b93ab5f5979c9fd4f3797bc7d8 100644
|
||||
index 05a7f024848048b7bca227212584e2ccc82200f7..25225cd9d31df9084a5c53c504607978722ee507 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -125,6 +125,7 @@ import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
import net.minecraft.world.scores.Team;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@@ -435,6 +436,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -435,6 +435,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Pufferfish start
|
||||
+ public boolean activatedPriorityReset = false; // DAB
|
||||
+ public int activatedPriority = LeafConfig.maximumActivationPrio; // golf score
|
||||
+ public int activatedPriority = org.dreeam.leaf.LeafConfig.maximumActivationPrio; // golf score
|
||||
+ // Pufferfish end
|
||||
+
|
||||
public float getBukkitYaw() {
|
||||
@@ -127,24 +119,16 @@ index 646d9a121d908a2fc3e4e302484dd5cd1bfc6804..e546ecdccde352502e26a8668eaaafe0
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
index 86fc528551c2c90c78783d4d46a4a2c52e4efe41..67fa9b4fb37d20a808378f00002d00b0b46114e2 100644
|
||||
index 86fc528551c2c90c78783d4d46a4a2c52e4efe41..034dfd1a62f97ffa4ca2c466fea609cee18d4798 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
|
||||
@@ -13,6 +13,7 @@ import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public class GoalSelector {
|
||||
@@ -51,9 +52,12 @@ public class GoalSelector {
|
||||
@@ -51,9 +51,12 @@ public class GoalSelector {
|
||||
}
|
||||
|
||||
// Paper start
|
||||
- public boolean inactiveTick() {
|
||||
+ public boolean inactiveTick(int tickRate, boolean inactive) { // Pufferfish start
|
||||
+ if (inactive && !LeafConfig.dearEnabled) tickRate = 4; // reset to Paper's
|
||||
+ if (inactive && !org.dreeam.leaf.LeafConfig.dabEnabled) tickRate = 4; // reset to Paper's
|
||||
+ tickRate = Math.min(tickRate, this.newGoalRate);
|
||||
this.curRate++;
|
||||
- return this.curRate % this.newGoalRate == 0;
|
||||
@@ -311,7 +295,7 @@ index ae3628efe7628427c53bb7d0f7fc6e457a511b94..67d3ce0dc480aa457e4a9ef5e08ae7c6
|
||||
this.assignProfessionWhenSpawned = false;
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 3f399cd0fa0c1b90f775a004bb2c6e7b6bd6c74e..173c9d76c478a078b235e71707904ba58e0ec4f3 100644
|
||||
index 5d161351e7517acf57e98203bab8c9f9ab9d4005..47c7b75b721bb2210eded56a7590612fbc3a395c 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -1,7 +1,9 @@
|
||||
@@ -332,31 +316,31 @@ index 3f399cd0fa0c1b90f775a004bb2c6e7b6bd6c74e..173c9d76c478a078b235e71707904ba5
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -166,6 +169,11 @@ public class LeafConfig {
|
||||
public static String sentryDsn = "";
|
||||
public static boolean enableAsyncMobSpawning;
|
||||
@@ -165,6 +168,11 @@ public class LeafConfig {
|
||||
|
||||
public static boolean enableAsyncMobSpawning = true;
|
||||
public static boolean asyncMobSpawningInitialized;
|
||||
+ public static boolean dearEnabled;
|
||||
+ public static int startDistance;
|
||||
+ public static boolean dabEnabled = true;
|
||||
+ public static int startDistance = 12;
|
||||
+ public static int startDistanceSquared;
|
||||
+ public static int maximumActivationPrio;
|
||||
+ public static int activationDistanceMod;
|
||||
+ public static int maximumActivationPrio = 20;
|
||||
+ public static int activationDistanceMod = 8;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -185,6 +193,27 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -177,6 +185,27 @@ public class LeafConfig {
|
||||
asyncMobSpawningInitialized = true;
|
||||
enableAsyncMobSpawning = temp;
|
||||
enableAsyncMobSpawning = asyncMobSpawning;
|
||||
}
|
||||
+ dearEnabled = getBoolean("performance.dab.enabled", "dab.enabled", true);
|
||||
+ startDistance = getInt("performance.dab.start-distance", "dab.start-distance", 12,
|
||||
+ dabEnabled = getBoolean("performance.dab.enabled", "dab.enabled", dabEnabled);
|
||||
+ startDistance = getInt("performance.dab.start-distance", "dab.start-distance", startDistance,
|
||||
+ "This value determines how far away an entity has to be",
|
||||
+ "from the player to start being effected by DEAR.");
|
||||
+ startDistanceSquared = startDistance * startDistance;
|
||||
+ maximumActivationPrio = getInt("performance.dab.max-tick-freq", "dab.max-tick-freq", 20,
|
||||
+ maximumActivationPrio = getInt("performance.dab.max-tick-freq", "dab.max-tick-freq", maximumActivationPrio,
|
||||
+ "This value defines how often in ticks, the furthest entity",
|
||||
+ "will get their pathfinders and behaviors ticked. 20 = 1s");
|
||||
+ activationDistanceMod = getInt("performance.dab.activation-dist-mod", "dab.activation-dist-mod", 8,
|
||||
+ activationDistanceMod = getInt("performance.dab.activation-dist-mod", "dab.activation-dist-mod", activationDistanceMod,
|
||||
+ "This value defines how much distance modifies an entity's",
|
||||
+ "tick frequency. freq = (distanceToPlayer^2) / (2^value)",
|
||||
+ "If you want further away entities to tick less often, use 7.",
|
||||
@@ -373,14 +357,12 @@ index 3f399cd0fa0c1b90f775a004bb2c6e7b6bd6c74e..173c9d76c478a078b235e71707904ba5
|
||||
|
||||
private static void network() {
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 50cd68e40c67b83af4e8008ce93782a060658dd4..70542f89d89db4b14b75aff07eccafa1680d317b 100644
|
||||
index 50cd68e40c67b83af4e8008ce93782a060658dd4..9186aa5baf313f45b4befe6f062566b6698f6702 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -38,7 +38,11 @@ import co.aikar.timings.MinecraftTimings;
|
||||
import net.minecraft.world.entity.schedule.Activity;
|
||||
@@ -39,6 +39,9 @@ import net.minecraft.world.entity.schedule.Activity;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.galemc.gale.configuration.GaleWorldConfiguration;
|
||||
+// Pufferfish start
|
||||
+import net.minecraft.world.phys.Vec3;
|
||||
@@ -388,23 +370,23 @@ index 50cd68e40c67b83af4e8008ce93782a060658dd4..70542f89d89db4b14b75aff07eccafa1
|
||||
|
||||
public class ActivationRange
|
||||
{
|
||||
@@ -231,6 +235,25 @@ public class ActivationRange
|
||||
@@ -231,6 +234,25 @@ public class ActivationRange
|
||||
for (int i = 0; i < entities.size(); i++) {
|
||||
Entity entity = entities.get(i);
|
||||
ActivationRange.activateEntity(entity);
|
||||
+
|
||||
+ // Pufferfish start
|
||||
+ if (LeafConfig.dearEnabled && entity.getType().dabEnabled) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.dabEnabled && entity.getType().dabEnabled) {
|
||||
+ if (!entity.activatedPriorityReset) {
|
||||
+ entity.activatedPriorityReset = true;
|
||||
+ entity.activatedPriority = LeafConfig.maximumActivationPrio;
|
||||
+ entity.activatedPriority = org.dreeam.leaf.LeafConfig.maximumActivationPrio;
|
||||
+ }
|
||||
+ Vec3 playerVec = player.position();
|
||||
+ Vec3 entityVec = entity.position();
|
||||
+ double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z;
|
||||
+ int squaredDistance = (int) (diffX * diffX + diffY * diffY + diffZ * diffZ);
|
||||
+ entity.activatedPriority = squaredDistance > LeafConfig.startDistanceSquared ?
|
||||
+ Math.max(1, Math.min(squaredDistance >> LeafConfig.activationDistanceMod, entity.activatedPriority)) :
|
||||
+ entity.activatedPriority = squaredDistance > org.dreeam.leaf.LeafConfig.startDistanceSquared ?
|
||||
+ Math.max(1, Math.min(squaredDistance >> org.dreeam.leaf.LeafConfig.activationDistanceMod, entity.activatedPriority)) :
|
||||
+ 1;
|
||||
+ } else {
|
||||
+ entity.activatedPriority = 1;
|
||||
@@ -414,7 +396,7 @@ index 50cd68e40c67b83af4e8008ce93782a060658dd4..70542f89d89db4b14b75aff07eccafa1
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -247,12 +270,12 @@ public class ActivationRange
|
||||
@@ -247,12 +269,12 @@ public class ActivationRange
|
||||
if ( MinecraftServer.currentTick > entity.activatedTick )
|
||||
{
|
||||
if ( entity.defaultActivationState )
|
||||
|
||||
@@ -7,18 +7,10 @@ Original license: GPL v3
|
||||
Original project: https://github.com/pufferfish-gg/Pufferfish
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 979b76d58d05c9d83dfae45d3052eea9431dfc65..1674f9accbbbb9ecdd99f05da6032398c4d82b38 100644
|
||||
index 979b76d58d05c9d83dfae45d3052eea9431dfc65..20e0e03efc8bc878bc4a1fe66d2d4027b381d7c4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -83,6 +83,7 @@ import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.EntityTransformEvent;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent.UnleashReason;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -220,11 +221,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -220,11 +220,13 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
return this.lookControl;
|
||||
}
|
||||
|
||||
@@ -28,28 +20,28 @@ index 979b76d58d05c9d83dfae45d3052eea9431dfc65..1674f9accbbbb9ecdd99f05da6032398
|
||||
public void inactiveTick() {
|
||||
super.inactiveTick();
|
||||
- if (this.goalSelector.inactiveTick(this.activatedPriority, true)) { // Pufferfish - pass activated priroity
|
||||
+ boolean isThrottled = LeafConfig.throttleInactiveGoalSelectorTick && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
|
||||
+ boolean isThrottled = org.dreeam.leaf.LeafConfig.throttleInactiveGoalSelectorTick && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
|
||||
+ if (this.goalSelector.inactiveTick(this.activatedPriority, true) && !isThrottled) { // Pufferfish - pass activated priroity // Pufferfish - throttle inactive goal selector ticking
|
||||
this.goalSelector.tick();
|
||||
}
|
||||
if (this.targetSelector.inactiveTick(this.activatedPriority, true)) { // Pufferfish - pass activated priority
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 173c9d76c478a078b235e71707904ba58e0ec4f3..beb548a047b7dedabbd5a720102b7e0400cea6d8 100644
|
||||
index 47c7b75b721bb2210eded56a7590612fbc3a395c..9a11228726c9a489181fc8a0c511ea83cdcf0f6e 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -174,6 +174,7 @@ public class LeafConfig {
|
||||
@@ -173,6 +173,7 @@ public class LeafConfig {
|
||||
public static int startDistanceSquared;
|
||||
public static int maximumActivationPrio;
|
||||
public static int activationDistanceMod;
|
||||
+ public static boolean throttleInactiveGoalSelectorTick;
|
||||
public static int maximumActivationPrio = 20;
|
||||
public static int activationDistanceMod = 8;
|
||||
+ public static boolean throttleInactiveGoalSelectorTick = true;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -214,6 +215,9 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -206,6 +207,9 @@ public class LeafConfig {
|
||||
entityType.dabEnabled = false;
|
||||
}, () -> MinecraftServer.LOGGER.warn("Unknown entity \"" + name + "\"")));
|
||||
setComment("performance.dab", "Optimizes entity brains when", "they're far away from the player");
|
||||
+ throttleInactiveGoalSelectorTick = getBoolean("performance.inactive-goal-selector-throttle", "inactive-goal-selector-throttle", true,
|
||||
+ throttleInactiveGoalSelectorTick = getBoolean("performance.inactive-goal-selector-throttle", "inactive-goal-selector-throttle", throttleInactiveGoalSelectorTick,
|
||||
+ "Throttles the AI goal selector in entity inactive ticks.",
|
||||
+ "This can improve performance by a few percent, but has minor gameplay implications.");
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPL v3
|
||||
Original project: https://github.com/pufferfish-gg/Pufferfish
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index aa0ed8ab417d15c31971e8adb99842e77adf0c58..9806386175885ed8b9fa4f231aee19fea562420d 100644
|
||||
index 25225cd9d31df9084a5c53c504607978722ee507..1d3977fe43c75c955160bf8d9775182e20be7dcb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -827,6 +827,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -826,6 +826,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
@@ -36,7 +36,7 @@ index 1679f0a3d095a7b758b468c77b6d3a4c078b7962..aa5cec6d56d7a8e80861aa4c9b4a74ca
|
||||
private String descriptionId;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index beb548a047b7dedabbd5a720102b7e0400cea6d8..50d1e6e6240335cab5a7d3e5ce574b9e1e1ca0fb 100644
|
||||
index 9a11228726c9a489181fc8a0c511ea83cdcf0f6e..9299d2fe1cda71b6881fd8bd65d3d74b1189a196 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -17,6 +17,7 @@ import java.lang.reflect.Method;
|
||||
@@ -47,16 +47,16 @@ index beb548a047b7dedabbd5a720102b7e0400cea6d8..50d1e6e6240335cab5a7d3e5ce574b9e
|
||||
import java.util.Map;
|
||||
|
||||
public class LeafConfig {
|
||||
@@ -175,6 +176,7 @@ public class LeafConfig {
|
||||
public static int maximumActivationPrio;
|
||||
public static int activationDistanceMod;
|
||||
public static boolean throttleInactiveGoalSelectorTick;
|
||||
@@ -174,6 +175,7 @@ public class LeafConfig {
|
||||
public static int maximumActivationPrio = 20;
|
||||
public static int activationDistanceMod = 8;
|
||||
public static boolean throttleInactiveGoalSelectorTick = true;
|
||||
+ public static Map<String, Integer> projectileTimeouts;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -218,6 +220,18 @@ public class LeafConfig {
|
||||
throttleInactiveGoalSelectorTick = getBoolean("performance.inactive-goal-selector-throttle", "inactive-goal-selector-throttle", true,
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -210,6 +212,18 @@ public class LeafConfig {
|
||||
throttleInactiveGoalSelectorTick = getBoolean("performance.inactive-goal-selector-throttle", "inactive-goal-selector-throttle", throttleInactiveGoalSelectorTick,
|
||||
"Throttles the AI goal selector in entity inactive ticks.",
|
||||
"This can improve performance by a few percent, but has minor gameplay implications.");
|
||||
+ // Set some defaults
|
||||
|
||||
@@ -766,10 +766,10 @@ index d601d287e94a59ff93b8a83a44dac02544d211df..0ff3b06a98b2f4514b2d861b92dd70fe
|
||||
itemstack1.setCount(1);
|
||||
entityitem = entityplayer.drop(itemstack1, false, false, false); // SPIGOT-2942: Add boolean to call event
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 69c594bbd52335d6779b06f9273a1ef8e8138a67..035a886c550c8b08b5821277628b8b7bd7482866 100644
|
||||
index 2298fc54be24f5464632066be14c68356e37ab71..1354db9ae7eefaedda311e6cdbb4b02d64d0646f 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -99,6 +99,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -98,6 +98,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
return;
|
||||
}
|
||||
// Paper start - Use TerminalConsoleAppender
|
||||
@@ -777,7 +777,7 @@ index 69c594bbd52335d6779b06f9273a1ef8e8138a67..035a886c550c8b08b5821277628b8b7b
|
||||
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
|
||||
/*
|
||||
jline.console.ConsoleReader bufferedreader = reader;
|
||||
@@ -223,6 +224,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -222,6 +223,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
||||
GaleCommands.registerCommands(this); // Gale - Gale commands - register commands
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
|
||||
@@ -793,7 +793,7 @@ index 69c594bbd52335d6779b06f9273a1ef8e8138a67..035a886c550c8b08b5821277628b8b7b
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
@@ -287,6 +297,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -286,6 +296,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?");
|
||||
return false;
|
||||
}
|
||||
@@ -824,10 +824,10 @@ index 69c594bbd52335d6779b06f9273a1ef8e8138a67..035a886c550c8b08b5821277628b8b7b
|
||||
|
||||
// CraftBukkit start
|
||||
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
||||
@@ -360,6 +394,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -359,6 +393,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
|
||||
if (LeafConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
|
||||
if (org.dreeam.leaf.LeafConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish
|
||||
+ org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur
|
||||
+ org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur
|
||||
return true;
|
||||
@@ -2282,10 +2282,10 @@ index 14fab63346d56c72cd7534a04760efd10eef4295..745e792482f61c571e2efbd4200dd1bd
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e2370bcd1 100644
|
||||
index 1d3977fe43c75c955160bf8d9775182e20be7dcb..af7ad38a2ad1c252616af6355f67ba0fd3982e0f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -157,7 +157,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
@@ -156,7 +156,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2294,7 +2294,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
public boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation
|
||||
@@ -336,7 +336,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -335,7 +335,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -2303,7 +2303,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
public boolean noPhysics;
|
||||
protected final RandomSource random;
|
||||
public int tickCount;
|
||||
@@ -378,7 +378,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -377,7 +377,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private final Set<String> tags;
|
||||
private final double[] pistonDeltas;
|
||||
private long pistonDeltasGameTime;
|
||||
@@ -2312,7 +2312,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
private float eyeHeight;
|
||||
public boolean isInPowderSnow;
|
||||
public boolean wasInPowderSnow;
|
||||
@@ -419,6 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -418,6 +418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean collidingWithWorldBorder; // Paper
|
||||
@@ -2320,7 +2320,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -494,6 +495,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -493,6 +494,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2363,7 +2363,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
public final boolean hardCollides() {
|
||||
return this.hardCollides;
|
||||
}
|
||||
@@ -599,7 +636,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -598,7 +635,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.bb = Entity.INITIAL_AABB;
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
this.nextStep = 1.0F;
|
||||
@@ -2372,7 +2372,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
this.remainingFireTicks = -this.getFireImmuneTicks();
|
||||
this.fluidHeight = new Object2DoubleArrayMap(2);
|
||||
this.fluidOnEyes = new HashSet();
|
||||
@@ -920,10 +957,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -919,10 +956,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
public void checkBelowWorld() {
|
||||
// Paper start - Configurable nether ceiling damage
|
||||
@@ -2385,7 +2385,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
this.onBelowWorld();
|
||||
}
|
||||
|
||||
@@ -1815,7 +1853,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1814,7 +1852,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -2394,7 +2394,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -1884,7 +1922,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1883,7 +1921,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.isInWater() || flag;
|
||||
}
|
||||
|
||||
@@ -2403,7 +2403,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
if (entity instanceof Boat) {
|
||||
@@ -2493,6 +2531,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2492,6 +2530,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
nbt.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -2415,7 +2415,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2661,6 +2704,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2660,6 +2703,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
@@ -2427,7 +2427,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -2962,6 +3010,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2961,6 +3009,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.passengers = ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
@@ -2441,7 +2441,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
|
||||
}
|
||||
}
|
||||
@@ -3002,6 +3057,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3001,6 +3056,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return false;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -2456,7 +2456,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -3061,12 +3124,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3060,12 +3123,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -2473,7 +2473,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
}
|
||||
|
||||
this.isInsidePortal = true;
|
||||
@@ -3115,7 +3181,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3114,7 +3180,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.processPortalCooldown();
|
||||
@@ -2482,7 +2482,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3301,7 +3367,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3300,7 +3366,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -2491,7 +2491,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -3760,7 +3826,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3759,7 +3825,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean canChangeDimensions() {
|
||||
@@ -2500,7 +2500,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
}
|
||||
|
||||
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
|
||||
@@ -4067,6 +4133,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4066,6 +4132,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return SlotAccess.NULL;
|
||||
}
|
||||
|
||||
@@ -2521,7 +2521,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {}
|
||||
|
||||
@@ -4348,6 +4428,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4347,6 +4427,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.yRotO = this.getYRot();
|
||||
}
|
||||
|
||||
@@ -2534,7 +2534,7 @@ index 9806386175885ed8b9fa4f231aee19fea562420d..17eb6e690f358bd660b364c8dbe2a08e
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
if (false && this.touchingUnloadedChunk()) { // Gale - Airplane - reduce entity fluid lookups if no fluids - cost of a lookup here is the same cost as below, so skip
|
||||
return false;
|
||||
@@ -4911,4 +4997,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4910,4 +4996,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end
|
||||
@@ -3099,7 +3099,7 @@ index a35891723fad4fe984566c41cdd728004f8f371e..fe493fd87d8435035d17dae59d4ad264
|
||||
});
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591ef40a67a 100644
|
||||
index 20e0e03efc8bc878bc4a1fe66d2d4027b381d7c4..b27b1df608bca3242bed8bc5b7603d0e88fa50bf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -65,6 +65,7 @@ import net.minecraft.world.item.ProjectileWeaponItem;
|
||||
@@ -3110,7 +3110,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -133,6 +134,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -132,6 +133,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
private BlockPos restrictCenter;
|
||||
private float restrictRadius;
|
||||
|
||||
@@ -3118,7 +3118,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
public boolean aware = true; // CraftBukkit
|
||||
|
||||
protected Mob(EntityType<? extends Mob> type, Level world) {
|
||||
@@ -148,8 +150,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -147,8 +149,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.goalSelector = new GoalSelector();
|
||||
this.targetSelector = new GoalSelector();
|
||||
// Gale end - Purpur - remove vanilla profiler
|
||||
@@ -3129,7 +3129,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
this.jumpControl = new JumpControl(this);
|
||||
this.bodyRotationControl = this.createBodyControl();
|
||||
this.navigation = this.createNavigation(world);
|
||||
@@ -325,6 +327,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -324,6 +326,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
entityliving = null;
|
||||
}
|
||||
}
|
||||
@@ -3137,7 +3137,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
this.target = entityliving;
|
||||
return true;
|
||||
// CraftBukkit end
|
||||
@@ -369,8 +372,28 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -368,8 +371,28 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.resetAmbientSoundTime();
|
||||
this.playAmbientSound();
|
||||
}
|
||||
@@ -3166,7 +3166,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
@Override
|
||||
protected void playHurtSound(DamageSource source) {
|
||||
this.resetAmbientSoundTime();
|
||||
@@ -560,6 +583,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -559,6 +582,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
|
||||
nbt.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit
|
||||
@@ -3174,7 +3174,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -630,6 +654,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -629,6 +653,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.aware = nbt.getBoolean("Bukkit.Aware");
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -3186,7 +3186,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -673,7 +702,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -672,7 +701,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@Override
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
@@ -3195,7 +3195,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
Vec3i baseblockposition = this.getPickupReach();
|
||||
List<ItemEntity> list = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ()));
|
||||
Iterator iterator = list.iterator();
|
||||
@@ -1143,6 +1172,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1142,6 +1171,12 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
}
|
||||
|
||||
@@ -3208,7 +3208,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
@Nullable
|
||||
public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel) {
|
||||
switch (equipmentSlot) {
|
||||
@@ -1237,7 +1272,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1236,7 +1271,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
RandomSource randomsource = world.getRandom();
|
||||
|
||||
this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.MULTIPLY_BASE));
|
||||
@@ -3217,7 +3217,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
this.setLeftHanded(true);
|
||||
} else {
|
||||
this.setLeftHanded(false);
|
||||
@@ -1285,6 +1320,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1284,6 +1319,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
if (!this.isAlive()) {
|
||||
return InteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == player) {
|
||||
@@ -3225,7 +3225,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
// Paper start - drop leash variable
|
||||
org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.getAbilities().instabuild);
|
||||
@@ -1358,7 +1394,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1357,7 +1393,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
protected void onOffspringSpawnedFromEgg(Player player, Mob child) {}
|
||||
|
||||
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
|
||||
@@ -3234,7 +3234,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
}
|
||||
|
||||
public boolean isWithinRestriction() {
|
||||
@@ -1663,6 +1699,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1662,6 +1698,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
this.setLastHurtMob(target);
|
||||
}
|
||||
|
||||
@@ -3242,7 +3242,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -1678,34 +1715,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1677,34 +1714,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
}
|
||||
|
||||
@@ -3278,7 +3278,7 @@ index 1674f9accbbbb9ecdd99f05da6032398c4d82b38..c276cfd153627d6ec13314fa84b7e591
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1752,4 +1763,56 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1751,4 +1762,56 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
|
||||
return itemmonsteregg == null ? null : new ItemStack(itemmonsteregg);
|
||||
}
|
||||
@@ -24698,7 +24698,7 @@ index 0000000000000000000000000000000000000000..b7586f494528f30eb0da82420d3bcf5b
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 70542f89d89db4b14b75aff07eccafa1680d317b..88a2f2fc72f81dbf372b27a06b376f5df4ce2873 100644
|
||||
index 9186aa5baf313f45b4befe6f062566b6698f6702..1f9b7ac1e87baa484b6d38c3bd1f18654710e460 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.world.entity.ambient.AmbientCreature;
|
||||
@@ -24709,7 +24709,7 @@ index 70542f89d89db4b14b75aff07eccafa1680d317b..88a2f2fc72f81dbf372b27a06b376f5d
|
||||
import net.minecraft.world.entity.animal.WaterAnimal;
|
||||
import net.minecraft.world.entity.animal.horse.Llama;
|
||||
import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||
@@ -217,6 +218,7 @@ public class ActivationRange
|
||||
@@ -216,6 +217,7 @@ public class ActivationRange
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -24717,7 +24717,7 @@ index 70542f89d89db4b14b75aff07eccafa1680d317b..88a2f2fc72f81dbf372b27a06b376f5d
|
||||
// Paper start
|
||||
int worldHeight = world.getHeight();
|
||||
ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange );
|
||||
@@ -410,6 +412,7 @@ public class ActivationRange
|
||||
@@ -409,6 +411,7 @@ public class ActivationRange
|
||||
*/
|
||||
public static boolean checkIfActive(Entity entity)
|
||||
{
|
||||
|
||||
@@ -5,32 +5,24 @@ Subject: [PATCH] Remove Mojang username check
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index badb262810effd22ca1ba021a1e746a777a19cbc..c2f4f257313a16a8063322b650154eeb82696f2e 100644
|
||||
index badb262810effd22ca1ba021a1e746a777a19cbc..9baf55e9c3259aed431022a50c12d4f215c3ed80 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -37,6 +37,7 @@ import net.minecraft.util.Crypt;
|
||||
import net.minecraft.util.CryptException;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -253,10 +254,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -253,10 +253,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
public void handleHello(ServerboundHelloPacket packet) {
|
||||
// Gale start - JettPack - reduce array allocations
|
||||
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", ArrayConstants.emptyObjectArray);
|
||||
- Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray);
|
||||
+ if (!LeafConfig.removeMojangUsernameCheck) Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray); // Leaf - Remove Mojang's username check
|
||||
+ if (!org.dreeam.leaf.LeafConfig.removeMojangUsernameCheck) Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray); // Leaf - Remove Mojang's username check
|
||||
// Gale end - JettPack - reduce array allocations
|
||||
// Paper start - validate usernames
|
||||
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !LeafConfig.removeMojangUsernameCheck) { // Leaf - Remove Mojang's username check
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !org.dreeam.leaf.LeafConfig.removeMojangUsernameCheck) { // Leaf - Remove Mojang's username check
|
||||
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
|
||||
ServerLoginPacketListenerImpl.this.disconnect("Failed to verify username!");
|
||||
return;
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 3dafe7583b9d0fc66004eadcfb4ba37fd743f074..64da1ac84c4c61a817363487c14491367ca04180 100644
|
||||
index 80a196442edbc6b4eb44bb6a405100871aea2f6a..1e9a440d790bdd521c58dfc9c1575e2759006d02 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -169,7 +169,11 @@ public class LeafConfig {
|
||||
@@ -44,4 +36,4 @@ index 3dafe7583b9d0fc66004eadcfb4ba37fd743f074..64da1ac84c4c61a817363487c1449136
|
||||
+ "enabling all characters as username");
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
public static boolean enableAsyncMobSpawning = true;
|
||||
|
||||
@@ -5,28 +5,20 @@ Subject: [PATCH] Remove Spigot Check for Broken BungeeCord Configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 2821de09a36fc315897129f4691ba713386737db..3f60c1e5bf49784ac2a812157a5d22ce28e34ed6 100644
|
||||
index 2821de09a36fc315897129f4691ba713386737db..5468b2fe5d0dd3e2b0ef774dff57e42e99baaece 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.network.protocol.handshake.ServerHandshakePacketListener;
|
||||
import net.minecraft.network.protocol.login.ClientboundLoginDisconnectPacket;
|
||||
import net.minecraft.network.protocol.status.ServerStatus;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.net.InetAddress;
|
||||
@@ -136,7 +137,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -136,7 +136,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
{
|
||||
connection.spoofedProfile = ServerHandshakePacketListenerImpl.gson.fromJson(split[3], com.mojang.authlib.properties.Property[].class);
|
||||
}
|
||||
- } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) {
|
||||
+ } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) && !(LeafConfig.removeSpigotCheckBungeeConfig)) { // Leaf - Remove Spigot check for broken BungeeCord configurations
|
||||
+ } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) && !(org.dreeam.leaf.LeafConfig.removeSpigotCheckBungeeConfig)) { // Leaf - Remove Spigot check for broken BungeeCord configurations
|
||||
Component chatmessage = Component.literal("Unknown data in login hostname, did you forget to enable BungeeCord in spigot.yml?");
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
this.connection.disconnect(chatmessage);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 64da1ac84c4c61a817363487c14491367ca04180..5087732f4e78fb5a567674914174142777d762ef 100644
|
||||
index 1e9a440d790bdd521c58dfc9c1575e2759006d02..267f88d799fe98d1741a837c33d8c748362077ee 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -170,10 +170,14 @@ public class LeafConfig {
|
||||
@@ -43,4 +35,4 @@ index 64da1ac84c4c61a817363487c14491367ca04180..5087732f4e78fb5a5676749141741427
|
||||
+ "without backend server enabling its bungee mode");
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
public static boolean enableAsyncMobSpawning = true;
|
||||
|
||||
@@ -7,28 +7,20 @@ This Check is added in 1.17.x -> 1.18.x update by Mojang.
|
||||
By removing this check, it enable hackers to use some modules of hack clients.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a912462dcd381956c31f19ccd4de826594af65b9..c1431af927a203c16b04a82e0f779fe40dcf0f88 100644
|
||||
index 468866fddd92eef313df413a1d0b94cfccf03469..c3529ae180349b7131e87bd41fbe06ea6aecf062 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -189,6 +189,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -2046,7 +2047,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2046,7 +2046,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
Vec3 vec3d2 = vec3d.subtract(vec3d1);
|
||||
double d0 = 1.0000001D;
|
||||
|
||||
- if (Math.abs(vec3d2.x()) < 1.0000001D && Math.abs(vec3d2.y()) < 1.0000001D && Math.abs(vec3d2.z()) < 1.0000001D) {
|
||||
+ if ((Math.abs(vec3d2.x()) < LeafConfig.maxUseItemDistance && Math.abs(vec3d2.y()) < LeafConfig.maxUseItemDistance && Math.abs(vec3d2.z()) < LeafConfig.maxUseItemDistance) || LeafConfig.removeUseItemOnPacketTooFar) { // Leaf - Remove UseItemOnPacket Too Far Check and make it configurable
|
||||
+ if ((Math.abs(vec3d2.x()) < org.dreeam.leaf.LeafConfig.maxUseItemDistance && Math.abs(vec3d2.y()) < org.dreeam.leaf.LeafConfig.maxUseItemDistance && Math.abs(vec3d2.z()) < org.dreeam.leaf.LeafConfig.maxUseItemDistance) || org.dreeam.leaf.LeafConfig.removeUseItemOnPacketTooFar) { // Leaf - Remove UseItemOnPacket Too Far Check and make it configurable
|
||||
Direction enumdirection = movingobjectpositionblock.getDirection();
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 5087732f4e78fb5a567674914174142777d762ef..065c79a73aa4f1775f5f4efcc90dae46d0ddbf4a 100644
|
||||
index 267f88d799fe98d1741a837c33d8c748362077ee..83fee46886a21349d652b6bc871bd03ffbac2a7d 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -171,6 +171,8 @@ public class LeafConfig {
|
||||
@@ -49,4 +41,4 @@ index 5087732f4e78fb5a567674914174142777d762ef..065c79a73aa4f1775f5f4efcc90dae46
|
||||
+ maxUseItemDistance = getDouble("max-UseItem-distance", maxUseItemDistance, "The max distance of UseItem for players");
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
public static boolean enableAsyncMobSpawning = true;
|
||||
|
||||
@@ -7,39 +7,31 @@ Original license: MIT
|
||||
Original project: https://github.com/KeYiMC/KeYi
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index ec319f30250df17d247f4bd8fc77709dfaf9da01..d88e93b4fd50102b43f63f00d45b28acd3ba6766 100644
|
||||
index ec319f30250df17d247f4bd8fc77709dfaf9da01..70c9df9d134327839d6bce71ac5775d393b3a294 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -39,6 +39,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
// CraftBukkit end
|
||||
import org.bukkit.event.player.PlayerAttemptPickupItemEvent; // Paper
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
|
||||
public class ItemEntity extends Entity implements TraceableEntity {
|
||||
|
||||
@@ -337,7 +338,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -337,7 +337,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
ItemStack itemstack1 = other.getItem();
|
||||
|
||||
if (Objects.equals(this.target, other.target) && ItemEntity.areMergable(itemstack, itemstack1)) {
|
||||
- if (true || itemstack1.getCount() < itemstack.getCount()) { // Spigot
|
||||
+ if (LeafConfig.useSpigotItemMergingMechanism || itemstack1.getCount() < itemstack.getCount()) { // Spigot // KeYi
|
||||
+ if (org.dreeam.leaf.LeafConfig.useSpigotItemMergingMechanism || itemstack1.getCount() < itemstack.getCount()) { // Spigot // KeYi
|
||||
ItemEntity.merge(this, itemstack, other, itemstack1);
|
||||
} else {
|
||||
ItemEntity.merge(other, itemstack1, this, itemstack);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 065c79a73aa4f1775f5f4efcc90dae46d0ddbf4a..8f66ee49b0a81fae7b1053a8adc585fc845e17a9 100644
|
||||
index 83fee46886a21349d652b6bc871bd03ffbac2a7d..fc3938c16c43277e22b7a322177fa2a9150f1ff8 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -195,6 +195,7 @@ public class LeafConfig {
|
||||
public static int activationDistanceMod;
|
||||
public static boolean throttleInactiveGoalSelectorTick;
|
||||
@@ -194,6 +194,7 @@ public class LeafConfig {
|
||||
public static int activationDistanceMod = 8;
|
||||
public static boolean throttleInactiveGoalSelectorTick = true;
|
||||
public static Map<String, Integer> projectileTimeouts;
|
||||
+ public static boolean useSpigotItemMergingMechanism = true;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -250,6 +251,7 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -242,6 +243,7 @@ public class LeafConfig {
|
||||
String type = EntityType.getKey(entityType).getPath().toUpperCase(Locale.ROOT);
|
||||
entityType.ttl = config.getInt("entity_timeouts." + type, -1);
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@ index fe493fd87d8435035d17dae59d4ad2645feedfa3..dbe3948a2d1e33e55f628f50d2900cb5
|
||||
|
||||
// Purpur start
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index c276cfd153627d6ec13314fa84b7e591ef40a67a..6227bec25a6f5cd10ef6771c1149a485f13c4eeb 100644
|
||||
index b27b1df608bca3242bed8bc5b7603d0e88fa50bf..b4bd0d158419f9c8a6b473bf16716c2cf7c62cb7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -931,8 +931,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -930,8 +930,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
return;
|
||||
}
|
||||
// Paper end);
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 17eb6e690f358bd660b364c8dbe2a08e2370bcd1..6d2b435e3ba70c98b0d85938c02b38870cfffe4f 100644
|
||||
index af7ad38a2ad1c252616af6355f67ba0fd3982e0f..85011523949f3b20f0a3d5192082859dda17d25e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -420,6 +420,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -419,6 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean collidingWithWorldBorder; // Paper
|
||||
public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API
|
||||
@@ -18,7 +18,7 @@ index 17eb6e690f358bd660b364c8dbe2a08e2370bcd1..6d2b435e3ba70c98b0d85938c02b3887
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -2536,6 +2537,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2535,6 +2536,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
nbt.putBoolean("Purpur.FireImmune", immuneToFire);
|
||||
}
|
||||
// Purpur end
|
||||
@@ -26,7 +26,7 @@ index 17eb6e690f358bd660b364c8dbe2a08e2370bcd1..6d2b435e3ba70c98b0d85938c02b3887
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2709,6 +2711,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2708,6 +2710,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
immuneToFire = nbt.getBoolean("Purpur.FireImmune");
|
||||
}
|
||||
// Purpur end
|
||||
@@ -38,7 +38,7 @@ index 17eb6e690f358bd660b364c8dbe2a08e2370bcd1..6d2b435e3ba70c98b0d85938c02b3887
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -5038,4 +5045,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -5037,4 +5044,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return false;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves
|
||||
This patch is Powered by Jade(https://github.com/Snownee/Jade)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index dcd6b072c4fc5ddd03f0e4a95c6ce324d17814a5..f08c5e0ec2418a722026e4454ae4a5cdc4a0ba61 100644
|
||||
index c3529ae180349b7131e87bd41fbe06ea6aecf062..94b763ef0125781173c7ad9a06e6d43b9f532a4d 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -249,6 +249,7 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
@@ -248,6 +248,7 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.SmithingInventory;
|
||||
@@ -20,11 +20,11 @@ index dcd6b072c4fc5ddd03f0e4a95c6ce324d17814a5..f08c5e0ec2418a722026e4454ae4a5cd
|
||||
// CraftBukkit end
|
||||
|
||||
public class ServerGamePacketListenerImpl implements ServerPlayerConnection, TickablePacketListener, ServerGamePacketListener {
|
||||
@@ -3696,6 +3697,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3695,6 +3696,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
// Paper end
|
||||
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
|
||||
+ if (LeafConfig.jadeProtocol && ProtocolUtils.isNamespacePacket(packet, top.leavesmc.leaves.protocol.JadeProtocol.PROTOCOL_ID)) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.jadeProtocol && ProtocolUtils.isNamespacePacket(packet, top.leavesmc.leaves.protocol.JadeProtocol.PROTOCOL_ID)) {
|
||||
+ top.leavesmc.leaves.protocol.JadeProtocol.handlePacket(server, player, packet);
|
||||
+ }
|
||||
} catch (Exception ex) {
|
||||
@@ -57,18 +57,10 @@ index e91b4d63d42276f8a498cab7c439c785730f3f6f..a2d7c5008c6d6716d9530e00de0db027
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f00dc5b06519f2827a068649394e09ecbdf1a131..2b185b0f8dc9b7f2da0b30f2b393fcf7025f87b2 100644
|
||||
index f00dc5b06519f2827a068649394e09ecbdf1a131..c3d4eafb353448059932bd0065a6e5ab56feac45 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -256,6 +256,7 @@ import org.bukkit.scoreboard.Criteria;
|
||||
import org.bukkit.structure.StructureManager;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.bukkit.util.permissions.DefaultPermissions;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
@@ -483,6 +484,7 @@ public final class CraftServer implements Server {
|
||||
@@ -483,6 +483,7 @@ public final class CraftServer implements Server {
|
||||
MapPalette.setMapColorCache(new CraftMapColorCache(this.logger));
|
||||
}
|
||||
datapackManager = new io.papermc.paper.datapack.PaperDatapackManager(console.getPackRepository()); // Paper
|
||||
@@ -76,12 +68,12 @@ index f00dc5b06519f2827a068649394e09ecbdf1a131..2b185b0f8dc9b7f2da0b30f2b393fcf7
|
||||
}
|
||||
|
||||
public boolean getCommandBlockOverride(String command) {
|
||||
@@ -1076,6 +1078,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1076,6 +1077,11 @@ public final class CraftServer implements Server {
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
this.console.galeConfigurations.reloadConfigs(this.console); // Gale - Gale configuration
|
||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
+ // Leaves start - Jade
|
||||
+ if (LeafConfig.jadeProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.jadeProtocol) {
|
||||
+ top.leavesmc.leaves.protocol.JadeProtocol.enableAllPlayer();
|
||||
+ }
|
||||
+ // Leaves end - Jade
|
||||
@@ -89,10 +81,10 @@ index f00dc5b06519f2827a068649394e09ecbdf1a131..2b185b0f8dc9b7f2da0b30f2b393fcf7
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 8f66ee49b0a81fae7b1053a8adc585fc845e17a9..bc008690cbd87579f98c7c3686321513947f07e6 100644
|
||||
index fc3938c16c43277e22b7a322177fa2a9150f1ff8..9445177d2cb64ae1cd0bd88d0c0b2ad89ef924f6 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -254,6 +254,8 @@ public class LeafConfig {
|
||||
@@ -246,7 +246,9 @@ public class LeafConfig {
|
||||
useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
||||
}
|
||||
|
||||
@@ -100,13 +92,14 @@ index 8f66ee49b0a81fae7b1053a8adc585fc845e17a9..bc008690cbd87579f98c7c3686321513
|
||||
private static void network() {
|
||||
+ jadeProtocol = getBoolean("network.protocol.jade-protocol", jadeProtocol);
|
||||
}
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..dc31969c860e36796307d9bf2abc259bd72fb4d0
|
||||
index 0000000000000000000000000000000000000000..500a8f8d46a3ee2e0f66ff76c7e241794ca15174
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java
|
||||
@@ -0,0 +1,564 @@
|
||||
@@ -0,0 +1,563 @@
|
||||
+package top.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import com.google.common.cache.Cache;
|
||||
@@ -155,7 +148,6 @@ index 0000000000000000000000000000000000000000..dc31969c860e36796307d9bf2abc259b
|
||||
+import net.minecraft.world.phys.BlockHitResult;
|
||||
+import org.apache.commons.lang3.mutable.MutableInt;
|
||||
+import org.apache.logging.log4j.util.TriConsumer;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
+import org.jetbrains.annotations.Contract;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
@@ -196,7 +188,7 @@ index 0000000000000000000000000000000000000000..dc31969c860e36796307d9bf2abc259b
|
||||
+ }
|
||||
+
|
||||
+ public static void onPlayerJoin(ServerPlayer player) {
|
||||
+ if (LeafConfig.jadeProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.jadeProtocol) {
|
||||
+ FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
|
||||
+ buf.writeUtf("{}");
|
||||
+ ProtocolUtils.sendPayloadPacket(player, PACKET_SERVER_PING, buf);
|
||||
@@ -411,7 +403,7 @@ index 0000000000000000000000000000000000000000..dc31969c860e36796307d9bf2abc259b
|
||||
+ }
|
||||
+
|
||||
+ public static void requestEntityData(MinecraftServer server, ServerPlayer player, FriendlyByteBuf buf) {
|
||||
+ if (!LeafConfig.jadeProtocol) {
|
||||
+ if (!org.dreeam.leaf.LeafConfig.jadeProtocol) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@@ -445,7 +437,7 @@ index 0000000000000000000000000000000000000000..dc31969c860e36796307d9bf2abc259b
|
||||
+ }
|
||||
+
|
||||
+ public static void requestTileData(MinecraftServer server, ServerPlayer player, FriendlyByteBuf buf) {
|
||||
+ if (!LeafConfig.jadeProtocol) {
|
||||
+ if (!org.dreeam.leaf.LeafConfig.jadeProtocol) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -40,15 +40,15 @@ index ba3278bde95344852bed678438a51dd5596892e2..621875cc5ecb613b7a64067d1c080530
|
||||
org.purpurmc.purpur.task.BossBarTask.removeFromAll(entityplayer.getBukkitEntity()); // Purpur
|
||||
ServerLevel worldserver = entityplayer.serverLevel();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2b185b0f8dc9b7f2da0b30f2b393fcf7025f87b2..75cf48291652016c664e035ce467b17d53fffcff 100644
|
||||
index c3d4eafb353448059932bd0065a6e5ab56feac45..2021366dbff69049c5a035e83b1ff3c3a818c58c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1083,6 +1083,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1082,6 +1082,13 @@ public final class CraftServer implements Server {
|
||||
top.leavesmc.leaves.protocol.JadeProtocol.enableAllPlayer();
|
||||
}
|
||||
// Leaves end - Jade
|
||||
+ // Leaves start - appleskin
|
||||
+ if (LeafConfig.appleskinProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.appleskinProtocol) {
|
||||
+ top.leavesmc.leaves.protocol.AppleSkinProtocol.enableAllPlayer();
|
||||
+ } else {
|
||||
+ top.leavesmc.leaves.protocol.AppleSkinProtocol.disableAllPlayer();
|
||||
@@ -58,10 +58,10 @@ index 2b185b0f8dc9b7f2da0b30f2b393fcf7025f87b2..75cf48291652016c664e035ce467b17d
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index bc008690cbd87579f98c7c3686321513947f07e6..bce7b0d5dbd1a6e9fe4f656e057550c8861b8ce4 100644
|
||||
index 9445177d2cb64ae1cd0bd88d0c0b2ad89ef924f6..56dc6cb0b5659619ec5df42088fbecf758e652c6 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -255,7 +255,9 @@ public class LeafConfig {
|
||||
@@ -247,8 +247,10 @@ public class LeafConfig {
|
||||
}
|
||||
|
||||
public static boolean jadeProtocol = false;
|
||||
@@ -70,13 +70,14 @@ index bc008690cbd87579f98c7c3686321513947f07e6..bce7b0d5dbd1a6e9fe4f656e057550c8
|
||||
jadeProtocol = getBoolean("network.protocol.jade-protocol", jadeProtocol);
|
||||
+ appleskinProtocol = getBoolean("network.protocol.appleskin-protocol", appleskinProtocol);
|
||||
}
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..61e4447c7b26ad8501cc3d3735b6cd78d5dd1b6e
|
||||
index 0000000000000000000000000000000000000000..e471fb844c34294886b6668b04ec50986c47f9ca
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/AppleSkinProtocol.java
|
||||
@@ -0,0 +1,95 @@
|
||||
@@ -0,0 +1,94 @@
|
||||
+package top.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import io.netty.buffer.Unpooled;
|
||||
@@ -85,7 +86,6 @@ index 0000000000000000000000000000000000000000..61e4447c7b26ad8501cc3d3735b6cd78
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import net.minecraft.world.food.FoodData;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
+import org.jetbrains.annotations.Contract;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import top.leavesmc.leaves.util.ProtocolUtils;
|
||||
@@ -128,14 +128,14 @@ index 0000000000000000000000000000000000000000..61e4447c7b26ad8501cc3d3735b6cd78
|
||||
+ }
|
||||
+
|
||||
+ public static void onPlayerLoggedIn(@NotNull ServerPlayer player) {
|
||||
+ if (LeafConfig.appleskinProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.appleskinProtocol) {
|
||||
+ players.add(player);
|
||||
+ resetPlayerData(player);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void onPlayerLoggedOut(@NotNull ServerPlayer player) {
|
||||
+ if (LeafConfig.appleskinProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.appleskinProtocol) {
|
||||
+ players.remove(player);
|
||||
+ resetPlayerData(player);
|
||||
+ }
|
||||
@@ -147,7 +147,7 @@ index 0000000000000000000000000000000000000000..61e4447c7b26ad8501cc3d3735b6cd78
|
||||
+ }
|
||||
+
|
||||
+ public static void tick() {
|
||||
+ if (LeafConfig.appleskinProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.appleskinProtocol) {
|
||||
+ for (ServerPlayer player : players) {
|
||||
+ FoodData data = player.getFoodData();
|
||||
+
|
||||
|
||||
@@ -19,7 +19,7 @@ index 621875cc5ecb613b7a64067d1c0805305977b9a3..a29f58dce847b4cdcf276906011f8450
|
||||
// CraftBukkit start - handle player weather
|
||||
// entityplayer.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.START_RAINING, 0.0F));
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index bce7b0d5dbd1a6e9fe4f656e057550c8861b8ce4..a0123918192584921accf23a19579bda7bb9f8bd 100644
|
||||
index 56dc6cb0b5659619ec5df42088fbecf758e652c6..4cf74bc39f61e024b7d453759cdc9397f0e3d4f5 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -19,6 +19,7 @@ import java.util.Collections;
|
||||
@@ -30,7 +30,7 @@ index bce7b0d5dbd1a6e9fe4f656e057550c8861b8ce4..a0123918192584921accf23a19579bda
|
||||
|
||||
public class LeafConfig {
|
||||
|
||||
@@ -256,8 +257,12 @@ public class LeafConfig {
|
||||
@@ -248,9 +249,13 @@ public class LeafConfig {
|
||||
|
||||
public static boolean jadeProtocol = false;
|
||||
public static boolean appleskinProtocol = false;
|
||||
@@ -42,20 +42,20 @@ index bce7b0d5dbd1a6e9fe4f656e057550c8861b8ce4..a0123918192584921accf23a19579bda
|
||||
+ xaeroMapProtocol = getBoolean("network.protocol.xaero-map-protocol", xaeroMapProtocol);
|
||||
+ xaeroMapServerID = getInt("network.protocol.xaero-map-server-id", xaeroMapServerID);
|
||||
}
|
||||
}
|
||||
|
||||
public static String sentryDsn = "";
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/XaeroMapProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/XaeroMapProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..afedb39a2b586eb2ac786391bbf0814bef2e2ad5
|
||||
index 0000000000000000000000000000000000000000..461f9f947f14c4eb86f80b644628cebbe6fb3619
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/XaeroMapProtocol.java
|
||||
@@ -0,0 +1,39 @@
|
||||
@@ -0,0 +1,38 @@
|
||||
+package top.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import io.netty.buffer.Unpooled;
|
||||
+import net.minecraft.network.FriendlyByteBuf;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import org.dreeam.leaf.LeafConfig;
|
||||
+import org.jetbrains.annotations.Contract;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import top.leavesmc.leaves.util.ProtocolUtils;
|
||||
@@ -79,10 +79,10 @@ index 0000000000000000000000000000000000000000..afedb39a2b586eb2ac786391bbf0814b
|
||||
+ }
|
||||
+
|
||||
+ public static void onSendWorldInfo(@NotNull ServerPlayer player) {
|
||||
+ if (LeafConfig.xaeroMapProtocol) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.xaeroMapProtocol) {
|
||||
+ FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
|
||||
+ buf.writeByte(0);
|
||||
+ buf.writeInt(LeafConfig.xaeroMapServerID);
|
||||
+ buf.writeInt(org.dreeam.leaf.LeafConfig.xaeroMapServerID);
|
||||
+ ProtocolUtils.sendPayloadPacket(player, MINIMAP_KEY, buf);
|
||||
+ ProtocolUtils.sendPayloadPacket(player, WORLDMAP_KEY, buf);
|
||||
+ }
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Revert Purpur Fire Immunity API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 6d2b435e3ba70c98b0d85938c02b38870cfffe4f..9db8f90bed4758331edacf43a6d432a4162c03be 100644
|
||||
index 85011523949f3b20f0a3d5192082859dda17d25e..1f05b647d796d03fec8198456d3e0ee7db1d3985 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -419,7 +419,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -418,7 +418,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean collidingWithWorldBorder; // Paper
|
||||
@@ -16,7 +16,7 @@ index 6d2b435e3ba70c98b0d85938c02b38870cfffe4f..9db8f90bed4758331edacf43a6d432a4
|
||||
private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
@@ -1854,7 +1853,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1853,7 +1852,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -25,7 +25,7 @@ index 6d2b435e3ba70c98b0d85938c02b38870cfffe4f..9db8f90bed4758331edacf43a6d432a4
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -2532,11 +2531,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2531,11 +2530,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
nbt.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -37,7 +37,7 @@ index 6d2b435e3ba70c98b0d85938c02b38870cfffe4f..9db8f90bed4758331edacf43a6d432a4
|
||||
nbt.put("Leaves.Data", leavesData); // Leaves - leaves ex data
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -2706,11 +2700,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2705,11 +2699,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -1337,19 +1337,19 @@ index 0e2b14e7dfedf209d63279c81723fd7955122d78..079b278e2e262af433bb5bd0c12b3d8d
|
||||
|
||||
public SwimNodeEvaluator(boolean canJumpOutOfWater) {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index a0123918192584921accf23a19579bda7bb9f8bd..337013a11189328b9ef8e12dcc641ff828ca33d1 100644
|
||||
index 4cf74bc39f61e024b7d453759cdc9397f0e3d4f5..2bfc30aef604645a29660f599df2b60e0252bec7 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -197,6 +197,8 @@ public class LeafConfig {
|
||||
public static boolean throttleInactiveGoalSelectorTick;
|
||||
@@ -196,6 +196,8 @@ public class LeafConfig {
|
||||
public static boolean throttleInactiveGoalSelectorTick = true;
|
||||
public static Map<String, Integer> projectileTimeouts;
|
||||
public static boolean useSpigotItemMergingMechanism = true;
|
||||
+ public static boolean enableAsyncPathfinding = true;
|
||||
+ public static boolean enableAsyncPathfindingInitialized;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -253,6 +255,13 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -245,6 +247,13 @@ public class LeafConfig {
|
||||
entityType.ttl = config.getInt("entity_timeouts." + type, -1);
|
||||
}
|
||||
useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
||||
|
||||
@@ -430,19 +430,19 @@ index b77a84a5ab85839e37aee24da0f4356be3f478e2..75b53f1f237472f55d883a22cc8289c4
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 337013a11189328b9ef8e12dcc641ff828ca33d1..d9325a0189aae01727fa07ebfd74abbe182d5169 100644
|
||||
index 2bfc30aef604645a29660f599df2b60e0252bec7..add6a325ba387b20da8f19a877f93ddb2bcabfa3 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -199,6 +199,8 @@ public class LeafConfig {
|
||||
@@ -198,6 +198,8 @@ public class LeafConfig {
|
||||
public static boolean useSpigotItemMergingMechanism = true;
|
||||
public static boolean enableAsyncPathfinding = true;
|
||||
public static boolean enableAsyncPathfindingInitialized;
|
||||
+ public static boolean enableAsyncEntityTracker = false;
|
||||
+ public static boolean enableAsyncEntityTrackerInitialized;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -262,6 +264,13 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -254,6 +256,13 @@ public class LeafConfig {
|
||||
enableAsyncPathfindingInitialized = true;
|
||||
enableAsyncPathfinding = asyncPathfinding;
|
||||
}
|
||||
|
||||
@@ -20,23 +20,23 @@ index 2632dade6bfaa185a94e95210a31dc3824b7746f..9687d4a87112a6ed991935321ef15f32
|
||||
return;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index d9325a0189aae01727fa07ebfd74abbe182d5169..11d3ccad179680c46b45e17b4461c5da3d9d5592 100644
|
||||
index add6a325ba387b20da8f19a877f93ddb2bcabfa3..47ab96d013a92b4793f4b7608522314033a196fc 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -201,6 +201,8 @@ public class LeafConfig {
|
||||
@@ -200,6 +200,8 @@ public class LeafConfig {
|
||||
public static boolean enableAsyncPathfindingInitialized;
|
||||
public static boolean enableAsyncEntityTracker = false;
|
||||
public static boolean enableAsyncEntityTrackerInitialized;
|
||||
+ public static boolean enableSyncEventCallsOnAsyncThreads;
|
||||
+ public static boolean enableSyncEventCallsOnAsyncThreads = true;
|
||||
+ public static boolean enableSyncEventCallsOnAsyncThreadsInitialized;
|
||||
private static void performance() {
|
||||
String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
@@ -271,6 +273,13 @@ public class LeafConfig {
|
||||
boolean asyncMobSpawning = getBoolean("performance.enable-async-mob-spawning", enableAsyncMobSpawning,
|
||||
"Whether or not asynchronous mob spawning should be enabled.",
|
||||
@@ -263,6 +265,13 @@ public class LeafConfig {
|
||||
enableAsyncEntityTrackerInitialized = true;
|
||||
enableAsyncEntityTracker = asyncEntityTracker;
|
||||
}
|
||||
+ boolean syncEventCalls = getBoolean("performance.enable-sync-event-calls-on-async-threads", true,
|
||||
+ boolean syncEventCalls = getBoolean("performance.enable-sync-event-calls-on-async-threads", enableSyncEventCallsOnAsyncThreads,
|
||||
+ "Whether or not sync event calls on async threads should be enabled. (If async entity tracker is enabled, this is enabled.)",
|
||||
+ "You may encounter issues with plugins.");
|
||||
+ if (!enableSyncEventCallsOnAsyncThreadsInitialized) {
|
||||
|
||||
Reference in New Issue
Block a user