mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-22 16:29:23 +00:00
Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@998a4e6 [ci skip] add a good chunk of patch identifying comments PurpurMC/Purpur@e440784 [ci skip] a couple more patch identifying comments PurpurMC/Purpur@c33391b Updated Upstream (Paper) PurpurMC/Purpur@8d7fab1 [ci skip] small patch comment cleanup
This commit is contained in:
@@ -2,7 +2,7 @@ group = space.bxteam.divinemc
|
||||
|
||||
mcVersion = 1.21.4
|
||||
version = 1.21.4-R0.1-SNAPSHOT
|
||||
purpurRef = 73dae7f68373023dadd4bd44759180859f8ac115
|
||||
purpurRef = 8d7fab13aa3e9cd82f45ba1d48af0ff8a4d0094c
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -2104,7 +2104,7 @@ index 632c4961515f5052551f841cfa840e60bba7a257..00000000000000000000000000000000
|
||||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
||||
index 0a26fffe9b1e5080b5639767a03af11006108b4a..3b73c0e59788f5f49ca2423032550f11855d52ae 100644
|
||||
index 74384a56eebbce41d431db2507c55eddbcf50a41..7d1ac11cfffbaf7d799f2a0032221fb23ee6daf5 100644
|
||||
--- a/src/main/java/org/bukkit/command/Command.java
|
||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||
@@ -33,16 +33,6 @@ public abstract class Command {
|
||||
@@ -2186,7 +2186,7 @@ index 7740ad53796d08584bb0110f99af5639993e4d71..f0da5a8ae7e989e120f9d5ef2a417a98
|
||||
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
|
||||
//target.timings.stopTiming(); // Spigot // Paper
|
||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
index 6b6edf9007997d9672e4c850464c1b71cb55f6b4..4d91fa6fd1717aa8a6cd2a9edab888f03d6c1b34 100644
|
||||
index 2e6d62c4f3687e299c34e876c503b400e13be05a..0f5b442ea8e18d21c310205c217d22d18be3c863 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||
@@ -724,12 +724,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
@@ -2223,7 +2223,7 @@ index 6b6edf9007997d9672e4c850464c1b71cb55f6b4..4d91fa6fd1717aa8a6cd2a9edab888f0
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..5a8548bcc8b969cf5251e91dbe523543b57d6a3a 100644
|
||||
index e2b631fc160f13ea6e27b69f835bbdf83d6d3dec..b1b15caa19137e92ab08df7affcd37d1c249570d 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
||||
@@ -43,7 +43,6 @@ import org.bukkit.plugin.TimedRegisteredListener;
|
||||
@@ -1,114 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Sun, 25 Jun 2023 13:35:28 +0300
|
||||
Subject: [PATCH] Optimize Paper Event Manager
|
||||
|
||||
Original project: lynxplay/ktp
|
||||
Link: https://github.com/lynxplay/ktp
|
||||
Modified by NONPLAYT
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
|
||||
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..d464812eb5e398733b8ea5b09339afa0b555f698 100644
|
||||
--- a/src/main/java/org/bukkit/event/Event.java
|
||||
+++ b/src/main/java/org/bukkit/event/Event.java
|
||||
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents an event.
|
||||
- *
|
||||
+ * <p>
|
||||
* All events require a static method named getHandlerList() which returns the same {@link HandlerList} as {@link #getHandlers()}.
|
||||
*
|
||||
* @see PluginManager#callEvent(Event)
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class Event {
|
||||
private String name;
|
||||
- private final boolean async;
|
||||
+ private final net.kyori.adventure.util.TriState async; // DivineMC - Optimize Paper Event Manager
|
||||
|
||||
/**
|
||||
* The default constructor is defined for cleaner code. This constructor
|
||||
@@ -31,10 +31,20 @@ public abstract class Event {
|
||||
* @param isAsync true indicates the event will fire asynchronously, false
|
||||
* by default from default constructor
|
||||
*/
|
||||
+ // DivineMC start - Optimize Paper Event Manager
|
||||
public Event(boolean isAsync) {
|
||||
+ this(net.kyori.adventure.util.TriState.byBoolean(isAsync));
|
||||
+ }
|
||||
+
|
||||
+ public Event(@NotNull final net.kyori.adventure.util.TriState isAsync) {
|
||||
this.async = isAsync;
|
||||
}
|
||||
|
||||
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
|
||||
+ return this.async;
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
+
|
||||
// Paper start
|
||||
/**
|
||||
* Calls the event and tests if cancelled.
|
||||
@@ -70,7 +80,7 @@ public abstract class Event {
|
||||
public abstract HandlerList getHandlers();
|
||||
|
||||
/**
|
||||
- * Any custom event that should not by synchronized with other events must
|
||||
+ * Any custom event that should not be synchronized with other events must
|
||||
* use the specific constructor. These are the caveats of using an
|
||||
* asynchronous event:
|
||||
* <ul>
|
||||
@@ -92,7 +102,7 @@ public abstract class Event {
|
||||
* @return false by default, true if the event fires asynchronously
|
||||
*/
|
||||
public final boolean isAsynchronous() {
|
||||
- return async;
|
||||
+ return this.async == net.kyori.adventure.util.TriState.TRUE; // DivineMC - Optimize Paper Event Manager
|
||||
}
|
||||
|
||||
public enum Result {
|
||||
@@ -113,6 +123,6 @@ public abstract class Event {
|
||||
* take place if possible, even if the server would not normally allow
|
||||
* the action. Some actions may not be allowed.
|
||||
*/
|
||||
- ALLOW;
|
||||
+ ALLOW
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
index 3b3d9642a8d63798dc28f2f8df77f0466451cbff..9c43c51858b20ace8e32eb2d7f5a2fba6a2090e6 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java
|
||||
@@ -62,11 +62,13 @@ public class RegisteredListener {
|
||||
* @throws EventException If an event handler throws an exception.
|
||||
*/
|
||||
public void callEvent(@NotNull final Event event) throws EventException {
|
||||
- if (event instanceof Cancellable) {
|
||||
- if (((Cancellable) event).isCancelled() && isIgnoringCancelled()) {
|
||||
+ // DivineMC start - Optimize Paper Event Manager
|
||||
+ if (isIgnoringCancelled()) {
|
||||
+ if (event instanceof Cancellable cancellable && cancellable.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
+ // DivineMC end
|
||||
executor.execute(listener, event);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
index 12449e18180d604e9cbbc744da74a8b222a18e1f..2ca1d23b2da34708edb2701afaf9db4df65c24b5 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
@@ -323,4 +323,11 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
}
|
||||
|
||||
// Paper end
|
||||
+
|
||||
+ // DivineMC start - Optimize Paper Event Manager
|
||||
+ @Override
|
||||
+ public void addURL(final URL url) {
|
||||
+ super.addURL(url);
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
}
|
||||
@@ -5,14 +5,14 @@ Subject: [PATCH] Divine Branding
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..445ccd4ca89e6d5a536897e979366a4c2bde7145 100644
|
||||
index 624588207afdc52adae14e5de3d18fe1c330d832..1dc3378c0cdda49ca0cee17cd2959fcb32c4cfcc 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur
|
||||
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur - Rebrand
|
||||
+ implementation(project(":divinemc-api")) // DivineMC
|
||||
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
|
||||
// Paper start
|
||||
@@ -21,16 +21,16 @@ index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..445ccd4ca89e6d5a536897e979366a4c
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
- "Implementation-Title" to "Purpur", // Pufferfish // Purpur
|
||||
- "Implementation-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
|
||||
+ "Implementation-Title" to "DivineMC", // DivineMC
|
||||
"Implementation-Version" to implementationVersion,
|
||||
"Implementation-Vendor" to date, // Paper
|
||||
- "Specification-Title" to "Purpur", // Pufferfish // Purpur
|
||||
- "Specification-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
|
||||
+ "Specification-Title" to "DivineMC", // DivineMC
|
||||
"Specification-Version" to project.version,
|
||||
- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur
|
||||
- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur
|
||||
- "Brand-Name" to "Purpur", // Pufferfish // Purpur
|
||||
- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur - Rebrand
|
||||
- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur - Rebrand
|
||||
- "Brand-Name" to "Purpur", // Pufferfish // Purpur - Rebrand
|
||||
+ "Specification-Vendor" to "BX Team", // DivineMC + BX Team
|
||||
+ "Brand-Id" to "divinemc:divinemc", // DivineMC
|
||||
+ "Brand-Name" to "DivineMC", // DivineMC
|
||||
@@ -51,7 +51,7 @@ index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..445ccd4ca89e6d5a536897e979366a4c
|
||||
+}
|
||||
+// DivineMC end
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 4a8f95670e25c81952cccbaf4c6e49514cacd529..50f93c65f3461ae66963f603f76989f23e585fc0 100644
|
||||
index be1bb14dca9367b9685841985b6198376986c496..50f93c65f3461ae66963f603f76989f23e585fc0 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -3,6 +3,7 @@ package com.destroystokyo.paper;
|
||||
@@ -66,32 +66,36 @@ index 4a8f95670e25c81952cccbaf4c6e49514cacd529..50f93c65f3461ae66963f603f76989f2
|
||||
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
|
||||
// Only start Metrics, if it's enabled in the config
|
||||
if (config.getBoolean("enabled", true)) {
|
||||
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
|
||||
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files
|
||||
+ Metrics metrics = new Metrics("DivineMC", serverUUID, logFailedRequests, Bukkit.getLogger()); // DivineMC
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
|
||||
String minecraftVersion = Bukkit.getVersion();
|
||||
@@ -602,7 +603,7 @@ public class Metrics {
|
||||
@@ -601,8 +602,8 @@ public class Metrics {
|
||||
}));
|
||||
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur - Purpur config files
|
||||
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur - Purpur config files
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
|
||||
+ metrics.addCustomChart(new Metrics.SimplePie("divinemc_version", () -> (CraftServer.class.getPackage().getImplementationVersion() != null) ? CraftServer.class.getPackage().getImplementationVersion() : "unknown")); // DivineMC
|
||||
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..4d2a8974546016b80182ca30e34a1d85055caa87 100644
|
||||
index fe66e43c27e0798770e102d1385bacbaa90bda07..2ce62b1465f6653937082c17721a953b0d812750 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
|
||||
@@ -36,13 +36,13 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
@@ -35,14 +35,14 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static final Logger LOGGER = LogUtils.getClassLogger();
|
||||
private static final int DISTANCE_ERROR = -1;
|
||||
private static final int DISTANCE_UNKNOWN = -2;
|
||||
// Purpur start
|
||||
- // Purpur start - Rebrand
|
||||
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
|
||||
+ private static final String DOWNLOAD_PAGE = "https://github.com/DivineMC/DivineMC/releases/latest"; // DivineMC
|
||||
+ // Purpur start
|
||||
+ private static final String DOWNLOAD_PAGE = "https://github.com/DivineMC/DivineMC/releases/latest"; // DivineMC - Branding
|
||||
private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; }
|
||||
// Purpur end
|
||||
// Purpur end - Rebrand
|
||||
|
||||
@Override
|
||||
public long getCacheTime() {
|
||||
@@ -104,15 +108,17 @@ index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..4d2a8974546016b80182ca30e34a1d85
|
||||
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
|
||||
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
|
||||
} else {
|
||||
- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur
|
||||
+ updateMessage = getUpdateStatusMessage("DivineMC/DivineMC", build); // DivineMC
|
||||
- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur - Rebrand
|
||||
+ updateMessage = getUpdateStatusMessage("DivineMC/DivineMC", build); // DivineMC - Branding
|
||||
}
|
||||
final @Nullable Component history = this.getHistory();
|
||||
|
||||
@@ -62,16 +62,13 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) {
|
||||
//int distance = DISTANCE_ERROR; // Purpur - use field
|
||||
@@ -60,18 +60,13 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
}
|
||||
|
||||
private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) {
|
||||
- //int distance = DISTANCE_ERROR; // Purpur - use field - Rebrand
|
||||
-
|
||||
- final OptionalInt buildNumber = build.buildNumber();
|
||||
- if (buildNumber.isPresent()) {
|
||||
- distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
|
||||
@@ -131,23 +137,23 @@ index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..4d2a8974546016b80182ca30e34a1d85
|
||||
+ // DivineMC end
|
||||
|
||||
return switch (distance) {
|
||||
case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur
|
||||
@@ -86,26 +83,6 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur - Rebrand
|
||||
@@ -86,26 +81,6 @@ public class PaperVersionFetcher implements VersionFetcher {
|
||||
};
|
||||
}
|
||||
|
||||
- private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
|
||||
- try {
|
||||
- try (final BufferedReader reader = Resources.asCharSource(
|
||||
- URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur
|
||||
- URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Rebrand
|
||||
- Charsets.UTF_8
|
||||
- ).openBufferedStream()) {
|
||||
- final JsonObject json = new Gson().fromJson(reader, JsonObject.class);
|
||||
- //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur
|
||||
- final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur
|
||||
- //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur - Rebrand
|
||||
- final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - Rebrand
|
||||
- return latest - jenkinsBuild;
|
||||
- } catch (final JsonSyntaxException ex) {
|
||||
- LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur
|
||||
- LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur - Rebrand
|
||||
- return DISTANCE_ERROR;
|
||||
- }
|
||||
- } catch (final IOException e) {
|
||||
@@ -160,27 +166,27 @@ index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..4d2a8974546016b80182ca30e34a1d85
|
||||
private static int fetchDistanceFromGitHub(final String repo, final String branch, final String hash) {
|
||||
try {
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index 90b3526479320064378f2cde6c2f2b8e48a59ba6..43ff8842f697106d8d1ea4e58097243bf10f4d17 100644
|
||||
index bc7e4e5560708fea89c584b1d8b471f4966f311a..fe195f103456d5826e06b88bf2c97877c06dcf26 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
protected LineReader buildReader(LineReaderBuilder builder) {
|
||||
builder
|
||||
- .appName("Purpur") // Purpur
|
||||
+ .appName("DivineMC") // DivineMC
|
||||
- .appName("Purpur") // Purpur - Rebrand
|
||||
+ .appName("DivineMC") // DivineMC - Branding
|
||||
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
.option(LineReader.Option.COMPLETE_IN_WORD, true);
|
||||
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
index 3099c21ee589acf6edff5903a23673adf489024f..70c407cc8c6fb28ba6fcde1b8d5a66154ed71223 100644
|
||||
index 0843e7c5c335a58d955a0841f2e02a9e4ac824d9..6db69de0761d04dd74860d97006f82d6755abb42 100644
|
||||
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
|
||||
@@ -33,6 +33,7 @@ public record ServerBuildInfoImpl(
|
||||
private static final String BRAND_PAPER_NAME = "Paper";
|
||||
private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur
|
||||
private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur
|
||||
+ private static final String BRAND_DIVINEMC_NAME = "DivineMC"; // DivineMC
|
||||
private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues
|
||||
private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur - Rebrand
|
||||
+ private static final String BRAND_DIVINEMC_NAME = "DivineMC"; // DivineMC - Branding
|
||||
|
||||
private static final String BUILD_DEV = "DEV";
|
||||
|
||||
@@ -188,11 +194,11 @@ index 3099c21ee589acf6edff5903a23673adf489024f..70c407cc8c6fb28ba6fcde1b8d5a6615
|
||||
this(
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
|
||||
.map(Key::key)
|
||||
- .orElse(BRAND_PURPUR_ID), // Purpur
|
||||
+ .orElse(BRAND_DIVINEMC_ID), // DivineMC
|
||||
- .orElse(BRAND_PURPUR_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand
|
||||
+ .orElse(BRAND_DIVINEMC_ID), // DivineMC - Branding
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
|
||||
- .orElse(BRAND_PURPUR_NAME), // Purpur
|
||||
+ .orElse(BRAND_DIVINEMC_NAME), // DivineMC
|
||||
- .orElse(BRAND_PURPUR_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand
|
||||
+ .orElse(BRAND_DIVINEMC_NAME), // DivineMC - Branding
|
||||
SharedConstants.getCurrentVersion().getId(),
|
||||
SharedConstants.getCurrentVersion().getName(),
|
||||
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
|
||||
@@ -241,63 +247,63 @@ index 8f74c2ec5252b6265549589310d742337c91cb2c..1f4c965531393dd81246de487bc86f6d
|
||||
servergui.runFinalizers();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index cf0f3a14584b9280211f88808cb1ddfb10105ec5..dd3083f0f1efb9074e5eb8ebec69f77b59a91613 100644
|
||||
index a68f27288604b6f6755efe3c8ea612e295cb1656..012e058ee31414b7c7666147336118bf44043357 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -289,7 +289,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur
|
||||
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO DIVINEMC - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // DivineMC
|
||||
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur - Rebrand
|
||||
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO DIVINEMC - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // DivineMC - Branding
|
||||
}
|
||||
|
||||
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 5e7b833fc9f37bc370c76e5c43e6c9919d6d20af..0b61d177a2a8c7286aac9d666a6d1c0f2c586849 100644
|
||||
index 2e7c3d4befeb6256ce81ecaa9ed4e8fbcb21651e..5a95655d925c212e5919540fc3b6154521aff2a2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.parsePending();
|
||||
} else {
|
||||
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
|
||||
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to DivineMC"); // Paper // DivineMC
|
||||
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur - Rebrand
|
||||
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to DivineMC"); // Paper // DivineMC - Branding
|
||||
// We don't need to parse pending
|
||||
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..7bbbdf2895776f12ebc153dc83f4d53be8f06c7c 100644
|
||||
index 99eb04643fce44c37fd96c99756837ccafe7b559..c6c7ae53203fa49d36077c42a8895d4285cd042f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
public static String getBukkitVersion() {
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/space.bxteam.divinemc/divinemc-api/pom.properties"); // Pufferfish // Purpur // DivineMC
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur - Rebrand
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/space.bxteam.divinemc/divinemc-api/pom.properties"); // DivineMC - Branding
|
||||
Properties properties = new Properties();
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index f51cc3de3ca935ef90f7f0e9dd0506b856fc55f3..88e172c4f79f9f44b9de79a75acc2365bd0f2af8 100644
|
||||
index 47f168b2d62c9a0eebdd8ab678afd857e7622571..733e6a5b4e00e14a7b907fa0dceaedda93b3c903 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
|
||||
if (isLongTimeout) {
|
||||
// Paper end
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur
|
||||
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a DivineMC bug." ); // Paper // DivineMC
|
||||
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur - Rebrand
|
||||
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a DivineMC bug." ); // Paper // DivineMC - Branding
|
||||
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
|
||||
log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
|
||||
log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
|
||||
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
|
||||
- log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a DivineMC bug, please report this to https://github.com/DivineMC/DivineMC/issues" ); // DivineMC
|
||||
- log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur - Rebrand
|
||||
+ log.log( Level.SEVERE, "If you are unsure or still think this is a DivineMC bug, please report this to https://github.com/DivineMC/DivineMC/issues" ); // DivineMC - Branding
|
||||
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
|
||||
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
|
||||
+ log.log( Level.SEVERE, "DivineMC version: " + Bukkit.getServer().getVersion() ); // DivineMC
|
||||
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur - Rebrand
|
||||
+ log.log( Level.SEVERE, "DivineMC version: " + Bukkit.getServer().getVersion() ); // DivineMC - Branding
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -305,14 +311,14 @@ index f51cc3de3ca935ef90f7f0e9dd0506b856fc55f3..88e172c4f79f9f44b9de79a75acc2365
|
||||
// Paper end
|
||||
} else
|
||||
{
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // DivineMC
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur - Rebrand
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // DivineMC - Branding
|
||||
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
|
||||
}
|
||||
// Paper end - Different message for short timeout
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to DivineMC!):" ); // Paper // Purpur // DivineMC
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur - Rebrand
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to DivineMC!):" ); // Paper // DivineMC - Branding
|
||||
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
@@ -320,8 +326,8 @@ index f51cc3de3ca935ef90f7f0e9dd0506b856fc55f3..88e172c4f79f9f44b9de79a75acc2365
|
||||
WatchdogThread.dumpThread( thread, log );
|
||||
}
|
||||
} else {
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH ---"); // DivineMC
|
||||
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur - Rebrand
|
||||
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO DIVINEMC - THIS IS NOT A BUG OR A CRASH ---"); // DivineMC - Branding
|
||||
}
|
||||
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Divine Configuration
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 7a442fb4cf78bcb1268359ee41a6de138edb76b6..924a1b7f444ab78512bb7773faf513a2a48fb485 100644
|
||||
index 7b312fa229bc03df45c9d2fa340396f62570356a..c9fc57d6b00bf5ca57805c9ad2829646de347475 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -57,6 +57,7 @@ import net.minecraft.world.level.GameType;
|
||||
@@ -16,7 +16,7 @@ index 7a442fb4cf78bcb1268359ee41a6de138edb76b6..924a1b7f444ab78512bb7773faf513a2
|
||||
|
||||
// CraftBukkit start
|
||||
import net.minecraft.server.WorldLoader;
|
||||
@@ -250,6 +251,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -259,6 +260,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish
|
||||
gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish
|
||||
|
||||
@@ -34,78 +34,61 @@ index 7a442fb4cf78bcb1268359ee41a6de138edb76b6..924a1b7f444ab78512bb7773faf513a2
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
this.setMotd(dedicatedserverproperties.motd);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 1a808fc381c0c3ea1fc49bbffebddf2c550e817a..346594614b44cc42a3d6a02bb9684812335a41f3 100644
|
||||
index 72c9b9d8f520aa29106dd28a48dcdaf9bf8ea9e6..d152815ed2b12334458eba1eb88171d563169e84 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -86,6 +86,7 @@ import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.scores.Scoreboard;
|
||||
+import space.bxteam.divinemc.configuration.DivineWorldConfig; // DivineMC
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.HashMap;
|
||||
@@ -176,6 +177,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
+ public final DivineWorldConfig divinemcConfig; // DivineMC
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
|
||||
+ public final space.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -888,6 +890,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -888,6 +889,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
||||
+ this.divinemcConfig = new DivineWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // DivineMC
|
||||
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur - Purpur config files
|
||||
+ this.divinemcConfig = new space.bxteam.divinemc.configuration.DivineWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // DivineMC
|
||||
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 81922bf93f8a96e6cf05944ca98a82cc5945a6c6..825066dbd54ef753cdc03cbbe9deb65438759449 100644
|
||||
index badf280a6b01b06e8148c552330872d64e6256b7..eab64b3f812c9ab12793ad200f58ae8c49e214e1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -268,6 +268,8 @@ import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||
import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
+import space.bxteam.divinemc.configuration.DivineConfig; // DivineMC
|
||||
+
|
||||
public final class CraftServer implements Server {
|
||||
private final String serverName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper
|
||||
private final String serverVersion;
|
||||
@@ -1101,6 +1103,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1101,6 +1101,7 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
+ DivineConfig.init((File) console.options.valueOf("divinemc-settings")); // DivineMC
|
||||
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
|
||||
+ space.bxteam.divinemc.configuration.DivineConfig((File) console.options.valueOf("divinemc-settings")); // DivineMC
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1117,6 +1120,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1117,6 +1118,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
world.purpurConfig.init(); // Purpur
|
||||
world.purpurConfig.init(); // Purpur - Purpur config files
|
||||
+ world.divinemcConfig.init(); // DivineMC
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1135,6 +1139,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1135,6 +1137,7 @@ public final class CraftServer implements Server {
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
this.spark.registerCommandBeforePlugins(this); // Paper - spark
|
||||
org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
|
||||
+ DivineConfig.registerCommands(); // DivineMC
|
||||
org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur - Purpur config files
|
||||
+ space.bxteam.divinemc.configuration.DivineConfig.registerCommands(); // DivineMC
|
||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -3112,6 +3117,13 @@ public final class CraftServer implements Server {
|
||||
@@ -3113,6 +3116,13 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
// Purpur end
|
||||
// Purpur end - Purpur config files
|
||||
|
||||
+ // DivineMC start
|
||||
+ @Override
|
||||
+ public YamlConfiguration getDivineConfig() {
|
||||
+ return DivineConfig.config;
|
||||
+ return space.bxteam.divinemc.configuration.DivineConfig.config;
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
+
|
||||
@@ -113,12 +96,12 @@ index 81922bf93f8a96e6cf05944ca98a82cc5945a6c6..825066dbd54ef753cdc03cbbe9deb654
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index c471a8c81ba067abcb22956ad1a30b5a9b64fc87..87b3dfc6faea57093d4a5f6c61d88d9fc780f04b 100644
|
||||
index 22380501e8cdc09ff785c188d68601a0030fd921..b4a4bc186086e8008e0e3279364d71a1ca6f097c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -190,6 +190,14 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
// Purpur end
|
||||
// Purpur end - Purpur config files
|
||||
|
||||
+ // DivineMC start
|
||||
+ acceptsAll(asList("divinemc", "divinemc-settings"), "File for divinemc settings")
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Optimize default values for configs
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
index 17e23ca4dd2bbfba49ea00aa2b719a95feb931be..25f8ae4a6cc48cfb1901a0807cde95dced515733 100644
|
||||
index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..0e35a057eb408942f49f472bb36f8c77af8aa364 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -336,9 +336,9 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
@@ -190,10 +190,10 @@ index 82210667376fd466d5d4cdcb56b62f6165bd5cde..0fef474e1bd0298c212b98369042917e
|
||||
public boolean disableEndCredits = false;
|
||||
public DoubleOr.Default maxLeashDistance = DoubleOr.Default.USE_DEFAULT;
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 924a1b7f444ab78512bb7773faf513a2a48fb485..467e88ba7ed3eb755c38d8038ae4231d1d4761b6 100644
|
||||
index c9fc57d6b00bf5ca57805c9ad2829646de347475..75919064593167b51c4325ba6d500366ba8408f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -343,7 +343,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -352,7 +352,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end - Add Velocity IP Forwarding Support
|
||||
@@ -203,7 +203,7 @@ index 924a1b7f444ab78512bb7773faf513a2a48fb485..467e88ba7ed3eb755c38d8038ae4231d
|
||||
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
|
||||
// Spigot start
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 95cd1156766895546ef5574b33a60806bff08fa2..4933dc4d6e8e6920feed37f3a68adf74730fee1e 100644
|
||||
index 7690441b5059ae6c7ca8519875ea8a515c5c5e93..6a161bb00b4665cf0b148bc7eabd8b07c6b07e99 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -244,7 +244,7 @@ public class PurpurConfig {
|
||||
|
||||
@@ -5,13 +5,14 @@ Subject: [PATCH] Add missing purpur config options
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index 235596af3a4e210efe966782b29e2b1d4d41e36d..1802be3456bd0b2de35374440b2a548fd815aadc 100644
|
||||
index 67ff60909dee395d42619c310bafc381b9bfce5d..d1aabc4183023136de6bd12f14742b0aeafb8f60 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -162,6 +162,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
@@ -163,6 +163,19 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
|
||||
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale);
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
// Purpur end - Configurable entity base attributes
|
||||
+
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
@@ -28,13 +29,14 @@ index 235596af3a4e210efe966782b29e2b1d4d41e36d..1802be3456bd0b2de35374440b2a548f
|
||||
protected Brain.Provider<Allay> brainProvider() {
|
||||
return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index dbce71f45c008da883b6d244a06343d83ae25e7e..4551fd70a30c7309468a701f92ba92acc8fe7e36 100644
|
||||
index d0023e3734bb3c625fa53077f47039dcb82d9606..1e62c6249df7864cc836b7f791fb11c65d6bdc9b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -98,6 +98,18 @@ public class Camel extends AbstractHorse {
|
||||
@@ -100,6 +100,19 @@ public class Camel extends AbstractHorse {
|
||||
return this.level().purpurConfig.camelBreedingTicks;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
// Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
@@ -51,12 +53,12 @@ index dbce71f45c008da883b6d244a06343d83ae25e7e..4551fd70a30c7309468a701f92ba92ac
|
||||
public void addAdditionalSaveData(CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(nbt);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index 267f49bf00f5bbd5541e25c938f727a5bafd8eb2..b06946ea57285bb9ec0a70854c9359af9d72e979 100644
|
||||
index d09aa48e20c9a6e0d465b93e3759556638041394..2ce47ff58e5db6fc5387667bc8b02fdef73f9f7c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -169,6 +169,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
return this.level().purpurConfig.frogBreedingTicks;
|
||||
@@ -165,6 +165,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
}
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
@@ -75,16 +77,16 @@ index 267f49bf00f5bbd5541e25c938f727a5bafd8eb2..b06946ea57285bb9ec0a70854c9359af
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
+
|
||||
// Purpur start - Make entity breeding times configurable
|
||||
@Override
|
||||
protected Brain.Provider<Frog> brainProvider() {
|
||||
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
|
||||
public int getPurpurBreedTime() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
index 7e92e8c4fec36c8838604f17cf366cc80e82b19b..16802b8e2f624b729241eca5aed7acdd53d2fc32 100644
|
||||
index 33429a9afeefce9238969b2894d0a9c033baca51..b504df1a0004f09eb51ee64461b136934a60c2bc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
|
||||
@@ -95,6 +95,23 @@ public class Tadpole extends AbstractFish {
|
||||
}
|
||||
// Purpur end
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
@@ -107,13 +109,14 @@ index 7e92e8c4fec36c8838604f17cf366cc80e82b19b..16802b8e2f624b729241eca5aed7acdd
|
||||
protected PathNavigation createNavigation(Level world) {
|
||||
return new WaterBoundPathNavigation(this, world);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index 464a16df15d8759d66f94ad080d1ea28b3f6474c..3742917207572f0698c779a262b887c04e11c8d8 100644
|
||||
index 489854333e71ad4e7635870eedbdd07a84297a13..161ca711bcc4c6e9d5ac25b61154cf6b8a437d52 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -118,6 +118,18 @@ public class Sniffer extends Animal {
|
||||
@@ -120,6 +120,19 @@ public class Sniffer extends Animal {
|
||||
return this.level().purpurConfig.snifferBreedingTicks;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
// Purpur end - Make entity breeding times configurable
|
||||
+
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
+ public boolean isSensitiveToWater() {
|
||||
@@ -130,12 +133,12 @@ index 464a16df15d8759d66f94ad080d1ea28b3f6474c..3742917207572f0698c779a262b887c0
|
||||
protected void defineSynchedData(SynchedEntityData.Builder builder) {
|
||||
super.defineSynchedData(builder);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index cf231928bae5493b0684109c769d7da4dc36f872..bc8d7ab331239077079be74527714e170b1d1578 100644
|
||||
index 74011f1ab7e48490109ad93d658bba216eef9e80..6d8c7639c6a264f40b2c402684c54cb694c05c63 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -153,6 +153,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
}
|
||||
// Purpur end
|
||||
// Purpur end - Ridables
|
||||
|
||||
+ // DivineMC start - Add missing purpur config options
|
||||
+ @Override
|
||||
|
||||
@@ -5,18 +5,18 @@ Subject: [PATCH] Fix MC-93826
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java
|
||||
index 9987d28ea145f6d0126cb4ea22001e0922fb51bd..792c509a1d2ad342df2e047e71196c892bbc20e7 100644
|
||||
index 8df1682dca61b0f771a1c08f5bcd797506badf19..389950c97eb94fbbc730fbff51fedcc3217be22a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java
|
||||
@@ -49,6 +49,8 @@ public abstract class Animal extends AgeableMob {
|
||||
@Nullable
|
||||
public UUID loveCause;
|
||||
@@ -51,6 +51,8 @@ public abstract class Animal extends AgeableMob {
|
||||
public ItemStack breedItem; // CraftBukkit - Add breedItem variable
|
||||
public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable
|
||||
|
||||
+ private Object level;
|
||||
+
|
||||
public abstract int getPurpurBreedTime(); // Purpur
|
||||
|
||||
protected Animal(EntityType<? extends Animal> type, Level world) {
|
||||
super(type, world);
|
||||
this.setPathfindingMalus(PathType.DANGER_FIRE, 16.0F);
|
||||
@@ -84,7 +86,11 @@ public abstract class Animal extends AgeableMob {
|
||||
double d1 = this.random.nextGaussian() * 0.02D;
|
||||
double d2 = this.random.nextGaussian() * 0.02D;
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix MC-93018
|
||||
Original post on Mojira: https://bugs.mojang.com/browse/MC-93018
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
index 499e3294f8dd19fb3802f521cb7d24d0998c8aeb..fa36368bd14b377e81c45115a242e8b497de0cb2 100644
|
||||
index 30b4c09c6046c1d0843ccb8e4ff326e189b6cb95..bf3cd5381250cd77da6969214077ceae537a1d95 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
@@ -759,14 +759,17 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
||||
@@ -762,14 +762,17 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
||||
public boolean canMate(Animal other) {
|
||||
if (other == this) {
|
||||
return false;
|
||||
|
||||
@@ -7,19 +7,19 @@ Original code by Titaniumtown, modified by NONPLAYT
|
||||
You can find the original code on https://gitlab.com/Titaniumtown/JettPack
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 346594614b44cc42a3d6a02bb9684812335a41f3..2078124d0bcb0d17a15087e4c42aecd73b28061c 100644
|
||||
index d152815ed2b12334458eba1eb88171d563169e84..4ce5cf4f5e2974e3d87514aee920d296a973938e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -179,8 +179,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
public final DivineWorldConfig divinemcConfig; // DivineMC
|
||||
@@ -178,8 +178,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
|
||||
public final space.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
- private org.spigotmc.TickLimiter entityLimiter;
|
||||
- private org.spigotmc.TickLimiter tileLimiter;
|
||||
private int tileTickPosition;
|
||||
public final Map<ServerExplosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
||||
@@ -967,8 +965,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -966,8 +964,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||
});
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Make entity goals public
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf821c36c0fe 100644
|
||||
index d2ac2c3a2481ee216a491333b173625da3881737..98ae165bba22390b098f8a96d1e513f72ef71224 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -810,7 +810,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -813,7 +813,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
return state.is(BlockTags.BEE_ATTRACTIVE) ? ((Boolean) state.getValueOrElse(BlockStateProperties.WATERLOGGED, false) ? false : (state.is(Blocks.SUNFLOWER) ? state.getValue(DoublePlantBlock.HALF) == DoubleBlockHalf.UPPER : true)) : false;
|
||||
}
|
||||
|
||||
- private class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur
|
||||
+ public class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur // DivineMC - private -> public
|
||||
- private class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables
|
||||
+ public class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables // DivineMC - private -> public
|
||||
|
||||
BeeLookControl(final Mob entity) {
|
||||
super(entity);
|
||||
@@ -846,7 +846,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -849,7 +849,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
BeeEnterHiveGoal() {
|
||||
super();
|
||||
@@ -951,7 +951,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -954,7 +954,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
private static final int MIN_POLLINATION_TICKS = 400;
|
||||
private static final double ARRIVAL_THRESHOLD = 0.1D;
|
||||
@@ -1130,7 +1130,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1133,7 +1133,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
BeeLocateHiveGoal() {
|
||||
super();
|
||||
@@ -1359,7 +1359,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1362,7 +1362,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
static final int GROW_CHANCE = 30;
|
||||
|
||||
@@ -1428,7 +1428,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1431,7 +1431,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
BeeWanderGoal() {
|
||||
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
||||
@@ -1479,7 +1479,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1482,7 +1482,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
BeeHurtByOtherGoal(final Bee entitybee) {
|
||||
super(entitybee);
|
||||
@@ -1499,7 +1499,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1502,7 +1502,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
|
||||
BeeBecomeAngryTargetGoal(Bee bee) {
|
||||
// Objects.requireNonNull(entitybee); // CraftBukkit - decompile error
|
||||
@@ -1530,7 +1530,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1533,7 +1533,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +90,10 @@ index 884527c8326c6df3656a4d3a2f5f2847f95b0f63..dd263fcbc63b205e6d837c05f968cf82
|
||||
BaseBeeGoal() {}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
index a418ded306908ee9cb9e375104354a6e031305c9..e507ba827be5924763740f57e9200a711b43f749 100644
|
||||
index 5a3348ca39b86cfea941fdfb98ca90a7a0ef908d..e70adf4228d6be6f10d9cfea3762f292a2bc31ce 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -574,7 +574,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
@@ -578,7 +578,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ index a418ded306908ee9cb9e375104354a6e031305c9..e507ba827be5924763740f57e9200a71
|
||||
|
||||
private final Cat cat;
|
||||
@Nullable
|
||||
@@ -712,7 +712,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
@@ -716,7 +716,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,20 +112,20 @@ index a418ded306908ee9cb9e375104354a6e031305c9..e507ba827be5924763740f57e9200a71
|
||||
private final Cat cat;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
index a2c81d2a1077b2977f1595fd592044baf3e81bab..6d36e1c7ae78da31ab7983fc89b7703caf429cf5 100644
|
||||
index 3d1cb875edfe6bf5c9e3f4b7dade7868b7dbfa93..05326f8618626e953c2799089a69803e73b11da7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
@@ -96,7 +96,7 @@ public class Vindicator extends AbstractIllager {
|
||||
@@ -99,7 +99,7 @@ public class Vindicator extends AbstractIllager {
|
||||
this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0, 1.2));
|
||||
this.goalSelector.addGoal(2, new Vindicator.VindicatorBreakDoorGoal(this));
|
||||
this.goalSelector.addGoal(3, new AbstractIllager.RaiderOpenDoorGoal(this));
|
||||
- this.goalSelector.addGoal(4, new Raider.HoldGroundAttackGoal(this, 10.0F));
|
||||
+ this.goalSelector.addGoal(4, new HoldGroundAttackGoal(this, 10.0F));
|
||||
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, false));
|
||||
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Raider.class).setAlertOthers());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
index 68525419f18c18931d771d66fb15c9301d611416..6a8b0eb450b4a0fa22fdc4f7284fb91d8449dec6 100644
|
||||
index 65206bc0c3276fda449936cae88cc819a346e299..2121ef972ce586b627c8adbfbcac0393a76b11cb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
||||
@@ -381,7 +381,7 @@ public abstract class Raider extends PatrollingMonster {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix sprint glitch
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 989b73037159fa0b2b8431c4092f069a949b2971..ec5086c9781a834580d16359c9d6005d2a17d1b0 100644
|
||||
index a850484f2c6f37a39a4cf8cc61683fed4f6f273e..8096e094381062f26172eb1758ee18fda61ca961 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1474,7 +1474,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1,41 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Sun, 25 Jun 2023 13:38:03 +0300
|
||||
Subject: [PATCH] Optimize Paper Event Manager
|
||||
|
||||
Original project: lynxplay/ktp
|
||||
Link: https://github.com/lynxplay/ktp
|
||||
Modified by NONPLAYT
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..0e3bed7a75f8f4611f9f44a1f78fd70cc06eaa54 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -36,14 +36,21 @@ class PaperEventManager {
|
||||
|
||||
// SimplePluginManager
|
||||
public void callEvent(@NotNull Event event) {
|
||||
- if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
- } else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||
- throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
- }
|
||||
-
|
||||
+ // DivineMC start - Optimize Paper Event Manager
|
||||
HandlerList handlers = event.getHandlers();
|
||||
RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
+ if (listeners.length == 0) return;
|
||||
+
|
||||
+ if (event.asynchronous() != net.kyori.adventure.util.TriState.NOT_SET) {
|
||||
+ final boolean onPrimaryThread = this.server.isPrimaryThread();
|
||||
+ final boolean isAsync = event.isAsynchronous();
|
||||
+ if (isAsync && onPrimaryThread) {
|
||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
+ } else if (!isAsync && !onPrimaryThread && !this.server.isStopping()) {
|
||||
+ throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
+ }
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
|
||||
for (RegisteredListener registration : listeners) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Boat Settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
||||
index 56c265940208bc94f531a5af94f564b59f35ebf3..d35451601a86de4d09aa4f819f86f7ea3235b660 100644
|
||||
index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..c1bdc94a7c0084341fe857a0caff0764fc9e8b1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
|
||||
@@ -296,7 +296,18 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
|
||||
@@ -7,7 +7,7 @@ Original project: Bloom-host/Petal
|
||||
Link: https://github.com/Bloom-host/Petal
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index ec5086c9781a834580d16359c9d6005d2a17d1b0..745e1af05b7577c5462d71cc66bf13f205ba9a4d 100644
|
||||
index 8096e094381062f26172eb1758ee18fda61ca961..7d2b571adf0e010ee5af7917cc06ee7702884aaa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1079,20 +1079,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Snowball and Egg knockback
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
index 0db58e7d63a5c1b43a2224c247979f23a1d3f899..632e9c255fa7e30bb99d070e0a456d90f3c25b61 100644
|
||||
index 6fdacf2f6934521a0dd4b25aea35a6a14123da0a..477a6326f19a15c9ea7e0329515ec0007ac2cd20 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.projectile;
|
||||
@@ -6,26 +6,18 @@ Subject: [PATCH] Optimize CraftServer.getWorld(UUID)
|
||||
Original code by MultiPaper - https://github.com/MultiPaper/MultiPaper
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 825066dbd54ef753cdc03cbbe9deb65438759449..d57338319e8267fe83ae6578322dfcc1eba336aa 100644
|
||||
index eab64b3f812c9ab12793ad200f58ae8c49e214e1..88343cbdaa95f7f2bf6a196b58f23195186749a2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -269,6 +269,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
import space.bxteam.divinemc.configuration.DivineConfig; // DivineMC
|
||||
+import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // DivineMC
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
private final String serverName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper
|
||||
@@ -287,6 +288,7 @@ public final class CraftServer implements Server {
|
||||
@@ -285,6 +285,7 @@ public final class CraftServer implements Server {
|
||||
protected final DedicatedPlayerList playerList;
|
||||
private final Map<String, World> worlds = new LinkedHashMap<String, World>();
|
||||
// private final Map<Class<?>, Registry<?>> registries = new HashMap<>(); // Paper - replace with RegistryAccess
|
||||
+ private final Map<UUID, World> worldsByUUID = new Object2ObjectLinkedOpenHashMap<>(); // DivineMC - MultiPaper - optimize getWorld(UUID)
|
||||
+ private final Map<UUID, World> worldsByUUID = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // DivineMC - MultiPaper - optimize getWorld(UUID)
|
||||
private YamlConfiguration configuration;
|
||||
private YamlConfiguration commandsConfiguration;
|
||||
private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
|
||||
@@ -1521,6 +1523,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1519,6 +1520,7 @@ public final class CraftServer implements Server {
|
||||
this.getLogger().log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
@@ -33,7 +25,7 @@ index 825066dbd54ef753cdc03cbbe9deb65438759449..d57338319e8267fe83ae6578322dfcc1
|
||||
this.worlds.remove(world.getName().toLowerCase(Locale.ROOT));
|
||||
this.console.removeLevel(handle);
|
||||
return true;
|
||||
@@ -1539,6 +1542,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1537,6 +1539,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public World getWorld(UUID uid) {
|
||||
@@ -41,7 +33,7 @@ index 825066dbd54ef753cdc03cbbe9deb65438759449..d57338319e8267fe83ae6578322dfcc1
|
||||
for (World world : this.worlds.values()) {
|
||||
if (world.getUID().equals(uid)) {
|
||||
return world;
|
||||
@@ -1562,6 +1566,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1560,6 +1563,7 @@ public final class CraftServer implements Server {
|
||||
System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world.");
|
||||
return;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Block Log4Shell exploit
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 8a468f0c09daf23cfbddb3c607a758c6411babfc..28061983ab0abaf0ddc95b5eaedcf153bdb07c9f 100644
|
||||
index c783c17d45beda8297171d0834350197808a7335..0fef16501c1a971dc8bd2616c7476dffabb6ea08 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2518,6 +2518,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -33,7 +33,7 @@ index 8a468f0c09daf23cfbddb3c607a758c6411babfc..28061983ab0abaf0ddc95b5eaedcf153
|
||||
for (int i = 0; i < message.length(); ++i) {
|
||||
if (!StringUtil.isAllowedChatCharacter(message.charAt(i))) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 029d6daa003f90999afa4e5070eabf6e0ada473a..925b9bd6e2509a88bf0726e58603c9e01cd206f2 100644
|
||||
index c2df3c38f58d8dcb5e3d62077655af56a3bffd65..e77d8db58e1be82f64aa3a3abfc1c85a6e382967 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -767,6 +767,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Option to disable non editable sign warning
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
index 6da1eec98c08e4909ecbd48fe90b3fd62011e284..20fe9ab8c31bb84d58228cb644dd5a936a102dc1 100644
|
||||
index b51b0b0f48b1da6187387d6ec025681e10ed584d..507b94fe816596e381434cf2e160bdee8023d337 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -189,7 +189,7 @@ public class SignBlockEntity extends BlockEntity {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Suppress errors from dirty attributes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index c14ce846afb7364e541bfe01b73a06a94e48f55b..ed59639d7c92dc6e2e8ecf93738c0cabd71972ca 100644
|
||||
index 2bec5ed591e658765602379f9065b8089f5df6ea..944de5ff109b15b76b69326e69b6b1c2afb63dd1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -455,7 +455,10 @@ public class ServerEntity {
|
||||
@@ -34,7 +34,7 @@ index 4729befa12732a9fd65cce243b33b3b479026c41..4f63d2d9e37be27724eddea2c61f681c
|
||||
LivingEntity entityliving1 = deadEntity.getLastHurtByMob();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 090e196cf391dced8adcb8106026d67b2aeac6b0..b7f14229bec6efdd72a3d246097d95ae2f99529e 100644
|
||||
index 00ea1c2037c7c7780764bfcc3e07b6554e910db2..32d64bdb475fdaa5aba0e9082c6ee6655f38fa1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -84,7 +84,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -105,10 +105,10 @@ index 5705cb920084b775cce4b361683b32c6b6e003ed..9c031dd0fa279a23405e5b7d77e4c11e
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 467e88ba7ed3eb755c38d8038ae4231d1d4761b6..13a226c1e110bf51962f891ca52a92e2f309946d 100644
|
||||
index 75919064593167b51c4325ba6d500366ba8408f1..23b3bfaebb8bfbb3bed77535526235c3db9e750f 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -696,7 +696,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -705,7 +705,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
// Paper start - Add setting for proxy online mode status
|
||||
return dedicatedserverproperties.enforceSecureProfile
|
||||
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||
@@ -118,7 +118,7 @@ index 467e88ba7ed3eb755c38d8038ae4231d1d4761b6..13a226c1e110bf51962f891ca52a92e2
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 7d276c191b391bca24948ddb36b8b7d0f1f03b03..c1d3a811ca17f303b6a35a4c044cacf13e57794a 100644
|
||||
index df48c2754dc1ebd52addd8ae768cba5916ce3969..955cfbe0bd97d65fb757d6e9e76ec60440bc5b84 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -332,10 +332,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -147,7 +147,7 @@ index 7d276c191b391bca24948ddb36b8b7d0f1f03b03..c1d3a811ca17f303b6a35a4c044cacf1
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index e1d195ab8b005edd7fcded810ddf903b47c000a1..a46e0d2c4244b7d2c4cc15f76856e5a5be2ead20 100644
|
||||
index 5b1705794a8c3914cb11fdd35f75c8e0c128ecd0..10f6b7e9fdc64760a8bcce34f5f453074a305a94 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1426,7 +1426,7 @@ public abstract class PlayerList {
|
||||
@@ -7,7 +7,7 @@ Original bug on Mojira: https://bugs.mojang.com/browse/MC-223153
|
||||
Took here: https://github.com/Winds-Studio/Leaf/blob/ver/1.21/patches/server/0083-Fix-MC-223153.patch
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
index 1c34691da51d7f7ba3d54e095a3b58b74a5f2263..331ce13f80a27274446100e9828e19c9385319b9 100644
|
||||
index c5f8227cd9631d98cc8404e3f6d6109a55c617aa..041013600b2b76c146d7f73e9429376ac09faf23 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -6600,6 +6600,7 @@ public class Blocks {
|
||||
@@ -7,7 +7,7 @@ Original bug on Mojira: https://bugs.mojang.com/browse/MC-119417
|
||||
Took here: https://github.com/Winds-Studio/Leaf/blob/ver/1.21/patches/server/0082-Fix-MC-119417.patch
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 8264adc43edfebc2c260c2b915186c20ec3637cc..11ddb8e362f5fcedacc27f01fc7f2bee794784df 100644
|
||||
index 6f39fd99ffb28d6c0267f4251c54af0c519289db..0da41d7b11ac98d4cbd059f48be75fb43012118e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2487,6 +2487,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
@@ -7,10 +7,10 @@ Original bug on Mojira: https://bugs.mojang.com/browse/MC-200418
|
||||
Took here: https://github.com/Winds-Studio/Leaf/blob/ver/1.21/patches/server/0081-Fix-MC-200418.patch
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index cd66ef1d99f3ce4533c2423fd12b2fcadf481a66..1faf14bfa3b579ea5be982a00ca98e362756ca7d 100644
|
||||
index bba3562bf316878e7b8ba6a138889d9583a1b0f6..7ce3a667b819c096257732d8505b1aae03b0a148 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -326,6 +326,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -330,6 +330,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
if (!this.isSilent()) {
|
||||
world.levelEvent((Player) null, 1027, this.blockPosition(), 0);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Option to disable moved wrongly threshold
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 28061983ab0abaf0ddc95b5eaedcf153bdb07c9f..d0972746c7def6d6930c447f38d76fd5297a8a7e 100644
|
||||
index 0fef16501c1a971dc8bd2616c7476dffabb6ea08..ac1d8c5eb616d11fc1bda929a8607daf2d616b46 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -592,7 +592,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -64,7 +64,7 @@ index aea9a45c0916501f71018d3250b56da435f5664e..564395b9be9f161dc3ea7956b9b2432d
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index d0653880e8f8852a27e16c5c964fb7b86c40d542..ca5ec4eb6d9c9a0d63bf942611fc3e70fa338fcc 100644
|
||||
index fe8a1a073920b7cbbe3791ac1fcac3fccec6b9f7..b0095c0848ca0162944961a24c7b807fb5846b06 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -644,6 +644,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -76,10 +76,10 @@ index d0653880e8f8852a27e16c5c964fb7b86c40d542..ca5ec4eb6d9c9a0d63bf942611fc3e70
|
||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(new SimpleRegionStorage(new RegionStorageInfo(convertable_conversionsession.getLevelId(), resourcekey, "entities"), convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, DataFixTypes.ENTITY_CHUNK), this, minecraftserver);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
index dad4ef9c672eb4247142de5d045678795951164c..c27684064163af48a5401db2efd72c1e3dbd1fa6 100644
|
||||
index d58f7b251d0c322d63e7e5e8ed30b41427a11227..7fe1ae012dc3fec82bd75c6f44f1d32bf30fd666 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
@@ -430,8 +430,13 @@ public class Slime extends Mob implements Enemy {
|
||||
@@ -433,8 +433,13 @@ public class Slime extends Mob implements Enemy {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -453,10 +453,10 @@ index c2bffe3450ee9f768e00a23ec09df74d7a06d49b..922d1037352198432c16b782c892467c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 0ab9abc08d07d6dba5de2ffdb331598a1fbe6ac9..d7ece9ea131ce0c864bebd65442c1187f1864a40 100644
|
||||
index 88343cbdaa95f7f2bf6a196b58f23195186749a2..62807b021b936477db6e266633767d81a9436bb2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1412,7 +1412,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1409,7 +1409,11 @@ public final class CraftServer implements Server {
|
||||
iregistrycustom_dimension = leveldataanddimensions.dimensions().dimensionsRegistryAccess();
|
||||
} else {
|
||||
LevelSettings worldsettings;
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Delete Timings
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 0e3bed7a75f8f4611f9f44a1f78fd70cc06eaa54..126ed4bd24d993b598c112c2dbfcb9d662038925 100644
|
||||
index 7ce9ebba8ce304d1f3f21d4f15ee5f3560d7700b..a1c9726d25479b5326fe2fa2b0f5a98d6b2da4c5 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -15,7 +15,7 @@ index 0e3bed7a75f8f4611f9f44a1f78fd70cc06eaa54..126ed4bd24d993b598c112c2dbfcb9d6
|
||||
import com.destroystokyo.paper.event.server.ServerExceptionEvent;
|
||||
import com.destroystokyo.paper.exception.ServerEventException;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -102,7 +101,6 @@ class PaperEventManager {
|
||||
@@ -95,7 +94,6 @@ class PaperEventManager {
|
||||
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ index 0e3bed7a75f8f4611f9f44a1f78fd70cc06eaa54..126ed4bd24d993b598c112c2dbfcb9d6
|
||||
this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
|
||||
}
|
||||
|
||||
@@ -189,7 +187,7 @@ class PaperEventManager {
|
||||
@@ -182,7 +180,7 @@ class PaperEventManager {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..35b00c139864dd7925d46a2d6a317d7e
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0819adb34541e5a774f07616957c785b3d6cd8ea..46a72da70c1a77eb19ca1d7771543373bfea0714 100644
|
||||
index f9fcd20d8388fb8a81158f88733007cc45ea7895..3b9e50aa3b47233af7af4857537431900c9b86ee 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -3,9 +3,6 @@ package net.minecraft.server;
|
||||
@@ -561,10 +561,10 @@ index 9104d7010bda6f9f73b478c11490ef9c53f76da2..e609d1b11d8c8924e4838e3cf5e9b6ac
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index 3fa17c5e74bec5fd719df415eebe2d622a0c28e1..2fb060484f4914e81cb60f51fa2b675b903fe5d7 100644
|
||||
index 98ae165bba22390b098f8a96d1e513f72ef71224..3dd6162a9cfccd24f1312bc22dcf0e0766e0e2d5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -1240,7 +1240,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1243,7 +1243,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
} else {
|
||||
Bee.this.pathfindRandomlyTowards(Bee.this.hivePos);
|
||||
}
|
||||
@@ -573,7 +573,7 @@ index 3fa17c5e74bec5fd719df415eebe2d622a0c28e1..2fb060484f4914e81cb60f51fa2b675b
|
||||
boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos);
|
||||
|
||||
if (!flag) {
|
||||
@@ -1299,7 +1299,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -1302,7 +1302,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
} else {
|
||||
Path pathentity = Bee.this.navigation.getPath();
|
||||
|
||||
@@ -583,10 +583,10 @@ index 3fa17c5e74bec5fd719df415eebe2d622a0c28e1..2fb060484f4914e81cb60f51fa2b675b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index b06946ea57285bb9ec0a70854c9359af9d72e979..40a2a10638b08f786eb6598fd1ee6d6b28329d3c 100644
|
||||
index 2ce47ff58e5db6fc5387667bc8b02fdef73f9f7c..127602a7a7360cdb8625dee9b3fc2e444ae84474 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -499,6 +499,17 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
@@ -501,6 +501,17 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
super(frog, world);
|
||||
}
|
||||
|
||||
@@ -604,7 +604,7 @@ index b06946ea57285bb9ec0a70854c9359af9d72e979..40a2a10638b08f786eb6598fd1ee6d6b
|
||||
@Override
|
||||
public boolean canCutCorner(PathType nodeType) {
|
||||
return nodeType != PathType.WATER_BORDER && super.canCutCorner(nodeType);
|
||||
@@ -507,6 +518,11 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
@@ -509,6 +520,11 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
|
||||
@Override
|
||||
protected PathFinder createPathFinder(int range) {
|
||||
this.nodeEvaluator = new Frog.FrogNodeEvaluator(true);
|
||||
@@ -617,10 +617,10 @@ index b06946ea57285bb9ec0a70854c9359af9d72e979..40a2a10638b08f786eb6598fd1ee6d6b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index a28a4cd9544ffa58bd03ac901a761c797044629a..6186d9d30b767b58c61485dad3173ddcd63d6aaf 100644
|
||||
index 76db5a2d27ab435fdfd1e0ec0c77ef5012e128d4..758cdacf50af7dd6378b2c004ebb3d4be41b9897 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -305,7 +305,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -309,7 +309,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
|
||||
protected boolean closeToNextPos() {
|
||||
Path path = this.getNavigation().getPath();
|
||||
@@ -630,10 +630,10 @@ index a28a4cd9544ffa58bd03ac901a761c797044629a..6186d9d30b767b58c61485dad3173ddc
|
||||
if (blockPos != null) {
|
||||
double d = this.distanceToSqr((double)blockPos.getX(), (double)blockPos.getY(), (double)blockPos.getZ());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Strider.java b/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
index 779ae2e63202c1f189b1f5647218a07c21a84ccd..a29c273f6420b5b94fea586d92f3f1944e9d24c7 100644
|
||||
index df44d9fbb71ff252cd261fc8da6de14383e054de..af2631624cff2270aee24f5e58d7613bd352a1c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java
|
||||
@@ -608,9 +608,25 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
@@ -611,9 +611,25 @@ public class Strider extends Animal implements ItemSteerable, Saddleable {
|
||||
super(entity, world);
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ index 779ae2e63202c1f189b1f5647218a07c21a84ccd..a29c273f6420b5b94fea586d92f3f194
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index bc8d7ab331239077079be74527714e170b1d1578..215497e90ea57a2215140232cccf1eba91ebdc55 100644
|
||||
index 6d8c7639c6a264f40b2c402684c54cb694c05c63..c194d66a0118e5196602be8b1fc26839dd514d35 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -635,6 +635,16 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] lithium: hashed_list
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 2078124d0bcb0d17a15087e4c42aecd73b28061c..aefaf2a4d787822a2cb51cac08637fdc74d49bbc 100644
|
||||
index 4ce5cf4f5e2974e3d87514aee920d296a973938e..baa6922fe4547f4fef5719bd54251531340ef44f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -120,9 +120,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -119,9 +119,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public static final int TICKS_PER_DAY = 24000;
|
||||
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
|
||||
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
|
||||
30
patches/server/0055-Skip-event-if-no-listeners.patch
Normal file
30
patches/server/0055-Skip-event-if-no-listeners.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 16 Dec 2024 20:19:27 +0300
|
||||
Subject: [PATCH] Skip event if no listeners
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index a1c9726d25479b5326fe2fa2b0f5a98d6b2da4c5..2219edf3e56a2eade1049f448360247f48e3c52a 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -35,15 +35,16 @@ class PaperEventManager {
|
||||
|
||||
// SimplePluginManager
|
||||
public void callEvent(@NotNull Event event) {
|
||||
+ // DivineMC start - Skip event if no listeners
|
||||
+ RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
|
||||
+ if (listeners.length == 0) return;
|
||||
+ // DivineMC end
|
||||
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
}
|
||||
|
||||
- HandlerList handlers = event.getHandlers();
|
||||
- RegisteredListener[] listeners = handlers.getRegisteredListeners();
|
||||
-
|
||||
for (RegisteredListener registration : listeners) {
|
||||
if (!registration.getPlugin().isEnabled()) {
|
||||
continue;
|
||||
544
patches/server/0056-Multithreaded-Tracker.patch
Normal file
544
patches/server/0056-Multithreaded-Tracker.patch
Normal file
@@ -0,0 +1,544 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 16 Dec 2024 20:43:11 +0300
|
||||
Subject: [PATCH] Multithreaded Tracker
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
index 2219edf3e56a2eade1049f448360247f48e3c52a..6f50be80a88504d0948ce9635eadfee9a208ae82 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
|
||||
@@ -42,6 +42,12 @@ class PaperEventManager {
|
||||
if (event.isAsynchronous() && this.server.isPrimaryThread()) {
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");
|
||||
} else if (!event.isAsynchronous() && !this.server.isPrimaryThread() && !this.server.isStopping()) {
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(event::callEvent);
|
||||
+ return;
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
throw new IllegalStateException(event.getEventName() + " may only be triggered synchronously.");
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 7ef101bdb4e9b37bd2e73247ef916769789de2ea..9d344cc8b50a70efdd325a7b7fd8768f73285f58 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -243,9 +243,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return;
|
||||
}
|
||||
final ServerPlayer[] backingSet = inRange.getRawDataUnchecked();
|
||||
- for (int i = 0, len = inRange.size(); i < len; i++) {
|
||||
- ++(backingSet[i].mobCounts[index]);
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||
+ for (int i = 0, len = inRange.size(); i < len; i++) {
|
||||
+ final ServerPlayer player = backingSet[i];
|
||||
+ if (player == null) continue;
|
||||
+ ++(player.mobCounts[index]);
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (int i = 0, len = inRange.size(); i < len; i++) {
|
||||
+ ++(backingSet[i].mobCounts[index]);
|
||||
+ }
|
||||
}
|
||||
+ // DivineMC end
|
||||
}
|
||||
// Paper start - per player mob count backoff
|
||||
public void updateFailurePlayerMobTypeMap(int chunkX, int chunkZ, net.minecraft.world.entity.MobCategory mobCategory) {
|
||||
@@ -956,6 +966,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity)entity).moonrise$setTrackedEntity(null); // Paper - optimise entity tracker
|
||||
}
|
||||
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ private final java.util.concurrent.ConcurrentLinkedQueue<Runnable> trackerMainThreadTasks = new java.util.concurrent.ConcurrentLinkedQueue<>();
|
||||
+ private boolean tracking = false;
|
||||
+
|
||||
+ public void runOnTrackerMainThread(final Runnable runnable) {
|
||||
+ //final boolean isOnMain = ca.spottedleaf.moonrise.common.util.TickThread.isTickThread();
|
||||
+ //System.out.println(isOnMain);
|
||||
+ if (false && this.tracking) { // TODO: check here
|
||||
+ this.trackerMainThreadTasks.add(runnable);
|
||||
+ } else {
|
||||
+ runnable.run();
|
||||
+ }
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
+
|
||||
// Paper start - optimise entity tracker
|
||||
private void newTrackerTick() {
|
||||
final ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup entityLookup = (ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup)((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getEntityLookup();;
|
||||
@@ -978,6 +1003,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - optimise entity tracker
|
||||
|
||||
protected void tick() {
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled) {
|
||||
+ final ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel level = this.level;
|
||||
+ space.bxteam.divinemc.tracker.MultithreadedTracker.tick(level);
|
||||
+ return;
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
// Paper start - optimise entity tracker
|
||||
if (true) {
|
||||
this.newTrackerTick();
|
||||
@@ -1127,7 +1159,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
final Entity entity;
|
||||
private final int range;
|
||||
SectionPos lastSectionPos;
|
||||
- public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||
+ public final Set<ServerPlayerConnection> seenBy = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
||||
+ ? Sets.newConcurrentHashSet()
|
||||
+ : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl // DivineMC - Multithreaded tracker
|
||||
|
||||
// Paper start - optimise entity tracker
|
||||
private long lastChunkUpdate = -1L;
|
||||
@@ -1154,21 +1188,55 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.lastTrackedChunk = chunk;
|
||||
|
||||
final ServerPlayer[] playersRaw = players.getRawDataUnchecked();
|
||||
+ final int playersLen = players.size(); // Ensure length won't change in the future tasks
|
||||
+
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && space.bxteam.divinemc.configuration.DivineConfig.multithreadedCompatModeEnabled) {
|
||||
+ final boolean isServerPlayer = this.entity instanceof ServerPlayer;
|
||||
+ final boolean isRealPlayer = isServerPlayer && ((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer) this.entity).moonrise$isRealPlayer();
|
||||
+ Runnable updatePlayerTasks = () -> {
|
||||
+ for (int i = 0; i < playersLen; ++i) {
|
||||
+ final ServerPlayer player = playersRaw[i];
|
||||
+ this.updatePlayer(player);
|
||||
+ }
|
||||
|
||||
- for (int i = 0, len = players.size(); i < len; ++i) {
|
||||
- final ServerPlayer player = playersRaw[i];
|
||||
- this.updatePlayer(player);
|
||||
- }
|
||||
+ if (lastChunkUpdate != currChunkUpdate || lastTrackedChunk != chunk) {
|
||||
+ // need to purge any players possible not in the chunk list
|
||||
+ for (final ServerPlayerConnection conn : new java.util.ArrayList<>(this.seenBy)) {
|
||||
+ final ServerPlayer player = conn.getPlayer();
|
||||
+ if (!players.contains(player)) {
|
||||
+ this.removePlayer(player);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ // Only update asynchronously for real player, and sync update for fake players
|
||||
+ // This can fix compatibility issue with NPC plugins using real entity type, like Citizens
|
||||
+ // To prevent visible issue with player type NPCs
|
||||
+ // btw, still recommend to use packet based NPC plugins, like ZNPC Plus, Adyeshach, Fancy NPC, etc.
|
||||
+ if (isRealPlayer || !isServerPlayer) {
|
||||
+ space.bxteam.divinemc.tracker.MultithreadedTracker.getTrackerExecutor().execute(updatePlayerTasks);
|
||||
+ } else {
|
||||
+ updatePlayerTasks.run();
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (int i = 0, len = players.size(); i < len; ++i) {
|
||||
+ final ServerPlayer player = playersRaw[i];
|
||||
+ this.updatePlayer(player);
|
||||
+ }
|
||||
|
||||
- if (lastChunkUpdate != currChunkUpdate || lastTrackedChunk != chunk) {
|
||||
- // need to purge any players possible not in the chunk list
|
||||
- for (final ServerPlayerConnection conn : new java.util.ArrayList<>(this.seenBy)) {
|
||||
- final ServerPlayer player = conn.getPlayer();
|
||||
- if (!players.contains(player)) {
|
||||
- this.removePlayer(player);
|
||||
+ if (lastChunkUpdate != currChunkUpdate || lastTrackedChunk != chunk) {
|
||||
+ // need to purge any players possible not in the chunk list
|
||||
+ for (final ServerPlayerConnection conn : new java.util.ArrayList<>(this.seenBy)) {
|
||||
+ final ServerPlayer player = conn.getPlayer();
|
||||
+ if (!players.contains(player)) {
|
||||
+ this.removePlayer(player);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1228,14 +1296,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void broadcast(Packet<?> packet) {
|
||||
- Iterator iterator = this.seenBy.iterator();
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- ServerPlayerConnection serverplayerconnection = (ServerPlayerConnection) iterator.next();
|
||||
-
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ for (ServerPlayerConnection serverplayerconnection : this.seenBy.toArray(new ServerPlayerConnection[0])) {
|
||||
serverplayerconnection.send(packet);
|
||||
}
|
||||
-
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
public void broadcastAndSend(Packet<?> packet) {
|
||||
@@ -1247,18 +1312,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void broadcastRemoved() {
|
||||
- Iterator iterator = this.seenBy.iterator();
|
||||
-
|
||||
- while (iterator.hasNext()) {
|
||||
- ServerPlayerConnection serverplayerconnection = (ServerPlayerConnection) iterator.next();
|
||||
-
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ for (ServerPlayerConnection serverplayerconnection : this.seenBy.toArray(new ServerPlayerConnection[0])) {
|
||||
this.serverEntity.removePairing(serverplayerconnection.getPlayer());
|
||||
}
|
||||
-
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
public void removePlayer(ServerPlayer player) {
|
||||
- org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot
|
||||
+ //org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot // DivineMC - Multithreaded tracker - we don't need this
|
||||
if (this.seenBy.remove(player.connection)) {
|
||||
this.serverEntity.removePairing(player);
|
||||
}
|
||||
@@ -1266,8 +1328,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void updatePlayer(ServerPlayer player) {
|
||||
- org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
||||
+ //org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot // DivineMC - Multithreaded tracker - we don't need this
|
||||
if (player != this.entity) {
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && player == null) return; // DivineMC - Multithreaded tracker
|
||||
// Paper start - remove allocation of Vec3D here
|
||||
// Vec3 vec3d = player.position().subtract(this.entity.position());
|
||||
double vec3d_dx = player.getX() - this.entity.getX();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerBossEvent.java b/src/main/java/net/minecraft/server/level/ServerBossEvent.java
|
||||
index 4f91107f9ae42f96c060c310596db9aa869a8dbc..39dada67dd2ed13f7f191e42c366f4a96767f275 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerBossEvent.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerBossEvent.java
|
||||
@@ -13,7 +13,9 @@ import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.BossEvent;
|
||||
|
||||
public class ServerBossEvent extends BossEvent {
|
||||
- private final Set<ServerPlayer> players = Sets.newHashSet();
|
||||
+ private final Set<ServerPlayer> players = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled
|
||||
+ ? Sets.newConcurrentHashSet()
|
||||
+ : Sets.newHashSet(); // DivineMC - Multithreaded tracker - players can be removed in async tracking
|
||||
private final Set<ServerPlayer> unmodifiablePlayers = Collections.unmodifiableSet(this.players);
|
||||
public boolean visible = true;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 944de5ff109b15b76b69326e69b6b1c2afb63dd1..415fe9e2bf9a110021edbdc39e4498ccc8366636 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -119,7 +119,13 @@ public class ServerEntity {
|
||||
this.broadcastAndSend(new ClientboundSetPassengersPacket(this.entity)); // CraftBukkit
|
||||
ServerEntity.removedPassengers(list, this.lastPassengers).forEach((entity) -> {
|
||||
if (entity instanceof ServerPlayer entityplayer) {
|
||||
- entityplayer.connection.teleport(entityplayer.getX(), entityplayer.getY(), entityplayer.getZ(), entityplayer.getYRot(), entityplayer.getXRot());
|
||||
+ // DivineMC start - Multithreaded tracker - Ensure teleport is executed on server thread
|
||||
+ if (space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled && Thread.currentThread() instanceof space.bxteam.divinemc.tracker.MultithreadedTracker.MultithreadedTrackerThread) {
|
||||
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> entityplayer.connection.teleport(entityplayer.getX(), entityplayer.getY(), entityplayer.getZ(), entityplayer.getYRot(), entityplayer.getXRot()));
|
||||
+ } else {
|
||||
+ entityplayer.connection.teleport(entityplayer.getX(), entityplayer.getY(), entityplayer.getZ(), entityplayer.getYRot(), entityplayer.getXRot());
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
});
|
||||
@@ -336,7 +342,11 @@ public class ServerEntity {
|
||||
|
||||
public void removePairing(ServerPlayer player) {
|
||||
this.entity.stopSeenByPlayer(player);
|
||||
- player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));
|
||||
+ // DivineMC start - Multithreaded tracker - send in main thread
|
||||
+ ((ServerLevel) this.entity.level()).chunkSource.chunkMap.runOnTrackerMainThread(() ->
|
||||
+ player.connection.send(new ClientboundRemoveEntitiesPacket(this.entity.getId()))
|
||||
+ );
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
public void addPairing(ServerPlayer player) {
|
||||
@@ -344,7 +354,11 @@ public class ServerEntity {
|
||||
|
||||
Objects.requireNonNull(list);
|
||||
this.sendPairingData(player, list::add);
|
||||
- player.connection.send(new ClientboundBundlePacket(list));
|
||||
+ // DivineMC start - Multithreaded tracker - send in main thread
|
||||
+ ((ServerLevel) this.entity.level()).chunkSource.chunkMap.runOnTrackerMainThread(() ->
|
||||
+ player.connection.send(new ClientboundBundlePacket(list))
|
||||
+ );
|
||||
+ // DivineMC end
|
||||
this.entity.startSeenByPlayer(player);
|
||||
}
|
||||
|
||||
@@ -451,7 +465,10 @@ public class ServerEntity {
|
||||
|
||||
if (list != null) {
|
||||
this.trackedDataValues = datawatcher.getNonDefaultValues();
|
||||
- this.broadcastAndSend(new ClientboundSetEntityDataPacket(this.entity.getId(), list));
|
||||
+ // DivineMC start - Multithreaded tracker - send in main thread
|
||||
+ ((ServerLevel) this.entity.level()).chunkSource.chunkMap.runOnTrackerMainThread(() ->
|
||||
+ this.broadcastAndSend(new ClientboundSetEntityDataPacket(this.entity.getId(), list))
|
||||
+ );
|
||||
}
|
||||
|
||||
if (this.entity instanceof LivingEntity) {
|
||||
@@ -461,12 +478,16 @@ public class ServerEntity {
|
||||
// DivineMC end
|
||||
|
||||
if (!set.isEmpty()) {
|
||||
+ final Set<AttributeInstance> copy = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(set);
|
||||
+ ((ServerLevel) this.entity.level()).chunkSource.chunkMap.runOnTrackerMainThread(() -> {
|
||||
// CraftBukkit start - Send scaled max health
|
||||
if (this.entity instanceof ServerPlayer) {
|
||||
- ((ServerPlayer) this.entity).getBukkitEntity().injectScaledMaxHealth(set, false);
|
||||
+ ((ServerPlayer) this.entity).getBukkitEntity().injectScaledMaxHealth(copy, false);
|
||||
}
|
||||
// CraftBukkit end
|
||||
- this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
|
||||
+ this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), copy));
|
||||
+ });
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
attributes.clear(); // DivineMC
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index b0095c0848ca0162944961a24c7b807fb5846b06..8b812d1ec336fa30cd779d5ebb02b5811c97d369 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2604,7 +2604,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
@Override
|
||||
public LevelEntityGetter<Entity> getEntities() {
|
||||
- org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot
|
||||
+ //org.spigotmc.AsyncCatcher.catchOp("Chunk getEntities call"); // Spigot // DivineMC - Multithreaded tracker
|
||||
return this.moonrise$getEntityLookup(); // Paper - rewrite chunk system
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index ac1d8c5eb616d11fc1bda929a8607daf2d616b46..40e2da69d6907bf664ef37fe8dbe0951b03d3aec 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1888,7 +1888,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
|
||||
public void internalTeleport(PositionMoveRotation positionmoverotation, Set<Relative> set) {
|
||||
- org.spigotmc.AsyncCatcher.catchOp("teleport"); // Paper
|
||||
+ //org.spigotmc.AsyncCatcher.catchOp("teleport"); // Paper // DivineMC - Multithreaded tracker
|
||||
// Paper start - Prevent teleporting dead entities
|
||||
if (player.isRemoved()) {
|
||||
LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
index 27a7852a5d3f8c8960f098646ff5587c50556aa5..ac9534203a256b2a5c1d94e4b3996990e8861aca 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
@@ -24,8 +24,11 @@ public class AttributeInstance {
|
||||
private final Map<AttributeModifier.Operation, Map<ResourceLocation, AttributeModifier>> modifiersByOperation = Maps.newEnumMap(
|
||||
AttributeModifier.Operation.class
|
||||
);
|
||||
- private final Map<ResourceLocation, AttributeModifier> modifierById = new Object2ObjectArrayMap<>();
|
||||
- private final Map<ResourceLocation, AttributeModifier> permanentModifiers = new Object2ObjectArrayMap<>();
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ private final boolean multiThreadedTrackingEnabled = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
||||
+ private final Map<ResourceLocation, AttributeModifier> modifierById = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
||||
+ private final Map<ResourceLocation, AttributeModifier> permanentModifiers = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new Object2ObjectArrayMap<>();
|
||||
+ // DivineMC end
|
||||
private double baseValue;
|
||||
private boolean dirty = true;
|
||||
private double cachedValue;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 98fa43c8a34650795a0ae1ebc28ce17ec1ba5271..3b27e866185f6dcd1c7baaa3fdef591f1a0bdac3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -19,9 +19,12 @@ import org.slf4j.Logger;
|
||||
|
||||
public class AttributeMap {
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- private final Map<Holder<Attribute>, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
|
||||
- private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||
- private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||
+ // DivineMC start - Multithreaded tracker
|
||||
+ private final boolean multiThreadedTrackingEnabled = space.bxteam.divinemc.configuration.DivineConfig.multithreadedEnabled;
|
||||
+ private final Map<Holder<Attribute>, AttributeInstance> attributes = multiThreadedTrackingEnabled ? new java.util.concurrent.ConcurrentHashMap<>() : new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(0);
|
||||
+ private final Set<AttributeInstance> attributesToSync = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
||||
+ private final Set<AttributeInstance> attributesToUpdate = multiThreadedTrackingEnabled ? com.google.common.collect.Sets.newConcurrentHashSet() : new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(0);
|
||||
+ // DivineMC end
|
||||
private final AttributeSupplier supplier;
|
||||
private final java.util.function.Function<Holder<Attribute>, AttributeInstance> createInstance; // Pufferfish
|
||||
private final net.minecraft.world.entity.LivingEntity entity; // Purpur - Ridables
|
||||
diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
||||
index ed44eaad59afa76d8ca8ac74d0cee4fb681dfe83..fe9bff9d542d731aede4903e807acd876b0286d0 100644
|
||||
--- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
||||
+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
||||
@@ -196,4 +196,25 @@ public class DivineConfig {
|
||||
else
|
||||
Bukkit.getLogger().log(Level.INFO, "Using " + asyncPathfindingMaxThreads + " threads for Async Pathfinding");
|
||||
}
|
||||
+
|
||||
+ public static boolean multithreadedEnabled = false;
|
||||
+ public static boolean multithreadedCompatModeEnabled = false;
|
||||
+ public static int asyncEntityTrackerMaxThreads = 0;
|
||||
+ public static int asyncEntityTrackerKeepalive = 60;
|
||||
+ private static void multithreadedTracker() {
|
||||
+ multithreadedEnabled = getBoolean("settings.multithreaded-tracker.enable", multithreadedEnabled);
|
||||
+ multithreadedCompatModeEnabled = getBoolean("settings.multithreaded-tracker.compat-mode", multithreadedCompatModeEnabled);
|
||||
+ asyncEntityTrackerMaxThreads = getInt("settings.multithreaded-tracker.max-threads", asyncEntityTrackerMaxThreads);
|
||||
+ asyncEntityTrackerKeepalive = getInt("settings.multithreaded-tracker.keepalive", asyncEntityTrackerKeepalive);
|
||||
+
|
||||
+ if (asyncEntityTrackerMaxThreads < 0)
|
||||
+ asyncEntityTrackerMaxThreads = Math.max(Runtime.getRuntime().availableProcessors() + asyncEntityTrackerMaxThreads, 1);
|
||||
+ else if (asyncEntityTrackerMaxThreads == 0)
|
||||
+ asyncEntityTrackerMaxThreads = Math.max(Runtime.getRuntime().availableProcessors() / 4, 1);
|
||||
+
|
||||
+ if (!multithreadedEnabled)
|
||||
+ asyncEntityTrackerMaxThreads = 0;
|
||||
+ else
|
||||
+ Bukkit.getLogger().log(Level.INFO, "Using " + asyncEntityTrackerMaxThreads + " threads for Async Entity Tracker");
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/space/bxteam/divinemc/tracker/MultithreadedTracker.java b/src/main/java/space/bxteam/divinemc/tracker/MultithreadedTracker.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3621d8641eb657d84b886589bc957bdf8798785a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/space/bxteam/divinemc/tracker/MultithreadedTracker.java
|
||||
@@ -0,0 +1,139 @@
|
||||
+package space.bxteam.divinemc.tracker;
|
||||
+
|
||||
+import ca.spottedleaf.moonrise.common.list.ReferenceList;
|
||||
+import ca.spottedleaf.moonrise.common.misc.NearbyPlayers;
|
||||
+import ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel;
|
||||
+import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup;
|
||||
+import ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity;
|
||||
+import ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerTrackedEntity;
|
||||
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
+import net.minecraft.server.level.ChunkMap;
|
||||
+import net.minecraft.server.level.FullChunkStatus;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
+import net.minecraft.world.entity.Entity;
|
||||
+import org.apache.logging.log4j.LogManager;
|
||||
+import org.apache.logging.log4j.Logger;
|
||||
+
|
||||
+import java.util.concurrent.Executor;
|
||||
+import java.util.concurrent.LinkedBlockingQueue;
|
||||
+import java.util.concurrent.ThreadPoolExecutor;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+
|
||||
+public class MultithreadedTracker {
|
||||
+ private static final Logger LOGGER = LogManager.getLogger("MultithreadedTracker");
|
||||
+ public static class MultithreadedTrackerThread extends Thread {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ super.run();
|
||||
+ }
|
||||
+ }
|
||||
+ private static final Executor trackerExecutor = new ThreadPoolExecutor(
|
||||
+ 1,
|
||||
+ space.bxteam.divinemc.configuration.DivineConfig.asyncEntityTrackerMaxThreads,
|
||||
+ space.bxteam.divinemc.configuration.DivineConfig.asyncEntityTrackerKeepalive, TimeUnit.SECONDS,
|
||||
+ new LinkedBlockingQueue<>(),
|
||||
+ new ThreadFactoryBuilder()
|
||||
+ .setThreadFactory(
|
||||
+ r -> new MultithreadedTrackerThread() {
|
||||
+ @Override
|
||||
+ public void run() {
|
||||
+ r.run();
|
||||
+ }
|
||||
+ }
|
||||
+ )
|
||||
+ .setNameFormat("DivineMC Async Tracker Thread - %d")
|
||||
+ .setPriority(Thread.NORM_PRIORITY - 2)
|
||||
+ .build());
|
||||
+
|
||||
+ private MultithreadedTracker() {
|
||||
+ }
|
||||
+
|
||||
+ public static Executor getTrackerExecutor() {
|
||||
+ return trackerExecutor;
|
||||
+ }
|
||||
+
|
||||
+ public static void tick(ChunkSystemServerLevel level) {
|
||||
+ try {
|
||||
+ if (!space.bxteam.divinemc.configuration.DivineConfig.multithreadedCompatModeEnabled) {
|
||||
+ tickAsync(level);
|
||||
+ } else {
|
||||
+ tickAsyncWithCompatMode(level);
|
||||
+ }
|
||||
+ } catch (Exception e) {
|
||||
+ LOGGER.error("Error occurred while executing async task.", e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void tickAsync(ChunkSystemServerLevel level) {
|
||||
+ final NearbyPlayers nearbyPlayers = level.moonrise$getNearbyPlayers();
|
||||
+ final ServerEntityLookup entityLookup = (ServerEntityLookup) level.moonrise$getEntityLookup();
|
||||
+
|
||||
+ final ReferenceList<Entity> trackerEntities = entityLookup.trackerEntities;
|
||||
+ final Entity[] trackerEntitiesRaw = trackerEntities.getRawDataUnchecked();
|
||||
+
|
||||
+ // Move tracking to off-main
|
||||
+ trackerExecutor.execute(() -> {
|
||||
+ for (final Entity entity : trackerEntitiesRaw) {
|
||||
+ if (entity == null) continue;
|
||||
+
|
||||
+ final ChunkMap.TrackedEntity tracker = ((EntityTrackerEntity) entity).moonrise$getTrackedEntity();
|
||||
+
|
||||
+ if (tracker == null) continue;
|
||||
+
|
||||
+ ((EntityTrackerTrackedEntity) tracker).moonrise$tick(nearbyPlayers.getChunk(entity.chunkPosition()));
|
||||
+ tracker.serverEntity.sendChanges();
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ private static void tickAsyncWithCompatMode(ChunkSystemServerLevel level) {
|
||||
+ final NearbyPlayers nearbyPlayers = level.moonrise$getNearbyPlayers();
|
||||
+ final ServerEntityLookup entityLookup = (ServerEntityLookup) level.moonrise$getEntityLookup();
|
||||
+
|
||||
+ final ReferenceList<Entity> trackerEntities = entityLookup.trackerEntities;
|
||||
+ final Entity[] trackerEntitiesRaw = trackerEntities.getRawDataUnchecked();
|
||||
+ final Runnable[] sendChangesTasks = new Runnable[trackerEntitiesRaw.length];
|
||||
+ int index = 0;
|
||||
+
|
||||
+ for (final Entity entity : trackerEntitiesRaw) {
|
||||
+ if (entity == null) continue;
|
||||
+
|
||||
+ final ChunkMap.TrackedEntity tracker = ((EntityTrackerEntity) entity).moonrise$getTrackedEntity();
|
||||
+
|
||||
+ if (tracker == null) continue;
|
||||
+
|
||||
+ ((EntityTrackerTrackedEntity) tracker).moonrise$tick(nearbyPlayers.getChunk(entity.chunkPosition()));
|
||||
+ sendChangesTasks[index++] = () -> tracker.serverEntity.sendChanges(); // Collect send changes to task array
|
||||
+ }
|
||||
+
|
||||
+ // batch submit tasks
|
||||
+ trackerExecutor.execute(() -> {
|
||||
+ for (final Runnable sendChanges : sendChangesTasks) {
|
||||
+ if (sendChanges == null) continue;
|
||||
+
|
||||
+ sendChanges.run();
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ // Original ChunkMap#newTrackerTick of Paper
|
||||
+ // Just for diff usage for future update
|
||||
+ private static void tickOriginal(ServerLevel level) {
|
||||
+ final ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup entityLookup = (ca.spottedleaf.moonrise.patches.chunk_system.level.entity.server.ServerEntityLookup) ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel) level).moonrise$getEntityLookup();
|
||||
+
|
||||
+ final ca.spottedleaf.moonrise.common.list.ReferenceList<net.minecraft.world.entity.Entity> trackerEntities = entityLookup.trackerEntities;
|
||||
+ final Entity[] trackerEntitiesRaw = trackerEntities.getRawDataUnchecked();
|
||||
+ for (int i = 0, len = trackerEntities.size(); i < len; ++i) {
|
||||
+ final Entity entity = trackerEntitiesRaw[i];
|
||||
+ final ChunkMap.TrackedEntity tracker = ((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity) entity).moonrise$getTrackedEntity();
|
||||
+ if (tracker == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ ((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerTrackedEntity) tracker).moonrise$tick(((ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity) entity).moonrise$getChunkData().nearbyPlayers);
|
||||
+ if (((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerTrackedEntity) tracker).moonrise$hasPlayers()
|
||||
+ || ((ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity) entity).moonrise$getChunkStatus().isOrAfter(FullChunkStatus.ENTITY_TICKING)) {
|
||||
+ tracker.serverEntity.sendChanges();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
86
patches/server/0057-lithium-fast_util.patch
Normal file
86
patches/server/0057-lithium-fast_util.patch
Normal file
@@ -0,0 +1,86 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
||||
Date: Mon, 16 Dec 2024 20:52:48 +0300
|
||||
Subject: [PATCH] lithium: fast_util
|
||||
|
||||
Original code by CaffeineMC, licensed under GNU Lesser General Public License v3.0
|
||||
You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
|
||||
index 928f38fd6beb00753c92ae9f4678f7507519a39b..4c53995d6d173ff6f544d52f11b675015efde26e 100644
|
||||
--- a/src/main/java/net/minecraft/core/Direction.java
|
||||
+++ b/src/main/java/net/minecraft/core/Direction.java
|
||||
@@ -217,7 +217,7 @@ public enum Direction implements StringRepresentable, ca.spottedleaf.moonrise.pa
|
||||
}
|
||||
|
||||
public Direction getOpposite() {
|
||||
- return this.opposite; // Paper - optimise collisions
|
||||
+ return VALUES[this.oppositeIndex]; // DivineMC - lithium: fast_util
|
||||
}
|
||||
|
||||
public Direction getClockWise(Direction.Axis axis) {
|
||||
@@ -350,7 +350,7 @@ public enum Direction implements StringRepresentable, ca.spottedleaf.moonrise.pa
|
||||
}
|
||||
|
||||
public static Direction getRandom(RandomSource random) {
|
||||
- return Util.getRandom(VALUES, random);
|
||||
+ return VALUES[random.nextInt(VALUES.length)]; // DivineMC - lithium: fast_util
|
||||
}
|
||||
|
||||
public static Direction getApproximateNearest(double x, double y, double z) {
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
index e74866e5195a5eeae7666ad7be750edac5947094..25d7e7116282ec4b2cf85fe0b8e920af77fe4206 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
@@ -18,6 +18,15 @@ public class AABB {
|
||||
public final double maxY;
|
||||
public final double maxZ;
|
||||
|
||||
+ // DivineMC start - lithium: fast_util
|
||||
+ static {
|
||||
+ assert Direction.Axis.X.ordinal() == 0;
|
||||
+ assert Direction.Axis.Y.ordinal() == 1;
|
||||
+ assert Direction.Axis.Z.ordinal() == 2;
|
||||
+ assert Direction.Axis.values().length == 3;
|
||||
+ }
|
||||
+ // DivineMC end
|
||||
+
|
||||
public AABB(double x1, double y1, double z1, double x2, double y2, double z2) {
|
||||
this.minX = Math.min(x1, x2);
|
||||
this.minY = Math.min(y1, y2);
|
||||
@@ -86,11 +95,33 @@ public class AABB {
|
||||
}
|
||||
|
||||
public double min(Direction.Axis axis) {
|
||||
- return axis.choose(this.minX, this.minY, this.minZ);
|
||||
+ // DivineMC start - lithium: fast_util
|
||||
+ switch (axis.ordinal()) {
|
||||
+ case 0: // X
|
||||
+ return this.minX;
|
||||
+ case 1: // Y
|
||||
+ return this.minY;
|
||||
+ case 2: // Z
|
||||
+ return this.minZ;
|
||||
+ }
|
||||
+
|
||||
+ throw new IllegalArgumentException();
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
public double max(Direction.Axis axis) {
|
||||
- return axis.choose(this.maxX, this.maxY, this.maxZ);
|
||||
+ // DivineMC start - lithium: fast_util
|
||||
+ switch (axis.ordinal()) {
|
||||
+ case 0: //X
|
||||
+ return this.maxX;
|
||||
+ case 1: //Y
|
||||
+ return this.maxY;
|
||||
+ case 2: //Z
|
||||
+ return this.maxZ;
|
||||
+ }
|
||||
+
|
||||
+ throw new IllegalArgumentException();
|
||||
+ // DivineMC end
|
||||
}
|
||||
|
||||
@Override
|
||||
Reference in New Issue
Block a user