Updated Upstream (Paper & Purpur)

This commit is contained in:
AlphaKR93
2023-03-27 12:35:18 +09:00
parent 187067c505
commit b46915c9b2
32 changed files with 275 additions and 1079 deletions

View File

@@ -1,7 +1,7 @@
group = org.plazmamc.plazma
version = 1.19.4-R0.1-SNAPSHOT
paperCommit = d5abb94e69ceed6e73116c13e7634b57b5ad84cf
paperCommit = fbf74ba0ac016c408bbec28e7da317b68a81e2e1
org.gradle.caching = true
org.gradle.parallel = true

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 23 Mar 2023 10:28:40 +0900
Date: Mon, 27 Mar 2023 02:50:22 +0000
Subject: [PATCH] Pufferfish API Changes
Original: Kevin Raneri <kevin.raneri@gmail.com>
@@ -47,7 +47,7 @@ index cad12a2632b9ebb569280441c42869685db1f31a..b83e2c5a0a094002d12aee55ec0cf8d1
into("META-INF/maven/${project.group}/${project.name}")
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a
index 0000000000000000000000000000000000000000..6fbaf2a232745db0a41394b1c2cc0cc90cefc4ee
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
@@ -0,0 +1,161 @@
@@ -69,21 +69,21 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+import org.jetbrains.annotations.Nullable;
+
+public class SentryContext {
+
+
+ private static final Gson GSON = new Gson();
+
+
+ public static void setPluginContext(@Nullable Plugin plugin) {
+ if (plugin != null) {
+ ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
+ ThreadContext.put("pufferfishsentry_pluginversion", plugin.getDescription().getVersion());
+ }
+ }
+
+
+ public static void removePluginContext() {
+ ThreadContext.remove("pufferfishsentry_pluginname");
+ ThreadContext.remove("pufferfishsentry_pluginversion");
+ }
+
+
+ public static void setSenderContext(@Nullable CommandSender sender) {
+ if (sender != null) {
+ ThreadContext.put("pufferfishsentry_playername", sender.getName());
@@ -92,15 +92,15 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+ }
+ }
+ }
+
+
+ public static void removeSenderContext() {
+ ThreadContext.remove("pufferfishsentry_playername");
+ ThreadContext.remove("pufferfishsentry_playerid");
+ }
+
+
+ public static void setEventContext(Event event, RegisteredListener registration) {
+ setPluginContext(registration.getPlugin());
+
+
+ try {
+ // Find the player that was involved with this event
+ Player player = null;
@@ -108,36 +108,36 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+ player = ((PlayerEvent) event).getPlayer();
+ } else {
+ Class<? extends Event> eventClass = event.getClass();
+
+
+ Field playerField = null;
+
+
+ for (Field field : eventClass.getDeclaredFields()) {
+ if (field.getType().equals(Player.class)) {
+ playerField = field;
+ break;
+ }
+ }
+
+
+ if (playerField != null) {
+ playerField.setAccessible(true);
+ player = (Player) playerField.get(event);
+ }
+ }
+
+
+ if (player != null) {
+ setSenderContext(player);
+ }
+ } catch (Exception e) {} // We can't really safely log exceptions.
+
+
+ ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
+ }
+
+
+ public static void removeEventContext() {
+ removePluginContext();
+ removeSenderContext();
+ ThreadContext.remove("pufferfishsentry_eventdata");
+ }
+
+
+ private static Map<String, String> serializeFields(Object object) {
+ Map<String, String> fields = new TreeMap<>();
+ fields.put("_class", object.getClass().getName());
@@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+ if (Modifier.isStatic(declaredField.getModifiers())) {
+ continue;
+ }
+
+
+ String fieldName = declaredField.getName();
+ if (fieldName.equals("handlers")) {
+ continue;
@@ -162,51 +162,51 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+ }
+ return fields;
+ }
+
+
+ public static class State {
+
+
+ private Plugin plugin;
+ private Command command;
+ private String commandLine;
+ private Event event;
+ private RegisteredListener registeredListener;
+
+
+ public Plugin getPlugin() {
+ return plugin;
+ }
+
+
+ public void setPlugin(Plugin plugin) {
+ this.plugin = plugin;
+ }
+
+
+ public Command getCommand() {
+ return command;
+ }
+
+
+ public void setCommand(Command command) {
+ this.command = command;
+ }
+
+
+ public String getCommandLine() {
+ return commandLine;
+ }
+
+
+ public void setCommandLine(String commandLine) {
+ this.commandLine = commandLine;
+ }
+
+
+ public Event getEvent() {
+ return event;
+ }
+
+
+ public void setEvent(Event event) {
+ this.event = event;
+ }
+
+
+ public RegisteredListener getRegisteredListener() {
+ return registeredListener;
+ }
+
+
+ public void setRegisteredListener(RegisteredListener registeredListener) {
+ this.registeredListener = registeredListener;
+ }
@@ -214,7 +214,7 @@ index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8e
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704ff713345
index 0000000000000000000000000000000000000000..6d266ebf5e52745ad13e90e5754b524383fa9b29
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -0,0 +1,40 @@
@@ -231,7 +231,7 @@ index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704
+ */
+@Deprecated
+public class SIMDChecker {
+
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
@@ -239,13 +239,13 @@ index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704
+ return false;
+ } else {
+ SIMDDetection.testRun = true;
+
+
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
+
+
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
+ return false;
@@ -256,11 +256,11 @@ index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
+ return false;
+ }
+
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
new file mode 100644
index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c6070711b
index 0000000000000000000000000000000000000000..fd708554d6dab2ddcd24c3024330b8ebf9462111
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
@@ -0,0 +1,35 @@
@@ -270,11 +270,11 @@ index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c
+
+@Deprecated
+public class SIMDDetection {
+
+
+ public static boolean isEnabled = false;
+ public static boolean versionLimited = false;
+ public static boolean testRun = false;
+
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
@@ -283,7 +283,7 @@ index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c
+ return false;
+ }
+ }
+
+
+ @Deprecated
+ public static int getJavaVersion() {
+ // https://stackoverflow.com/a/2591122
@@ -297,11 +297,11 @@ index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c
+ version = version.split("-")[0]; // Azul is stupid
+ return Integer.parseInt(version);
+ }
+
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
new file mode 100644
index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be0741465f
index 0000000000000000000000000000000000000000..20ec3b29b0cb4061cc89d635b3929ffe71008e22
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
@@ -0,0 +1,83 @@
@@ -316,10 +316,10 @@ index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be
+
+@Deprecated
+public class VectorMapPalette {
+
+
+ private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
+ private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
+
+
+ @Deprecated
+ public static void matchColorVectorized(int[] in, byte[] out) {
+ int speciesLength = I_SPEC.length();
@@ -329,64 +329,64 @@ index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be
+ float[] bluesArr = new float[speciesLength];
+ float[] greensArr = new float[speciesLength];
+ int[] alphasArr = new int[speciesLength];
+
+
+ for (int j = 0; j < speciesLength; j++) {
+ alphasArr[j] = (in[i + j] >> 24) & 0xFF;
+ redsArr[j] = (in[i + j] >> 16) & 0xFF;
+ greensArr[j] = (in[i + j] >> 8) & 0xFF;
+ bluesArr[j] = (in[i + j] >> 0) & 0xFF;
+ }
+
+
+ IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
+ FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
+ FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
+ FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
+ IntVector resultIndex = IntVector.zero(I_SPEC);
+ VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
+
+
+ modificationMask = modificationMask.and(alphas.lt(128).not());
+ FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
+
+
+ for (int c = 4; c < MapPalette.colors.length; c++) {
+ // We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
+ // For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
+ FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
+ FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
+ FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
+
+
+ FloatVector rMean = reds.add(compReds).div(2.0f);
+ FloatVector rDiff = reds.sub(compReds);
+ FloatVector gDiff = greens.sub(compGreens);
+ FloatVector bDiff = blues.sub(compBlues);
+
+
+ FloatVector weightR = rMean.div(256.0f).add(2);
+ FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
+ FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
+
+
+ FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
+
+
+ // Now we compare to the best distance we've found.
+ // This mask contains a "1" if better, and a "0" otherwise.
+ VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
+ bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
+
+
+ // Update the result array
+ // We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
+ resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
+ }
+
+
+ for (int j = 0; j < speciesLength; j++) {
+ int index = resultIndex.lane(j);
+ out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
+ }
+ }
+
+
+ // For the final ones, fall back to the regular method
+ for (; i < in.length; i++) {
+ out[i] = MapPalette.matchColor(new Color(in[i], true));
+ }
+ }
+
+
+}
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9584e245144b561b4f6745b2f26a4f69a6f92891 100644

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 23 Mar 2023 10:35:54 +0900
Date: Mon, 27 Mar 2023 02:52:12 +0000
Subject: [PATCH] Purpur API Changes
Original: PurpurMC

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 23 Mar 2023 10:35:36 +0900
Date: Mon, 27 Mar 2023 02:52:12 +0000
Subject: [PATCH] Purpur Server Changes
Original: PurpurMC
@@ -25,7 +25,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/build.gradle.kts b/build.gradle.kts
index 3c8293f002f11b430083502362fdc801f44aa138..6c5b3f6a2c4f7b20e3388b63c36b7c4bc4cf179f 100644
index b41b186397d013c19436c345be98b785d4bd0295..22470f0ab8354a9f31a0f195f3fe80f2f5ee2f0e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,12 +7,8 @@ plugins {
@@ -54,7 +54,7 @@ index 3c8293f002f11b430083502362fdc801f44aa138..6c5b3f6a2c4f7b20e3388b63c36b7c4b
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
@@ -82,7 +82,7 @@ tasks.jar {
@@ -81,7 +81,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -63,7 +63,7 @@ index 3c8293f002f11b430083502362fdc801f44aa138..6c5b3f6a2c4f7b20e3388b63c36b7c4b
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -154,7 +154,7 @@ fun TaskContainer.registerRunTask(
@@ -153,7 +153,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
@@ -261,27 +261,27 @@ index 39844531b03eb8a6c70700b4ecbf0ff1a557424d..632ae75cb3bbc7a3955872d14ad0fbc2
public void removeCommand(String name) {
this.children.remove(name);
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index e0076044d0a29e33ee297fe6180a041436075297..c0f44f0593aab16d5ceab493f4075772f454732e 100644
index a8cead500186142115d4dc029c942fdfc68f7fe5..62b2a3a44929b80b813bc24a33cd1f5049fecbb2 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -36,6 +36,7 @@ public class PufferfishConfig {
@@ -28,6 +28,7 @@ public class PufferfishConfig {
private static final YamlFile config = new YamlFile();
private static int updates = 0;
+ public static File pufferfishFile; // Purpur
private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) {
ConfigurationSection newSection = new MemoryConfiguration();
@@ -58,7 +59,7 @@ public class PufferfishConfig {
@@ -50,7 +51,7 @@ public class PufferfishConfig {
}
public static void load() throws IOException {
- File configFile = new File("pufferfish.yml");
+ File configFile = pufferfishFile; // Purpur
if (configFile.exists()) {
try {
@@ -232,7 +233,7 @@ public class PufferfishConfig {
@@ -224,7 +225,7 @@ public class PufferfishConfig {
public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException {
@@ -290,8 +290,8 @@ index e0076044d0a29e33ee297fe6180a041436075297..c0f44f0593aab16d5ceab493f4075772
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -276,7 +277,7 @@ public class PufferfishConfig {
@@ -268,7 +269,7 @@ public class PufferfishConfig {
public static boolean throttleInactiveGoalSelectorTick;
private static void inactiveGoalSelectorThrottle() {
- getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", true,
@@ -1049,7 +1049,7 @@ index 9ec6145fe04ec64bbee8ec6a837719caebdbc6f5..358d610ad020cada1bb83e393deeeaae
public ClientboundSetTimePacket(long time, long timeOfDay, boolean doDaylightCycle) {
this.gameTime = time;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6d5e9400892b86562519a893349ca55e566bfb24..5416b64c3000c9b17a78991218e068bf5ef33db7 100644
index a4c64b1cc11955fb279b8ed0fb7d2668a7b90d2b..2cc20cc768bbbd386972c426d3a131af33612294 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -249,7 +249,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1927,7 +1927,7 @@ index 3ce4dbf4eed442d89d6bbc8e4c6a000172041da5..57fdef8b16e1ed9a4693356144b4685b
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index c6f5d6756fa0e068a462d9c0ded12e0771abba37..0ae45cf5a084fd412305e8b2f5dabe608b4eb1c1 100644
index 8438354e482b6f892c3344eceff1abd23cfa128a..30d364b385da21544a810a76f436f06879d39b14 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -431,16 +431,16 @@ public class ServerChunkCache extends ChunkSource {
@@ -2627,10 +2627,10 @@ index ff2862bf1f511196d1e911e2584262ed728e9a81..43bf3285729ec5cedb3de84f2b606739
}
// Paper end
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361b48ef1b4 100644
index 1d4d02f26391ac55c7631817f09d05e2769b0d29..8a4be66f967dfd6b57ab542ae9b06c840647486d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -274,6 +274,11 @@ public class ServerPlayer extends Player {
@@ -275,6 +275,11 @@ public class ServerPlayer extends Player {
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event
@@ -2642,7 +2642,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
@@ -373,6 +378,7 @@ public class ServerPlayer extends Player {
@@ -374,6 +379,7 @@ public class ServerPlayer extends Player {
this.bukkitPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth();
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -2650,7 +2650,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
}
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
@@ -512,6 +518,9 @@ public class ServerPlayer extends Player {
@@ -513,6 +519,9 @@ public class ServerPlayer extends Player {
}
}
@@ -2660,7 +2660,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
}
@Override
@@ -578,6 +587,9 @@ public class ServerPlayer extends Player {
@@ -579,6 +588,9 @@ public class ServerPlayer extends Player {
}
this.getBukkitEntity().setExtraData(nbt); // CraftBukkit
@@ -2670,7 +2670,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
}
// CraftBukkit start - World fallback code, either respawn location or global spawn
@@ -706,6 +718,15 @@ public class ServerPlayer extends Player {
@@ -707,6 +719,15 @@ public class ServerPlayer extends Player {
this.trackStartFallingPosition();
this.trackEnteredOrExitedLavaOnVehicle();
this.advancements.flushDirty(this);
@@ -2686,7 +2686,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
}
public void doTick() {
@@ -944,6 +965,7 @@ public class ServerPlayer extends Player {
@@ -945,6 +966,7 @@ public class ServerPlayer extends Player {
}));
Team scoreboardteambase = this.getTeam();
@@ -2694,7 +2694,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != Team.Visibility.ALWAYS) {
if (scoreboardteambase.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
this.server.getPlayerList().broadcastSystemToTeam(this, ichatbasecomponent);
@@ -1045,14 +1067,30 @@ public class ServerPlayer extends Player {
@@ -1046,14 +1068,30 @@ public class ServerPlayer extends Player {
}
@@ -2726,7 +2726,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
return false;
} else {
Entity entity = source.getEntity();
@@ -1161,7 +1199,7 @@ public class ServerPlayer extends Player {
@@ -1162,7 +1200,7 @@ public class ServerPlayer extends Player {
PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver);
if (shapedetectorshape != null) {
@@ -2735,7 +2735,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
worldserver = shapedetectorshape.world; // CraftBukkit
if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event
if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit
@@ -1184,8 +1222,8 @@ public class ServerPlayer extends Player {
@@ -1185,8 +1223,8 @@ public class ServerPlayer extends Player {
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
// CraftBukkit end
@@ -2746,7 +2746,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
if (true) { // CraftBukkit
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
@@ -1196,6 +1234,7 @@ public class ServerPlayer extends Player {
@@ -1197,6 +1235,7 @@ public class ServerPlayer extends Player {
playerlist.sendPlayerPermissionLevel(this);
worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
this.unsetRemoved();
@@ -2754,7 +2754,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
// CraftBukkit end
this.setLevel(worldserver);
@@ -1203,7 +1242,7 @@ public class ServerPlayer extends Player {
@@ -1204,7 +1243,7 @@ public class ServerPlayer extends Player {
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
worldserver.addDuringPortalTeleport(this);
@@ -2763,7 +2763,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
this.triggerDimensionChangeTriggers(worldserver1);
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
playerlist.sendLevelInfo(this, worldserver);
@@ -1232,6 +1271,7 @@ public class ServerPlayer extends Player {
@@ -1233,6 +1272,7 @@ public class ServerPlayer extends Player {
}
// Paper end
@@ -2771,7 +2771,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
return this;
}
}
@@ -1353,7 +1393,7 @@ public class ServerPlayer extends Player {
@@ -1354,7 +1394,7 @@ public class ServerPlayer extends Player {
return entitymonster.isPreventingPlayerRest(this);
});
@@ -2780,7 +2780,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
}
}
@@ -1489,6 +1529,7 @@ public class ServerPlayer extends Player {
@@ -1490,6 +1530,7 @@ public class ServerPlayer extends Player {
@Override
public void openTextEdit(SignBlockEntity sign) {
@@ -2788,7 +2788,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
sign.setAllowedPlayerEditor(this.getUUID());
this.connection.send(new ClientboundBlockUpdatePacket(this.level, sign.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos()));
@@ -1715,6 +1756,26 @@ public class ServerPlayer extends Player {
@@ -1726,6 +1767,26 @@ public class ServerPlayer extends Player {
this.lastSentExp = -1; // CraftBukkit - Added to reset
}
@@ -2815,7 +2815,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
@Override
public void displayClientMessage(Component message, boolean overlay) {
this.sendSystemMessage(message, overlay);
@@ -2014,6 +2075,7 @@ public class ServerPlayer extends Player {
@@ -2025,6 +2086,7 @@ public class ServerPlayer extends Player {
}
public void sendTexturePack(String url, String hash, boolean required, @Nullable Component resourcePackPrompt) {
@@ -2823,7 +2823,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
this.connection.send(new ClientboundResourcePackPacket(url, hash, required, resourcePackPrompt));
}
@@ -2028,8 +2090,63 @@ public class ServerPlayer extends Player {
@@ -2039,8 +2101,63 @@ public class ServerPlayer extends Player {
public void resetLastActionTime() {
this.lastActionTime = Util.getMillis();
@@ -2887,7 +2887,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
public ServerStatsCounter getStats() {
return this.stats;
}
@@ -2490,8 +2607,16 @@ public class ServerPlayer extends Player {
@@ -2501,8 +2618,16 @@ public class ServerPlayer extends Player {
@Override
public boolean isImmobile() {
@@ -2905,7 +2905,7 @@ index a399de32d5f2f932d41fbb552780979950844a05..e5cf1bf76094b9b4e2ee9608276e0361
@Override
public Scoreboard getScoreboard() {
@@ -2540,4 +2665,50 @@ public class ServerPlayer extends Player {
@@ -2551,4 +2676,50 @@ public class ServerPlayer extends Player {
return (CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end
@@ -4049,7 +4049,7 @@ index 14fab63346d56c72cd7534a04760efd10eef4295..745e792482f61c571e2efbd4200dd1bd
@Override
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e25be74ef0a88541884ad62a4b84219400d5a142..b2ee73a2ef6042694ca84c27d592e5fb13b4a0fe 100644
index 548133e399b5abc4aa83045af87c135a3455b722..3c10c719f6172161a2dcc6592a0a1492e9b3d7c1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -155,7 +155,7 @@ import org.bukkit.plugin.PluginManager;
@@ -5071,7 +5071,7 @@ index 791f672b30f2a4d3b329e2ce0f4fb9c2ca627b01..8d7c33e16f9eaec2120c5aad75172ff6
});
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 636e601b004a412d02e5be86e97d489b52c28e1b..141b25060905f598208cb1a39f4c2b2e9f3ef766 100644
index 636e601b004a412d02e5be86e97d489b52c28e1b..8e2274f7dce34e0997356205cf96e46f8d41cca1 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -65,6 +65,7 @@ import net.minecraft.world.item.ProjectileWeaponItem;
@@ -5212,7 +5212,8 @@ index 636e601b004a412d02e5be86e97d489b52c28e1b..141b25060905f598208cb1a39f4c2b2e
- this.level.getProfiler().pop();
+ //this.level.getProfiler().pop(); // Purpur
} else {
this.level.getProfiler().push("targetSelector");
- this.level.getProfiler().push("targetSelector");
+ //this.level.getProfiler().push("targetSelector"); // Purpur
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
this.targetSelector.tick();
- this.level.getProfiler().pop();
@@ -15118,7 +15119,7 @@ index 5d199fe497bd852827d3d18fb7566a09e70331a3..6cd8a50289a6404441e9e5e08d82d2eb
if (NaturalSpawner.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, blockposition2, EntityType.WANDERING_TRADER)) {
blockposition1 = blockposition2;
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad5d8bfaac 100644
index 0629c471d38a77c44fc1c86ccdfcb0690f61ca17..d055cfc257cc7282170ba67c848af3e6c5f2ec1f 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -186,6 +186,8 @@ public abstract class Player extends LivingEntity {
@@ -15198,7 +15199,7 @@ index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad
}
@Override
@@ -584,7 +624,7 @@ public abstract class Player extends LivingEntity {
@@ -590,7 +630,7 @@ public abstract class Player extends LivingEntity {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
@@ -15207,7 +15208,7 @@ index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad
list1.add(entity);
} else if (!entity.isRemoved()) {
this.touch(entity);
@@ -1275,7 +1315,7 @@ public abstract class Player extends LivingEntity {
@@ -1281,7 +1321,7 @@ public abstract class Player extends LivingEntity {
flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper
flag2 = flag2 && !this.isSprinting();
if (flag2) {
@@ -15216,7 +15217,7 @@ index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad
}
f += f1;
@@ -1944,9 +1984,19 @@ public abstract class Player extends LivingEntity {
@@ -1950,9 +1990,19 @@ public abstract class Player extends LivingEntity {
@Override
public int getExperienceReward() {
if (!this.level.getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) && !this.isSpectator()) {
@@ -15239,7 +15240,7 @@ index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad
} else {
return 0;
}
@@ -2022,6 +2072,11 @@ public abstract class Player extends LivingEntity {
@@ -2028,6 +2078,11 @@ public abstract class Player extends LivingEntity {
return this.inventory.armor;
}
@@ -15251,7 +15252,7 @@ index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad
public boolean setEntityOnShoulder(CompoundTag entityNbt) {
if (!this.isPassenger() && this.onGround && !this.isInWater() && !this.isInPowderSnow) {
if (this.getShoulderEntityLeft().isEmpty()) {
@@ -2305,7 +2360,7 @@ public abstract class Player extends LivingEntity {
@@ -2311,7 +2366,7 @@ public abstract class Player extends LivingEntity {
public ItemStack eat(Level world, ItemStack stack) {
this.getFoodData().eat(stack.getItem(), stack);
this.awardStat(Stats.ITEM_USED.get(stack.getItem()));
@@ -16659,7 +16660,7 @@ index 180aec596110309aade13d2080f8824d152b07cb..c4aec1e5135a79837918b692e75a7b55
return InteractionResult.PASS;
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e526254e35f 100644
index d690b8d0c1da1f56b226376df8c76c34375e3c73..0c0a0639cd9c85d4332a6fa85e3143510f3c7448 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -109,6 +109,7 @@ import org.bukkit.event.world.StructureGrowEvent;
@@ -16670,7 +16671,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
public static final Codec<ItemStack> CODEC = RecordCodecBuilder.create((instance) -> {
return instance.group(BuiltInRegistries.ITEM.byNameCodec().fieldOf("id").forGetter((itemstack) -> {
return itemstack.item;
@@ -414,6 +415,7 @@ public final class ItemStack {
@@ -415,6 +416,7 @@ public final class ItemStack {
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
for (BlockState blockstate : blocks) {
blockstate.update(true, false);
@@ -16678,7 +16679,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
}
world.preventPoiUpdated = false;
@@ -443,6 +445,7 @@ public final class ItemStack {
@@ -444,6 +446,7 @@ public final class ItemStack {
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, itemactioncontext); // Paper - pass itemactioncontext
}
@@ -16686,7 +16687,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
}
@@ -558,6 +561,16 @@ public final class ItemStack {
@@ -559,6 +562,16 @@ public final class ItemStack {
return this.isDamageableItem() && this.getDamageValue() > 0;
}
@@ -16703,7 +16704,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
public int getDamageValue() {
return this.tag == null ? 0 : this.tag.getInt("Damage");
}
@@ -577,7 +590,7 @@ public final class ItemStack {
@@ -578,7 +591,7 @@ public final class ItemStack {
int j;
if (amount > 0) {
@@ -16712,7 +16713,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
int k = 0;
for (int l = 0; j > 0 && l < amount; ++l) {
@@ -632,6 +645,12 @@ public final class ItemStack {
@@ -633,6 +646,12 @@ public final class ItemStack {
if (this.hurt(amount, entity.getRandom(), entity /*instanceof ServerPlayer ? (ServerPlayer) entity : null*/)) { // Paper - pass LivingEntity for EntityItemDamageEvent
breakCallback.accept(entity);
Item item = this.getItem();
@@ -16725,7 +16726,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
// CraftBukkit start - Check for item breaking
if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) {
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((net.minecraft.world.entity.player.Player) entity, this);
@@ -1164,7 +1183,7 @@ public final class ItemStack {
@@ -1165,7 +1184,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
@@ -16734,7 +16735,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e52
processEnchantOrder(this.tag); // Paper
}
@@ -1172,6 +1191,12 @@ public final class ItemStack {
@@ -1173,6 +1192,12 @@ public final class ItemStack {
return this.tag != null && this.tag.contains("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
}
@@ -17513,7 +17514,7 @@ index 3d2b34c5a7c9b00c1164b4f89c2cbff81fc460eb..b5505e926e5cdb447de68e8eb8e46c97
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
index 96434f14525a2159f335b94aad95081f488fadf3..d56bbd43b127a1d663a398b1da7090ff64ab6a6c 100644
index 3aa79a441ac4bd6b4d87d19bdb3011455210fd41..4de8e77ef7574a0febf9c89258e4aeb26f4af6fc 100644
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
@@ -97,7 +97,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
@@ -20681,7 +20682,7 @@ index 4d7a2c4c1001aefe9fcd4be8dbcb414f721bfff9..2c7716a9d65ebda209a144b82c2126b6
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1bada55af5d16437da4d16f9ded55f88a6121eb4..2b647aeb75e2207186bf9506fba0d92a745cfae8 100644
index 0ae1fce0c1a2e3bfbbab756a088fc76545e263fa..f81b320ef330d03b68cf8b4af04b7c991ce9636b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -525,10 +525,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -20712,7 +20713,7 @@ index 1bada55af5d16437da4d16f9ded55f88a6121eb4..2b647aeb75e2207186bf9506fba0d92a
return false;
}
@@ -2356,6 +2365,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2366,6 +2375,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().getAbilities().walkingSpeed * 2f;
}
@@ -20741,7 +20742,7 @@ index 1bada55af5d16437da4d16f9ded55f88a6121eb4..2b647aeb75e2207186bf9506fba0d92a
private void validateSpeed(float value) {
if (value < 0) {
if (value < -1f) {
@@ -3148,4 +3179,97 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3158,4 +3189,97 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.spigot;
}
// Spigot end
@@ -21921,7 +21922,7 @@ index 0000000000000000000000000000000000000000..0bcbe1f07ff8e552d2abd6e432af5710
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..fe903b1e1bd211651e3808becd34a2d28dc57f34
index 0000000000000000000000000000000000000000..d3f2002759ac4788feca1e62c90c2e64596eb2f2
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -0,0 +1,3189 @@
@@ -22050,7 +22051,7 @@ index 0000000000000000000000000000000000000000..fe903b1e1bd211651e3808becd34a2d2
+ public boolean useBetterMending = false;
+ public boolean alwaysTameInCreative = false;
+ public boolean boatEjectPlayersOnLand = false;
+ public boolean boatsDoFallDamage = true;
+ public boolean boatsDoFallDamage = false;
+ public boolean disableDropsOnCrammingDeath = false;
+ public boolean entitiesCanUsePortals = true;
+ public boolean entitiesPickUpLootBypassMobGriefing = false;

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 23 Mar 2023 12:08:57 +0900
Subject: [PATCH] Build Fix
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 141b25060905f598208cb1a39f4c2b2e9f3ef766..d67bc2abe9590b1b0b86e450c9fabe5e2237be6c 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -946,7 +946,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
this.goalSelector.tickRunningGoals(false);
//this.level.getProfiler().pop(); // Purpur
} else {
- this.level.getProfiler().push("targetSelector");
+ //this.level.getProfiler().push("targetSelector"); // Plazma - build fix
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
this.targetSelector.tick();
//this.level.getProfiler().pop(); // Purpur

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index 6c5b3f6a2c4f7b20e3388b63c36b7c4bc4cf179f..e4de94641d33b3deadc44bbb5f23f666d79737ea 100644
index 22470f0ab8354a9f31a0f195f3fe80f2f5ee2f0e..dc89b3a8956af69fa71a2bfa17c22aee6c5e9edf 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,7 @@ plugins {
@@ -17,7 +17,7 @@ index 6c5b3f6a2c4f7b20e3388b63c36b7c4bc4cf179f..e4de94641d33b3deadc44bbb5f23f666
implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
@@ -82,7 +82,7 @@ tasks.jar {
@@ -81,7 +81,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -175,7 +175,7 @@ index c6fa6bcd66d61359124a8426b919493c6ec43f06..e0eaa847526431ac58d00f18f0fca6b1
/* CraftBukkit start - Replace everything
OptionParser optionparser = new OptionParser();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5416b64c3000c9b17a78991218e068bf5ef33db7..180ea5edb002856f975c074e319998b68b67a7af 100644
index 2cc20cc768bbbd386972c426d3a131af33612294..b81f8207348992761eac2aca8bae370c9b39f0f3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -929,7 +929,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -169,7 +169,7 @@ index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae62
+ // Plazma end
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 180ea5edb002856f975c074e319998b68b67a7af..6d2d1d99977d33fdd8c9a34b65bbca189852d1c0 100644
index b81f8207348992761eac2aca8bae370c9b39f0f3..9ba8bf1cc91494651a1855d12415f4ac3586cf9d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -308,6 +308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View File

@@ -7,56 +7,45 @@ Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC
Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index c0f44f0593aab16d5ceab493f4075772f454732e..7aa260293a12c0b9b9efcd2d8bc470fb06a32cf1 100644
index 62b2a3a44929b80b813bc24a33cd1f5049fecbb2..cea33db916f9fd828f3cb131a4b2ebdd16866649 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -72,7 +72,7 @@ public class PufferfishConfig {
getString("info.version", "1.0");
setComment("info",
"Pufferfish Configuration",
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -220,7 +220,7 @@ public class PufferfishConfig {
@@ -211,7 +211,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() {
maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
- maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
+ maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); // Plazma - Optimize Default Configurations
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 10 : 8, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
}
@@ -233,7 +233,7 @@ public class PufferfishConfig {
@@ -225,7 +225,7 @@ public class PufferfishConfig {
public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Purpur // Plazma - Optimize Default Configurations
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", !Boolean.getBoolean("Plazma.disableConfigOptimization")); // Purpur // Plazma
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -241,7 +241,7 @@ public class PufferfishConfig {
@@ -233,7 +233,7 @@ public class PufferfishConfig {
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
"This value defines how often in ticks, the furthest entity",
"will get their pathfinders and behaviors ticked. 20 = 1s");
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 7, // Plazma - Optimize Default Configurations
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("Plazma.disableConfigOptimization") ? 8 : 7, // Plazma
"This value defines how much distance modifies an entity's",
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.",
@@ -277,7 +277,7 @@ public class PufferfishConfig {
@@ -269,16 +269,16 @@ public class PufferfishConfig {
public static boolean throttleInactiveGoalSelectorTick;
private static void inactiveGoalSelectorThrottle() {
- getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur
+ getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", !Boolean.getBoolean("Plazma.disableConfigOptimization"), // Purpur // Plazma - Optimize Default Configurations
+ getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", !Boolean.getBoolean("Plazma.disableConfigOptimization"), // Purpur // Plazma
"Throttles the AI goal selector in entity inactive ticks.",
"This can improve performance by a few percent, but has minor gameplay implications.");
}
@@ -307,10 +307,10 @@ public class PufferfishConfig {
}
- public static boolean disableMethodProfiler;
@@ -339,7 +328,7 @@ index ac238eeea791180b66677870401c0b756f0db07b..ce960bc620d84e56c4e7fc9b721fd45c
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index fe903b1e1bd211651e3808becd34a2d28dc57f34..bd87af1ebde124ba405d3e1d1698b78724e112c4 100644
index d3f2002759ac4788feca1e62c90c2e64596eb2f2..47f2c8f23e318b89324bfcb1342dadc325f53afc 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {

View File

@@ -33,10 +33,10 @@ index 904fcdeb7937d36208cc9a8d5eca9ef3a5b2cd9e..7f749579fe056a8436e6625204ae31f1
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 74238a87d1ff3391aac5812b24b84af228baeaa4..3d900e323e1e11b56ad2a7d8f8ebcb71c069cfe0 100644
index 8a4be66f967dfd6b57ab542ae9b06c840647486d..29c46144de1aad31b997ee5000114e6f33f1a1f7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -727,8 +727,36 @@ public class ServerPlayer extends Player {
@@ -728,8 +728,36 @@ public class ServerPlayer extends Player {
}
}
// Purpur end
@@ -73,7 +73,7 @@ index 74238a87d1ff3391aac5812b24b84af228baeaa4..3d900e323e1e11b56ad2a7d8f8ebcb71
public void doTick() {
try {
if (valid && !this.isSpectator() || !this.touchingUnloadedChunk()) { // Paper - don't tick dead players that are not in the world currently (pending respawn)
@@ -2345,7 +2373,14 @@ public class ServerPlayer extends Player {
@@ -2356,7 +2384,14 @@ public class ServerPlayer extends Player {
return true; // Paper
}

View File

@@ -117,7 +117,7 @@ index aadc6743deb195ac3368548a75be641ffd3da404..90314f86e17ac7756f8211519fc5cde5
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 0c5efd0b364e4c1f510d30094757ddb7dc979a68..304de4844e822431e41ce685ed94e5307612482b 100644
index 6e7c0e95b27c41bf12da1beb3458830ce27c6029..24de1e98661541f36715c59de1487959fb53b4db 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
@@ -108,6 +108,18 @@ public class Sniffer extends Animal {
@@ -210,7 +210,7 @@ index ce960bc620d84e56c4e7fc9b721fd45c4cfc4dac..57534bdf23b8373078a5f39c930cdb1d
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index bd87af1ebde124ba405d3e1d1698b78724e112c4..26db2140458405eb93997c784b3a47b161804007 100644
index 47f2c8f23e318b89324bfcb1342dadc325f53afc..eae616d7b0a318253725ef5bd3891f34b9d9b493 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1084,7 +1084,15 @@ public class PurpurWorldConfig {

View File

@@ -18,10 +18,10 @@ index 591163d8f8300b084ac734800efee902c4def958..d74401ca3182145d136ad668704f5c04
double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index c79e2b5160c41ce77ebd5355aebcefb3cb9151ca..735655847f75584a985c896637f47c2481b0cae6 100644
index 29c46144de1aad31b997ee5000114e6f33f1a1f7..c6d860687f6a1c286c286bb64ac4eed75a88f0c4 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -402,7 +402,7 @@ public class ServerPlayer extends Player {
@@ -403,7 +403,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);
@@ -30,7 +30,7 @@ index c79e2b5160c41ce77ebd5355aebcefb3cb9151ca..735655847f75584a985c896637f47c24
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
@@ -439,7 +439,7 @@ public class ServerPlayer extends Player {
@@ -440,7 +440,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);

View File

@@ -10,7 +10,7 @@ Subject: [PATCH] Various Optimizations
0011 - Swaps the predicate order of collision (Akarin)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b2ee73a2ef6042694ca84c27d592e5fb13b4a0fe..d6e20ebb1e07da767f6571bbaf0dc882cdf4503f 100644
index 3c10c719f6172161a2dcc6592a0a1492e9b3d7c1..d64f188257c135e2a4af07e28ff8f912c80eac03 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1991,8 +1991,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

View File

@@ -18,7 +18,7 @@ index e5ea9f27a1936ed9e329e74317c91c5df89b9fbd..7e7a4d872983cd2efdc575bc33353f94
private long lastFill = -1;
private long nextRefill = -1;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6d2d1d99977d33fdd8c9a34b65bbca189852d1c0..6e2713a2f3c30a09f54bab4d0746d84dad66be2e 100644
index 9ba8bf1cc91494651a1855d12415f4ac3586cf9d..17cd928af104d74704d61ca26084bd60014af800 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -693,7 +693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa