Update sync chunk load debug patch

Had to drop some hunks modifying getEntities, as those methods were rewritten by Mojang in 1.17
This commit is contained in:
Jason Penilla 2021-06-15 17:50:38 -07:00
parent d50b33f4da
commit 4d40e87b33
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8
332 changed files with 501 additions and 509 deletions

View File

@ -1,322 +1,5 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 19 Jul 2019 03:29:14 -0700
Subject: [PATCH] Reduce sync loads
1.17: more entity stuff that someone has to figure out!
This reduces calls to getChunkAt which would load chunks.
These hunks are for getEntities, which Mojang rewrote in 1.17.
This patch also adds a tool to find calls which are doing this, however
it must be enabled by setting the startup flag -Dpaper.debug-sync-loads=true
To get a debug log for sync loads, the command is /paper syncloadinfo
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 62711d95db62221a2e4e6423c518afe13a6c7dbe..ff718bc7f521575e6a670e17fcf59a2d30841705 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -1,12 +1,18 @@
package com.destroystokyo.paper;
import com.destroystokyo.paper.io.chunk.ChunkTaskManager;
+import com.destroystokyo.paper.io.SyncLoadFinder;
import com.google.common.base.Functions;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.gson.JsonObject;
+import com.google.gson.internal.Streams;
+import com.google.gson.stream.JsonWriter;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.MCUtil;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkHolder;
import net.minecraft.server.level.ServerChunkCache;
@@ -14,7 +20,6 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.ChunkPos;
-import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MCUtil;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
@@ -29,6 +34,9 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.entity.Player;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.io.StringWriter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
@@ -44,7 +52,7 @@ import java.util.stream.Collectors;
public class PaperCommand extends Command {
private static final String BASE_PERM = "bukkit.command.paper.";
- private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "dumpwaiting").build();
+ private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "dumpwaiting", "syncloadinfo").build();
public PaperCommand(String name) {
super(name);
@@ -162,6 +170,9 @@ public class PaperCommand extends Command {
case "chunkinfo":
doChunkInfo(sender, args);
break;
+ case "syncloadinfo":
+ this.doSyncLoadInfo(sender, args);
+ break;
case "ver":
if (!testPermission(sender, "version")) break; // "ver" needs a special check because it's an alias. All other commands are checked up before the switch statement (because they are present in the SUBCOMMANDS set)
case "version":
@@ -179,6 +190,40 @@ public class PaperCommand extends Command {
return true;
}
+ private void doSyncLoadInfo(CommandSender sender, String[] args) {
+ if (!SyncLoadFinder.ENABLED) {
+ sender.sendMessage(ChatColor.RED + "This command requires the server startup flag '-Dpaper.debug-sync-loads=true' to be set.");
+ return;
+ }
+ File file = new File(new File(new File("."), "debug"),
+ "sync-load-info" + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + ".txt");
+ file.getParentFile().mkdirs();
+ sender.sendMessage(ChatColor.GREEN + "Writing sync load info to " + file.toString());
+
+
+ try {
+ final JsonObject data = SyncLoadFinder.serialize();
+
+ StringWriter stringWriter = new StringWriter();
+ JsonWriter jsonWriter = new JsonWriter(stringWriter);
+ jsonWriter.setIndent(" ");
+ jsonWriter.setLenient(false);
+ Streams.write(data, jsonWriter);
+
+ String fileData = stringWriter.toString();
+
+ try (
+ PrintStream out = new PrintStream(new FileOutputStream(file), false, "UTF-8")
+ ) {
+ out.print(fileData);
+ }
+ sender.sendMessage(ChatColor.GREEN + "Successfully written sync load information!");
+ } catch (Throwable thr) {
+ sender.sendMessage(ChatColor.RED + "Failed to write sync load information");
+ thr.printStackTrace();
+ }
+ }
+
private void doChunkInfo(CommandSender sender, String[] args) {
List<org.bukkit.World> worlds;
if (args.length < 2 || args[1].equals("*")) {
diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
new file mode 100644
index 0000000000000000000000000000000000000000..524f33371b9de1d4dd6972fe59ffbe1804d7c5f3
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
@@ -0,0 +1,171 @@
+package com.destroystokyo.paper.io;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.mojang.datafixers.util.Pair;
+import it.unimi.dsi.fastutil.longs.Long2IntMap;
+import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+import net.minecraft.world.level.Level;
+
+public class SyncLoadFinder {
+
+ public static final boolean ENABLED = Boolean.getBoolean("paper.debug-sync-loads");
+
+ private static final WeakHashMap<Level, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation>> SYNC_LOADS = new WeakHashMap<>();
+
+ private static final class SyncLoadInformation {
+
+ public int times;
+
+ public final Long2IntOpenHashMap coordinateTimes = new Long2IntOpenHashMap();
+ }
+
+ public static void logSyncLoad(final Level world, final int chunkX, final int chunkZ) {
+ if (!ENABLED) {
+ return;
+ }
+
+ final ThrowableWithEquals stacktrace = new ThrowableWithEquals(Thread.currentThread().getStackTrace());
+
+ SYNC_LOADS.compute(world, (final Level keyInMap, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation> map) -> {
+ if (map == null) {
+ map = new Object2ObjectOpenHashMap<>();
+ }
+
+ map.compute(stacktrace, (ThrowableWithEquals keyInMap0, SyncLoadInformation valueInMap) -> {
+ if (valueInMap == null) {
+ valueInMap = new SyncLoadInformation();
+ }
+
+ ++valueInMap.times;
+
+ valueInMap.coordinateTimes.compute(IOUtil.getCoordinateKey(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
+ return valueInMap1 == null ? Integer.valueOf(1) : Integer.valueOf(valueInMap1.intValue() + 1);
+ });
+
+ return valueInMap;
+ });
+
+ return map;
+ });
+ }
+
+ public static JsonObject serialize() {
+ final JsonObject ret = new JsonObject();
+
+ final JsonArray worldsData = new JsonArray();
+
+ for (final Map.Entry<Level, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation>> entry : SYNC_LOADS.entrySet()) {
+ final Level world = entry.getKey();
+
+ final JsonObject worldData = new JsonObject();
+
+ worldData.addProperty("name", world.getWorld().getName());
+
+ final List<Pair<ThrowableWithEquals, SyncLoadInformation>> data = new ArrayList<>();
+
+ entry.getValue().forEach((ThrowableWithEquals stacktrace, SyncLoadInformation times) -> {
+ data.add(new Pair<>(stacktrace, times));
+ });
+
+ data.sort((Pair<ThrowableWithEquals, SyncLoadInformation> pair1, Pair<ThrowableWithEquals, SyncLoadInformation> pair2) -> {
+ return Integer.compare(pair2.getSecond().times, pair1.getSecond().times); // reverse order
+ });
+
+ final JsonArray stacktraces = new JsonArray();
+
+ for (Pair<ThrowableWithEquals, SyncLoadInformation> pair : data) {
+ final JsonObject stacktrace = new JsonObject();
+
+ stacktrace.addProperty("times", pair.getSecond().times);
+
+ final JsonArray traces = new JsonArray();
+
+ for (StackTraceElement element : pair.getFirst().stacktrace) {
+ traces.add(String.valueOf(element));
+ }
+
+ stacktrace.add("stacktrace", traces);
+
+ final JsonArray coordinates = new JsonArray();
+
+ for (Long2IntMap.Entry coordinate : pair.getSecond().coordinateTimes.long2IntEntrySet()) {
+ final long key = coordinate.getLongKey();
+ final int times = coordinate.getIntValue();
+ coordinates.add("(" + IOUtil.getCoordinateX(key) + "," + IOUtil.getCoordinateZ(key) + "): " + times);
+ }
+
+ stacktrace.add("coordinates", coordinates);
+
+ stacktraces.add(stacktrace);
+ }
+
+
+ worldData.add("stacktraces", stacktraces);
+ worldsData.add(worldData);
+ }
+
+ ret.add("worlds", worldsData);
+
+ return ret;
+ }
+
+ static final class ThrowableWithEquals {
+
+ private final StackTraceElement[] stacktrace;
+ private final int hash;
+
+ public ThrowableWithEquals(final StackTraceElement[] stacktrace) {
+ this.stacktrace = stacktrace;
+ this.hash = ThrowableWithEquals.hash(stacktrace);
+ }
+
+ public static int hash(final StackTraceElement[] stacktrace) {
+ int hash = 0;
+
+ for (int i = 0; i < stacktrace.length; ++i) {
+ hash *= 31;
+ hash += stacktrace[i].hashCode();
+ }
+
+ return hash;
+ }
+
+ @Override
+ public int hashCode() {
+ return this.hash;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (obj == null || obj.getClass() != this.getClass()) {
+ return false;
+ }
+
+ final ThrowableWithEquals other = (ThrowableWithEquals)obj;
+ final StackTraceElement[] otherStackTrace = other.stacktrace;
+
+ if (this.stacktrace.length != otherStackTrace.length || this.hash != other.hash) {
+ return false;
+ }
+
+ if (this == obj) {
+ return true;
+ }
+
+ for (int i = 0; i < this.stacktrace.length; ++i) {
+ if (!this.stacktrace[i].equals(otherStackTrace[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 120b604d91643248ab375969f95f62a74cbf6be7..5e0d55c3821b1769d20514a8a6c5c74477019778 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -494,6 +494,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.asyncChunkTaskManager.raisePriority(x1, z1, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.level, x1, z1);
// Paper end
+ com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x1, z1); // Paper - sync load info
this.level.timings.syncChunkLoad.startTiming(); // Paper
this.mainThreadProcessor.managedBlock(completablefuture::isDone);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9d4c81a4964317a0726171dc6d490d12bd959cc4..01f879a8dd0e1ffec380e02072567330152eaceb 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -276,6 +276,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
};
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
// Paper end
+ // Paper start
+ @Override
+ public boolean hasChunk(int chunkX, int chunkZ) {
+ return this.getChunkSource().getChunkAtIfLoadedImmediately(chunkX, chunkZ) != null;
+ }
+ // Paper end
// Add env and gen to constructor, WorldData -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<net.minecraft.world.level.Level> resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 3a1b9f1ba19b28cebdafeb3b2476217d47213862..3e2cd6c7a34c1a792d7346019a8b039d1f4a7c04 100644
--- a/src/main/java/net/minecraft/world/level/Level.java

View File

@ -0,0 +1,309 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 19 Jul 2019 03:29:14 -0700
Subject: [PATCH] Add debug for sync chunk loads
This patch adds a tool to find calls to getChunkAt which would load
chunks, however it must be enabled by setting the startup flag
-Dpaper.debug-sync-loads=true
To get a debug log for sync loads, the command is /paper syncloadinfo
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..de45163023f436d386e90e6ded5e6105ba3ecf35 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -1,11 +1,17 @@
package com.destroystokyo.paper;
+import com.destroystokyo.paper.io.SyncLoadFinder;
import com.google.common.base.Functions;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import com.google.gson.JsonObject;
+import com.google.gson.internal.Streams;
+import com.google.gson.stream.JsonWriter;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.server.MCUtil;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkHolder;
import net.minecraft.server.level.ServerChunkCache;
@@ -30,6 +36,9 @@ import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.entity.Player;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.io.StringWriter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayDeque;
@@ -47,7 +56,7 @@ import java.util.stream.Collectors;
public class PaperCommand extends Command {
private static final String BASE_PERM = "bukkit.command.paper.";
- private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight").build();
+ private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight", "syncloadinfo").build();
public PaperCommand(String name) {
super(name);
@@ -165,6 +174,9 @@ public class PaperCommand extends Command {
case "fixlight":
this.doFixLight(sender, args);
break;
+ case "syncloadinfo":
+ this.doSyncLoadInfo(sender, args);
+ break;
case "ver":
if (!testPermission(sender, "version")) break; // "ver" needs a special check because it's an alias. All other commands are checked up before the switch statement (because they are present in the SUBCOMMANDS set)
case "version":
@@ -182,6 +194,40 @@ public class PaperCommand extends Command {
return true;
}
+ private void doSyncLoadInfo(CommandSender sender, String[] args) {
+ if (!SyncLoadFinder.ENABLED) {
+ sender.sendMessage(ChatColor.RED + "This command requires the server startup flag '-Dpaper.debug-sync-loads=true' to be set.");
+ return;
+ }
+ File file = new File(new File(new File("."), "debug"),
+ "sync-load-info" + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss").format(LocalDateTime.now()) + ".txt");
+ file.getParentFile().mkdirs();
+ sender.sendMessage(ChatColor.GREEN + "Writing sync load info to " + file.toString());
+
+
+ try {
+ final JsonObject data = SyncLoadFinder.serialize();
+
+ StringWriter stringWriter = new StringWriter();
+ JsonWriter jsonWriter = new JsonWriter(stringWriter);
+ jsonWriter.setIndent(" ");
+ jsonWriter.setLenient(false);
+ Streams.write(data, jsonWriter);
+
+ String fileData = stringWriter.toString();
+
+ try (
+ PrintStream out = new PrintStream(new FileOutputStream(file), false, "UTF-8")
+ ) {
+ out.print(fileData);
+ }
+ sender.sendMessage(ChatColor.GREEN + "Successfully written sync load information!");
+ } catch (Throwable thr) {
+ sender.sendMessage(ChatColor.RED + "Failed to write sync load information");
+ thr.printStackTrace();
+ }
+ }
+
private void doChunkInfo(CommandSender sender, String[] args) {
List<org.bukkit.World> worlds;
if (args.length < 2 || args[1].equals("*")) {
diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
new file mode 100644
index 0000000000000000000000000000000000000000..524f33371b9de1d4dd6972fe59ffbe1804d7c5f3
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
@@ -0,0 +1,171 @@
+package com.destroystokyo.paper.io;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.mojang.datafixers.util.Pair;
+import it.unimi.dsi.fastutil.longs.Long2IntMap;
+import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+import net.minecraft.world.level.Level;
+
+public class SyncLoadFinder {
+
+ public static final boolean ENABLED = Boolean.getBoolean("paper.debug-sync-loads");
+
+ private static final WeakHashMap<Level, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation>> SYNC_LOADS = new WeakHashMap<>();
+
+ private static final class SyncLoadInformation {
+
+ public int times;
+
+ public final Long2IntOpenHashMap coordinateTimes = new Long2IntOpenHashMap();
+ }
+
+ public static void logSyncLoad(final Level world, final int chunkX, final int chunkZ) {
+ if (!ENABLED) {
+ return;
+ }
+
+ final ThrowableWithEquals stacktrace = new ThrowableWithEquals(Thread.currentThread().getStackTrace());
+
+ SYNC_LOADS.compute(world, (final Level keyInMap, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation> map) -> {
+ if (map == null) {
+ map = new Object2ObjectOpenHashMap<>();
+ }
+
+ map.compute(stacktrace, (ThrowableWithEquals keyInMap0, SyncLoadInformation valueInMap) -> {
+ if (valueInMap == null) {
+ valueInMap = new SyncLoadInformation();
+ }
+
+ ++valueInMap.times;
+
+ valueInMap.coordinateTimes.compute(IOUtil.getCoordinateKey(chunkX, chunkZ), (Long keyInMap1, Integer valueInMap1) -> {
+ return valueInMap1 == null ? Integer.valueOf(1) : Integer.valueOf(valueInMap1.intValue() + 1);
+ });
+
+ return valueInMap;
+ });
+
+ return map;
+ });
+ }
+
+ public static JsonObject serialize() {
+ final JsonObject ret = new JsonObject();
+
+ final JsonArray worldsData = new JsonArray();
+
+ for (final Map.Entry<Level, Object2ObjectOpenHashMap<ThrowableWithEquals, SyncLoadInformation>> entry : SYNC_LOADS.entrySet()) {
+ final Level world = entry.getKey();
+
+ final JsonObject worldData = new JsonObject();
+
+ worldData.addProperty("name", world.getWorld().getName());
+
+ final List<Pair<ThrowableWithEquals, SyncLoadInformation>> data = new ArrayList<>();
+
+ entry.getValue().forEach((ThrowableWithEquals stacktrace, SyncLoadInformation times) -> {
+ data.add(new Pair<>(stacktrace, times));
+ });
+
+ data.sort((Pair<ThrowableWithEquals, SyncLoadInformation> pair1, Pair<ThrowableWithEquals, SyncLoadInformation> pair2) -> {
+ return Integer.compare(pair2.getSecond().times, pair1.getSecond().times); // reverse order
+ });
+
+ final JsonArray stacktraces = new JsonArray();
+
+ for (Pair<ThrowableWithEquals, SyncLoadInformation> pair : data) {
+ final JsonObject stacktrace = new JsonObject();
+
+ stacktrace.addProperty("times", pair.getSecond().times);
+
+ final JsonArray traces = new JsonArray();
+
+ for (StackTraceElement element : pair.getFirst().stacktrace) {
+ traces.add(String.valueOf(element));
+ }
+
+ stacktrace.add("stacktrace", traces);
+
+ final JsonArray coordinates = new JsonArray();
+
+ for (Long2IntMap.Entry coordinate : pair.getSecond().coordinateTimes.long2IntEntrySet()) {
+ final long key = coordinate.getLongKey();
+ final int times = coordinate.getIntValue();
+ coordinates.add("(" + IOUtil.getCoordinateX(key) + "," + IOUtil.getCoordinateZ(key) + "): " + times);
+ }
+
+ stacktrace.add("coordinates", coordinates);
+
+ stacktraces.add(stacktrace);
+ }
+
+
+ worldData.add("stacktraces", stacktraces);
+ worldsData.add(worldData);
+ }
+
+ ret.add("worlds", worldsData);
+
+ return ret;
+ }
+
+ static final class ThrowableWithEquals {
+
+ private final StackTraceElement[] stacktrace;
+ private final int hash;
+
+ public ThrowableWithEquals(final StackTraceElement[] stacktrace) {
+ this.stacktrace = stacktrace;
+ this.hash = ThrowableWithEquals.hash(stacktrace);
+ }
+
+ public static int hash(final StackTraceElement[] stacktrace) {
+ int hash = 0;
+
+ for (int i = 0; i < stacktrace.length; ++i) {
+ hash *= 31;
+ hash += stacktrace[i].hashCode();
+ }
+
+ return hash;
+ }
+
+ @Override
+ public int hashCode() {
+ return this.hash;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (obj == null || obj.getClass() != this.getClass()) {
+ return false;
+ }
+
+ final ThrowableWithEquals other = (ThrowableWithEquals)obj;
+ final StackTraceElement[] otherStackTrace = other.stacktrace;
+
+ if (this.stacktrace.length != otherStackTrace.length || this.hash != other.hash) {
+ return false;
+ }
+
+ if (this == obj) {
+ return true;
+ }
+
+ for (int i = 0; i < this.stacktrace.length; ++i) {
+ if (!this.stacktrace[i].equals(otherStackTrace[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index c22b7cfdcff46161444cd145a50678e982f2f645..acb710c25a3b1a151a6dbf579a871529f077b70f 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -483,6 +483,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.asyncChunkTaskManager.raisePriority(x1, z1, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.level, x1, z1);
// Paper end
+ com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x1, z1); // Paper - sync load info
this.level.timings.syncChunkLoad.startTiming(); // Paper
chunkproviderserver_a.managedBlock(completablefuture::isDone);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5a397c3f0f21ec8dc9b7ceecbc873cdf6843e203..0eed1e0c2c87f9c5ab14ad2d4971e3724ab2135d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -280,6 +280,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
};
public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager;
// Paper end
+ // Paper start
+ @Override
+ public boolean hasChunk(int chunkX, int chunkZ) {
+ return this.getChunkSource().getChunkAtIfLoadedImmediately(chunkX, chunkZ) != null;
+ }
+ // Paper end
// Paper start - optimise getPlayerByUUID
@Nullable

View File

@ -71,10 +71,10 @@ index 0000000000000000000000000000000000000000..3edc8e52e06a62ce9f8cc734fd7458b3
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c5070975be1ceeab20ad0b3bab790426adb5e5fa..86ee1b535a6e586fd4e9e3c37f439d81b4508939 100644
index 0eed1e0c2c87f9c5ab14ad2d4971e3724ab2135d..69207f264d68e7181b8d3681ac18e0f9c5d74ec8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -667,7 +667,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -673,7 +673,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
});
}
@ -88,7 +88,7 @@ index c5070975be1ceeab20ad0b3bab790426adb5e5fa..86ee1b535a6e586fd4e9e3c37f439d81
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
@@ -675,10 +680,10 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -681,10 +686,10 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("thunder");
@ -101,7 +101,7 @@ index c5070975be1ceeab20ad0b3bab790426adb5e5fa..86ee1b535a6e586fd4e9e3c37f439d81
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
@@ -701,66 +706,81 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -707,66 +712,81 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
}
gameprofilerfiller.popPush("iceandsnow");
@ -253,7 +253,7 @@ index 9b955a027bd2c3cbcfa659a41a6687221c5fea63..6c036335b28258cd8c268173d73707af
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
index e638d982b4bd1d261a7282cad6dab98ad0b55213..e305173fd1652a8b88ae8a9b94d0fae083e2da95 100644
index 925f16d5eb092518ef774f69a8d99689feb0f5d7..01d8af06f19427354cac95d691e65d31253fef94 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
@@ -91,7 +91,7 @@ public class Turtle extends Animal {
@ -266,7 +266,7 @@ index e638d982b4bd1d261a7282cad6dab98ad0b55213..e305173fd1652a8b88ae8a9b94d0fae0
public BlockPos getHomePos() { // Paper - public
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 641f022c4c716e0441a098f4540fd008059a4b51..944b28b55a38352dfb49aeecca3f196502cb04e8 100644
index f3b100976a374cf9f1c3473788e9ff5b55f00ff5..3468c331208978f37dfed96b02be950e019f8a40 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1305,10 +1305,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -290,7 +290,7 @@ index 641f022c4c716e0441a098f4540fd008059a4b51..944b28b55a38352dfb49aeecca3f1965
public boolean noSave() {
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 f6b591f045ae992180806fd6aba309c0d04e722b..338e93a1855cf0e535e8a9897cffaff1d2e87279 100644
index a088cb005525fda2c9d5521ab3bac43cfa38a393..1782be43f1dbe2776abe5087d305e271c62285dd 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -568,6 +568,7 @@ public class LevelChunk implements ChunkAccess {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Jump API
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 02609533a9c8ae70d50fa81bd0e42af6aca2ee62..40e5324e19e91640ce39245d8d9f69850903f166 100644
index 13bb9c49847df699263977864dec52752ee4cf28..6f036c7e2fa26359cc850e30c6107180512f7e7b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3158,8 +3158,10 @@ public abstract class LivingEntity extends Entity {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index a69efd1a21a667c5eee539f6c761755479375527..8b460378d8c2dd1942404f332d4012acb5687773 100644
index 154866506a33cf2185891cd5051d51de9e2e4584..5ce5cdb4f6c703fa93f808527d2bca706d748c70 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -443,6 +443,11 @@ public class PaperWorldConfig {
@ -21,7 +21,7 @@ index a69efd1a21a667c5eee539f6c761755479375527..8b460378d8c2dd1942404f332d4012ac
private void lightQueueSize() {
lightQueueSize = getInt("light-queue-size", lightQueueSize);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b4694693814ca37ca33fef10bd87e05c228c9fa1..eb35b18f4875367723ed2e57f19fabca4360ed54 100644
index 1569ef6efd811c173dc421761f433152cca9f9ea..745d540572b901ae4a20dd13486d0bbc8aba9573 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -308,6 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n

View File

@ -5,7 +5,7 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4524d1af433750d763599dc990b8eda511ec0bad..60226f5c408ebd83c958d6644204bfc03365638a 100644
index 9a84ac5aa03c645037daec23cc4422106a6ace1d..8e4bd4818cf9d50dec7b94e5f1263086b6a6b86a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -339,13 +339,18 @@ public class CraftEventFactory {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9c5eba2cbd7399c8e3f8c5c3dad228ded6d57832..85a82c8bb98edec526260680ddfbcb36926b97ee 100644
index 58c5fd6518cf7a05725a840f6051ed0548eb1cd6..2e7b909750ee512dce40b8574dfb62ed68fbbfb6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1501,6 +1501,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add option to allow iron golems to spawn in air
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8b460378d8c2dd1942404f332d4012acb5687773..a2b1e2c3c4bd958b6ec7b7de5561747d3a2075d2 100644
index 5ce5cdb4f6c703fa93f808527d2bca706d748c70..fc1c65a4b3c3d5e52d967a3174d8373ddde95e4d 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -382,6 +382,11 @@ public class PaperWorldConfig {

View File

@ -8,7 +8,7 @@ faster on its own, however removing the try catch makes it
easier to inline due to code size
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 338e93a1855cf0e535e8a9897cffaff1d2e87279..a4398502dd0cbbceb00cffc68702d34bf8ed7e8f 100644
index 1782be43f1dbe2776abe5087d305e271c62285dd..30e3dc506ecf7430b4cc5d3ac51627da8de8b1ba 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -461,18 +461,20 @@ public class LevelChunk implements ChunkAccess {

View File

@ -889,7 +889,7 @@ index 0000000000000000000000000000000000000000..118988c39e58f28e8a2851792b9c014f
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 995d7977233f0d7683c00a75c3833f9a1eba7f92..58369d70bcd8b2c25609b6f101d9cbe2031df352 100644
index 8fff5580a88fd1643845967eb7bdab2630777e91..97faf7ece336928f22e518a14653b4fbc672d876 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -86,6 +86,19 @@ public class ChunkHolder {
@ -924,7 +924,7 @@ index 995d7977233f0d7683c00a75c3833f9a1eba7f92..58369d70bcd8b2c25609b6f101d9cbe2
});
// Paper end
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 56aa640eb0096e5c5f1a34d6f11a4dd9ac8770df..a81c773cc281ba390d3ce44c52c43710b43829a5 100644
index acb710c25a3b1a151a6dbf579a871529f077b70f..b0ff4a46807994e3afe4c8dc3810ecdd43b68025 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -220,6 +220,12 @@ public class ServerChunkCache extends ChunkSource {
@ -941,10 +941,10 @@ index 56aa640eb0096e5c5f1a34d6f11a4dd9ac8770df..a81c773cc281ba390d3ce44c52c43710
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureManager structureManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, boolean flag, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkstatusupdatelistener, Supplier<DimensionDataStorage> supplier) {
this.level = world;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 86ee1b535a6e586fd4e9e3c37f439d81b4508939..d037b14b34658e2f13d7e77f06576c406abc8a60 100644
index 69207f264d68e7181b8d3681ac18e0f9c5d74ec8..ee5d6c21f49749cfd40e81c2cdff72b0b3ed6fba 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -289,6 +289,15 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -295,6 +295,15 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
}
// Paper end
@ -960,7 +960,7 @@ index 86ee1b535a6e586fd4e9e3c37f439d81b4508939..d037b14b34658e2f13d7e77f06576c40
// Add env and gen to constructor, WorldData -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, ServerLevelData iworlddataserver, ResourceKey<net.minecraft.world.level.Level> resourcekey, DimensionType dimensionmanager, ChunkProgressListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@@ -305,13 +314,19 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -311,13 +320,19 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
DefaultedRegistry registryblocks = Registry.BLOCK;
Objects.requireNonNull(registryblocks);
@ -981,7 +981,7 @@ index 86ee1b535a6e586fd4e9e3c37f439d81b4508939..d037b14b34658e2f13d7e77f06576c40
this.navigatingMobs = new ObjectOpenHashSet();
this.blockEvents = new ObjectLinkedOpenHashSet();
this.dragonParts = new Int2ObjectOpenHashMap();
@@ -632,7 +647,9 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -638,7 +653,9 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
if (this.tickTime) {
long i = this.levelData.getGameTime() + 1L;

View File

@ -10,7 +10,7 @@ When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index c3f2cdedf7b9c2ff9e33b823cb20890cba0ded8a..8f1dcdb3b1beddb5698f596c048869d99e1f4437 100644
index 0c9aa7fb4d42c63c920a002050941299e3847d95..11a8b71fb3c7ba24f6e4986d241328ad369407c4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -430,10 +430,21 @@ public class PaperWorldConfig {
@ -36,7 +36,7 @@ index c3f2cdedf7b9c2ff9e33b823cb20890cba0ded8a..8f1dcdb3b1beddb5698f596c048869d9
private void entitiesTargetWithFollowRange() {
entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ec7804e80f9c6b0fc53eb67823c6325a685c850b..9e6d6db0782751895afe345b4d6f586389ec2392 100644
index e896224cec9eede23a890975888076bfe94f8a0a..6f976946f742b4139b01dfa692a901b15f02a836 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -214,6 +214,7 @@ public class ServerPlayer extends Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Do not allow bees to load chunks for beehives
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 50724baf5eb207ce44be62509f9a024d9a0e10f3..9b6dd82e5e6e4ba6290e1931c2e9756d93f323d8 100644
index 8e2ebb2ba724d94c5723d82affc01ccb264c95c5..2639f64f1a50faddc0284fb26b73b563b3e9eba9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -409,6 +409,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {

View File

@ -26,10 +26,10 @@ index ebcfe31c8395aa2bbcc9a9ac74d4c6e1f2e5d0f7..46976a0ef5098e6d794653078111a9dc
EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 70de3413da219cc79a86e39893abc3f6f658f729..ba58d33810916bb8c3ac649f1e6e41354d17cde0 100644
index ee5d6c21f49749cfd40e81c2cdff72b0b3ed6fba..5a73812bace35923bb4dbbfcf691427aa9eaa671 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2120,7 +2120,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -2126,7 +2126,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
@ -38,7 +38,7 @@ index 70de3413da219cc79a86e39893abc3f6f658f729..ba58d33810916bb8c3ac649f1e6e4135
if (entity instanceof ServerPlayer) {
ServerLevel.this.players.add((ServerPlayer) entity);
ServerLevel.this.updateSleepingPlayerList();
@@ -2142,6 +2142,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -2148,6 +2148,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
}
entity.valid = true; // CraftBukkit

View File

@ -26,7 +26,7 @@ index 2730923bd0bf3b0f928765b9e09e2299fa9a393d..f98a1c32e0c209473cf7268cbd8245ab
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index eb35b18f4875367723ed2e57f19fabca4360ed54..07630fabdc3e824572d7f551f3a876133fc253fe 100644
index 745d540572b901ae4a20dd13486d0bbc8aba9573..581f80c490932f66f57e7a91d8738e09521f5a1c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -172,6 +172,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n

View File

@ -7,7 +7,7 @@ Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 9e6d6db0782751895afe345b4d6f586389ec2392..8fc75890eb7342ff9339789434b031ef9a6a5000 100644
index 6f976946f742b4139b01dfa692a901b15f02a836..e4a5b89a12c52ccca4f72823e8d7a5d5a689ff16 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -638,7 +638,7 @@ public class ServerPlayer extends Player {

View File

@ -7,7 +7,7 @@ This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
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 4c9261c68518ab7429325f0366dfb2930663288c..a3d31cec6d1b8de700b6cd2f7f51398debef5b6d 100644
index 857346b755454956268cc594bb03dc060f2a4aac..1b47cf893174a64dcbf3771738b6c6d443c193af 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1106,7 +1106,7 @@ public abstract class Player extends LivingEntity {

View File

@ -233,10 +233,10 @@ index 46976a0ef5098e6d794653078111a9dcc1a151d2..1e366262306aedcd4b3236a6895d30fb
while (objectbidirectionaliterator.hasNext()) {
Entry<ChunkHolder> entry = (Entry) objectbidirectionaliterator.next();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 20a99b62b3466e4853e8d23576133dc728f7927f..302313f72b27fc4c58399c8c2d0bb3bf0cb1f8ab 100644
index b0ff4a46807994e3afe4c8dc3810ecdd43b68025..d8cd652f76232b43b104b11247682288e99d9521 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -766,7 +766,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -767,7 +767,7 @@ public class ServerChunkCache extends ChunkSource {
};
// Paper end
this.level.timings.chunkTicks.startTiming(); // Paper

View File

@ -147,10 +147,10 @@ index 494a3afaaa0e3496d30e8d97edbab62b21610dfe..fa3a9d763f7072c68b126ce95fee191a
// Spigot Start
CrashReport crashreport;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d2140a16b1e 100644
index d8cd652f76232b43b104b11247682288e99d9521..b464db85829f2f97926791056b339b937e25ed03 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -703,6 +703,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -704,6 +704,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().push("purge");
this.level.timings.doChunkMap.startTiming(); // Spigot
this.distanceManager.purgeStaleTickets();
@ -158,7 +158,7 @@ index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d21
this.runDistanceManagerUpdates();
this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks");
@@ -712,6 +713,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -713,6 +714,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.doChunkUnload.startTiming(); // Spigot
this.level.getProfiler().popPush("unload");
this.chunkMap.tick(booleansupplier);
@ -166,7 +166,7 @@ index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d21
this.level.timings.doChunkUnload.stopTiming(); // Spigot
this.level.getProfiler().pop();
this.clearCache();
@@ -766,7 +768,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -767,7 +769,7 @@ public class ServerChunkCache extends ChunkSource {
};
// Paper end
this.level.timings.chunkTicks.startTiming(); // Paper
@ -175,7 +175,7 @@ index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d21
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
if (optional.isPresent()) {
@@ -783,6 +785,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -784,6 +786,7 @@ public class ServerChunkCache extends ChunkSource {
chunk.setInhabitedTime(chunk.getInhabitedTime() + j);
if (flag1 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunk.getPos()) && !this.chunkMap.isOutsideOfRange(chunkcoordintpair, true)) { // Spigot
NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag2);
@ -183,7 +183,7 @@ index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d21
}
// this.level.timings.doTickTiles.startTiming(); // Spigot // Paper
@@ -950,6 +953,41 @@ public class ServerChunkCache extends ChunkSource {
@@ -951,6 +954,41 @@ public class ServerChunkCache extends ChunkSource {
super.doRunTask(task);
}
@ -226,10 +226,10 @@ index 34183527a23650706a9249ffac0182cb77b18086..90decfade57b2f17cdcc9188962c2d21
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9cdfd1c8bce3adb5d3ad6d970c6f46ca75f3a952..70106dda486d685dffafc0d4b3ae95b4861c6342 100644
index 5a73812bace35923bb4dbbfcf691427aa9eaa671..2188666675192cb02e0bccf845cf7863486a305b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -581,6 +581,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -587,6 +587,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
}
timings.scheduledBlocks.stopTiming(); // Paper
@ -237,7 +237,7 @@ index 9cdfd1c8bce3adb5d3ad6d970c6f46ca75f3a952..70106dda486d685dffafc0d4b3ae95b4
gameprofilerfiller.popPush("raid");
this.timings.raids.startTiming(); // Paper - timings
this.raids.tick();
@@ -589,6 +590,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -595,6 +596,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
timings.doSounds.startTiming(); // Spigot
this.runBlockEvents();
timings.doSounds.stopTiming(); // Spigot
@ -245,7 +245,7 @@ index 9cdfd1c8bce3adb5d3ad6d970c6f46ca75f3a952..70106dda486d685dffafc0d4b3ae95b4
this.handlingTick = false;
gameprofilerfiller.pop();
boolean flag3 = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
@@ -635,10 +637,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -641,10 +643,12 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
timings.entityTick.stopTiming(); // Spigot
timings.tickEntities.stopTiming(); // Spigot
gameprofilerfiller.pop();

View File

@ -262,7 +262,7 @@ index 0511f1921193b78cbf4d8426136bf1f79746f955..e5f7f043cbdb28d85b8aa0eea7cbaeb5
@Override
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index a80c4517cd0d2c5e7b71b4f86b6a8d441a9eb64e..3994cefe74481efd5d779f22c752aadc22b4749b 100644
index 1e366262306aedcd4b3236a6895d30fb35e3cc51..196c0722c15b169cecde139ddd75689298c80949 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -606,6 +606,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -287,7 +287,7 @@ index 18485689bcbf7818c3ca5b82086acef51888603b..3431d28fd69c634ee0a941796308b88b
// Paper start - Remove from collideRule team if needed
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
index 0ef3c4982df88a7991a56d983ac733daa8adc507..cdd797c6fc7507a0e6376f7d9c521be8f1d6decc 100644
index 7bf4bf5cb2c1b54a7e2733091f48f3a824336d36..dcce05d2f4ab16424db4ab103a12188e207a457b 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -148,6 +148,7 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
@ -299,7 +299,7 @@ index 0ef3c4982df88a7991a56d983ac733daa8adc507..cdd797c6fc7507a0e6376f7d9c521be8
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 944b28b55a38352dfb49aeecca3f196502cb04e8..54fcdcef2a6b68e4b4f4c6a090e84919fe76b073 100644
index 3468c331208978f37dfed96b02be950e019f8a40..668d6256df12888a5a15109365d9a4f1d004d9d6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -842,6 +842,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@ -311,7 +311,7 @@ index 944b28b55a38352dfb49aeecca3f196502cb04e8..54fcdcef2a6b68e4b4f4c6a090e84919
String msg = "Entity threw exception at " + entity.level.getWorld().getName() + ":" + entity.getX() + "," + entity.getY() + "," + entity.getZ();
System.err.println(msg);
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 a4398502dd0cbbceb00cffc68702d34bf8ed7e8f..bde00ca058f32eb55e940614f0fbc361fe3a501d 100644
index 30e3dc506ecf7430b4cc5d3ac51627da8de8b1ba..be5dfaa7259e5415e3ccbefdc2eae402fe2aebe0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1320,6 +1320,7 @@ public class LevelChunk implements ChunkAccess {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent opening inventories when frozen
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 58da115a0c2f34c63ae3614acb0d6f8711069e7b..37fcc83cbaf8e80809c994b18f5a7f3f6d807202 100644
index 10489f6f76c1ac64365b677acda43efe640093c6..c8adcdbb8075ab8a1645c4dd809f7de31ad13d34 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -609,7 +609,7 @@ public class ServerPlayer extends Player {

View File

@ -7,7 +7,7 @@ Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 40e5324e19e91640ce39245d8d9f69850903f166..6d5323acfe22bb6fa8c84ef7ff32fdfc2e4d5f9c 100644
index 6f036c7e2fa26359cc850e30c6107180512f7e7b..919f230c7ebe3707e9517e2b733db0b57b7853de 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3255,10 +3255,16 @@ public abstract class LivingEntity extends Entity {

View File

@ -25,7 +25,7 @@ This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3994cefe74481efd5d779f22c752aadc22b4749b..dede8863193423858f6d60cc942919e52f28b607 100644
index 196c0722c15b169cecde139ddd75689298c80949..874b7d4947d452c64b7a2f37c3091ba7aed18c4d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -190,6 +190,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -46,10 +46,10 @@ index 3994cefe74481efd5d779f22c752aadc22b4749b..dede8863193423858f6d60cc942919e5
completablefuture1.thenAcceptAsync((either) -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 90decfade57b2f17cdcc9188962c2d2140a16b1e..60cdb1f5c3f329b417f340f1d2651d89c244e439 100644
index b464db85829f2f97926791056b339b937e25ed03..c8c873f9e7fd1a8ea2d32f37be6d221408b7687d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -1000,6 +1000,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -1001,6 +1001,7 @@ public class ServerChunkCache extends ChunkSource {
return super.pollTask() || execChunkTask; // Paper
}
} finally {

View File

@ -7,7 +7,7 @@ The code following this has better support for null worlds to move
them back to the world spawn.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e9f7191fefa7c0cf33d56abb7b2a30df261a392c..250a9b5cd47114aa4743f9695dadec2ad485f99d 100644
index 20f861c99b11844849d75ce4606abee80da147de..5ed88a5b233267aef1c7b12fe994262efc3c9dc2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1980,9 +1980,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6d5323acfe22bb6fa8c84ef7ff32fdfc2e4d5f9c..be3fd03803bef6de0a4667b1794e73287288feb7 100644
index 919f230c7ebe3707e9517e2b733db0b57b7853de..88e289cbd8bbf06bd7d7a911b990c4c780232ac4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2032,7 +2032,16 @@ public abstract class LivingEntity extends Entity {

View File

@ -14,7 +14,7 @@ Use an ArrayDeque to store this Queue
We make sure to also implement a pattern that is recursion safe too.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4fe5b75661de64474698495776ebb8232fd252aa..3e45ddc39d1283661cbfc1057aa0548d940a444a 100644
index b64a3dd03a22542b070eae34f0eaa9b321dca4ec..218a20e85c9b6d31bcdf5432f4ea9cf0c0d7b952 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -173,17 +173,29 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add phantom creative and insomniac controls
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8f1dcdb3b1beddb5698f596c048869d99e1f4437..98416de3dfc9d16d17124902e19cbd9b916077d2 100644
index 11a8b71fb3c7ba24f6e4986d241328ad369407c4..5fd9490f57109235d5eae0c0d51831646ee6cdc5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -474,6 +474,13 @@ public class PaperWorldConfig {
@ -35,7 +35,7 @@ index d17b75ad13bbc8a38cdc2f2d77ee5d88438cec31..8fb89326395a7e70982c0d757b506565
private EntitySelector() {}
// Paper start
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index 2ddb7b4c0a75c6f41910c84c8b9341f56fcb1116..941f86b04fedaf1e3f5d04c9aa8c1cd74da9b7a2 100644
index f69ad3b2f19a71f1e4a1a8fb37ac63df78548871..2257391ad42219efda0b6a11f1ca0f66e377e412 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -547,6 +547,7 @@ public class Phantom extends FlyingMob implements Enemy {

View File

@ -16,7 +16,7 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 250a9b5cd47114aa4743f9695dadec2ad485f99d..c6e659cd766facba6411e930d3ae1d2143c2f269 100644
index 5ed88a5b233267aef1c7b12fe994262efc3c9dc2..83dc25cfc557cd79e3e0596d9cb319bb9dafb126 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2126,11 +2126,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@ -80,7 +80,7 @@ index 250a9b5cd47114aa4743f9695dadec2ad485f99d..c6e659cd766facba6411e930d3ae1d21
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index cb9969d768b13863722aad3dc5daad3c10bb264a..5bfec185e15a54ee5fe6eab1aa59d1963d046262 100644
index bbde9b758643c087733064a126d90689d71830cf..069cdfce085909991a69ebec3004d407526d469d 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -611,7 +611,7 @@ public class ArmorStand extends LivingEntity {
@ -102,7 +102,7 @@ index cb9969d768b13863722aad3dc5daad3c10bb264a..5bfec185e15a54ee5fe6eab1aa59d196
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 60226f5c408ebd83c958d6644204bfc03365638a..19724497e407c93f738c3bfaec72997dd5fe7ba1 100644
index 8e4bd4818cf9d50dec7b94e5f1263086b6a6b86a..09c152123d055432266bbb5a1434c21aed64da1f 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -807,7 +807,8 @@ public class CraftEventFactory {

View File

@ -81,7 +81,7 @@ index 13e358e0eac3bfd426d924b6f745e001df76c64a..7156dea53be828acd01734fa1f9f7b9a
event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 10e4be89803bcdcc8bf7ce64350464c826368ae7..33dfa5a72974f952a08ef9022b8158629a40a153 100644
index 0d8a8b3d7a13e2384f8614bdc190768c03bb98c2..776d2d663dcbdd935a7ed7927618e2be68a562c4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -760,8 +760,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 33dfa5a72974f952a08ef9022b8158629a40a153..1aa260504c9ff022a32ffbb770c8d133bbd68cfc 100644
index 776d2d663dcbdd935a7ed7927618e2be68a562c4..7e4e2174665eaf0277c0b547fe6c9e05fdf59c81 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -877,7 +877,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -18,7 +18,7 @@ index 11fd6d24ed0612e4df1a0493907178fb9c455d1c..d7023cb0974f6c28a0fb8a0a6e5a6600
return initialDistance;
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3e45ddc39d1283661cbfc1057aa0548d940a444a..f4a31d340ea9629dea70eec4e339cfd869a73ed9 100644
index 218a20e85c9b6d31bcdf5432f4ea9cf0c0d7b952..31eabc0260750ab1bf1618fcf666f10fb3e0a877 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -58,6 +58,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
@ -312,7 +312,7 @@ index 28afe2f238ded241acf77c3272a44068646b9133..6b492b72b177e3c58580561585609b17
List<Entity> list = this.entity.getPassengers();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c6e659cd766facba6411e930d3ae1d2143c2f269..57d8b712cbdcc1ff082e9313d50dedafa239f50e 100644
index 83dc25cfc557cd79e3e0596d9cb319bb9dafb126..b2a53fde2ba0316c33a4bfc58020849d5db02b51 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -50,6 +50,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Optimize isOutsideRange to use distance maps
Use a distance map to find the players in range quickly
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 58369d70bcd8b2c25609b6f101d9cbe2031df352..969b0c9cf6d7eb2055d3b804f25a3cbc161ceaea 100644
index 97faf7ece336928f22e518a14653b4fbc672d876..c2401b2ff0547335ddbbeb05c07b74552c246fc9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -100,6 +100,18 @@ public class ChunkHolder {
@ -37,7 +37,7 @@ index 58369d70bcd8b2c25609b6f101d9cbe2031df352..969b0c9cf6d7eb2055d3b804f25a3cbc
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index f4a31d340ea9629dea70eec4e339cfd869a73ed9..450ab55859304ecda6f752b0e4a04279f4104af1 100644
index 31eabc0260750ab1bf1618fcf666f10fb3e0a877..bb00445ecf50051cf3966ee10be645e2a0d2519e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -236,6 +236,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -291,10 +291,10 @@ index b49d380ef088aed3204ec71abc437c348ef004fa..577b391dcba1db712c1e2c83296e1c87
public String getDebugStatus() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 3d1c4f8e0db37c6dabece657a17595e7bf1e3dc2..3faa808f41f057a9956c697ec1323330f5920b86 100644
index c8c873f9e7fd1a8ea2d32f37be6d221408b7687d..e46ccbca0cfa63dd5143080375193a95a9249d60 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -729,6 +729,37 @@ public class ServerChunkCache extends ChunkSource {
@@ -730,6 +730,37 @@ public class ServerChunkCache extends ChunkSource {
boolean flag1 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
if (!flag) {
@ -332,7 +332,7 @@ index 3d1c4f8e0db37c6dabece657a17595e7bf1e3dc2..3faa808f41f057a9956c697ec1323330
this.level.getProfiler().push("pollingChunks");
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
boolean flag2 = level.ticksPerAnimalSpawns != 0L && worlddata.getGameTime() % level.ticksPerAnimalSpawns == 0L; // CraftBukkit
@@ -758,15 +789,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -759,15 +790,7 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().pop();
//List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
//Collections.shuffle(list); // Paper
@ -349,7 +349,7 @@ index 3d1c4f8e0db37c6dabece657a17595e7bf1e3dc2..3faa808f41f057a9956c697ec1323330
this.level.timings.chunkTicks.startTiming(); // Paper
final int[] chunksTicked = {0}; this.chunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
@@ -781,9 +804,9 @@ public class ServerChunkCache extends ChunkSource {
@@ -782,9 +805,9 @@ public class ServerChunkCache extends ChunkSource {
this.level.getProfiler().pop();
ChunkPos chunkcoordintpair = chunk.getPos();
@ -362,7 +362,7 @@ index 3d1c4f8e0db37c6dabece657a17595e7bf1e3dc2..3faa808f41f057a9956c697ec1323330
if (chunksTicked[0]++ % 10 == 0) this.level.getServer().midTickLoadChunks(); // Paper
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 61f9eda59684c08884c4a621effb1705db592a53..a01227f1b6d3589a6f56c9289824a1503a32c878 100644
index f0d574307b24d19d3006e5c53b650c75436bde38..d59e707f28a5f04545208ad33d122fc433b85933 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -244,6 +244,7 @@ public class ServerPlayer extends Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Option for maximum exp value when merging orbs
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 98416de3dfc9d16d17124902e19cbd9b916077d2..b10de4e99913030bae7451b3242067312e94df7e 100644
index 5fd9490f57109235d5eae0c0d51831646ee6cdc5..0fbddcb318e353b54c68dd543355be698e99c2d7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -356,6 +356,12 @@ public class PaperWorldConfig {
@ -22,7 +22,7 @@ index 98416de3dfc9d16d17124902e19cbd9b916077d2..b10de4e99913030bae7451b324206731
private void squidMaxSpawnHeight() {
squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 19724497e407c93f738c3bfaec72997dd5fe7ba1..4ad9dae575ea55b422e7b03b7eaf341ac0796d2c 100644
index 09c152123d055432266bbb5a1434c21aed64da1f..7b59cfc35968a82c5db78c5107b175d994df3535 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -610,16 +610,30 @@ public class CraftEventFactory {

View File

@ -9,7 +9,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4ad9dae575ea55b422e7b03b7eaf341ac0796d2c..e508f75158423e8c4a59af18a094dfa36b9c180c 100644
index 7b59cfc35968a82c5db78c5107b175d994df3535..1ee76da3b609bf91e9e8529eb402d670b32e4b18 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -620,7 +620,7 @@ public class CraftEventFactory {

View File

@ -56,7 +56,7 @@ index cdf214fca3b0055efa56702470d9d2f890a8aead..a12af10e28f2d023ba6f916b5e7a5353
this.level.getProfiler().push("explosion_blocks");
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 54fcdcef2a6b68e4b4f4c6a090e84919fe76b073..f004f5012ce157f9b0fb9c5890b5f3de957418f8 100644
index 668d6256df12888a5a15109365d9a4f1d004d9d6..d9697003d05ddc344207793b4f266743fcaef16c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -424,6 +424,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 450ab55859304ecda6f752b0e4a04279f4104af1..f722d9e77fa074847a2bdc6a117816d176eb6dca 100644
index bb00445ecf50051cf3966ee10be645e2a0d2519e..57b95c9e85d2341c00d54cacd71a8784cad3e5e7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -2101,9 +2101,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially

View File

@ -17,7 +17,7 @@ This allows servers with smaller worlds who do less long distance exploring to s
wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b10de4e99913030bae7451b3242067312e94df7e..d2b1ef727004906d184995a840657e22ea127f71 100644
index 0fbddcb318e353b54c68dd543355be698e99c2d7..1bfa826d36a2e4b72a4b97fc6d4731fac8bf199f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -492,6 +492,15 @@ public class PaperWorldConfig {

View File

@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot
operations faster
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index dd1d76867ac3832ad515f304925c595c9a021c8f..fd5c22a3d281d8d913c353c8a668ec51b885066a 100644
index 86618513e8f777d1d738b230c97eb527ddce7c26..8f0cf4297015f3cbe709e2eb82280cac72489925 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -30,15 +30,16 @@ public class BlockPos extends Vec3i {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] incremental chunk saving
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index d2b1ef727004906d184995a840657e22ea127f71..040956f5d714ac014f9a153981d444db299fd826 100644
index 1bfa826d36a2e4b72a4b97fc6d4731fac8bf199f..a22abda177b0ffc9699fb23aaac8680261f385fe 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -44,6 +44,21 @@ public class PaperWorldConfig {
@ -72,7 +72,7 @@ index 11dbe48c8a8c29cd28d725c43505e326a6e626ff..363dcebb3b2d5a2512776a191f6716ed
this.profiler.push("snooper");
if (((DedicatedServer) this).getProperties().snooperEnabled && !this.snooper.isStarted() && this.tickCount > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 969b0c9cf6d7eb2055d3b804f25a3cbc161ceaea..1f67c9c5f7161ea687983e7ae0ec7d259da9acd3 100644
index c2401b2ff0547335ddbbeb05c07b74552c246fc9..c1db5cc45dbc7dd24a1ef4dbf88a8efb6c7f2d57 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -111,6 +111,8 @@ public class ChunkHolder {
@ -139,7 +139,7 @@ index 969b0c9cf6d7eb2055d3b804f25a3cbc161ceaea..1f67c9c5f7161ea687983e7ae0ec7d25
for (int i = 0; i < this.futures.length(); ++i) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index f722d9e77fa074847a2bdc6a117816d176eb6dca..8982823efd8fd21d403c6c6fb158d57a9da67707 100644
index 57b95c9e85d2341c00d54cacd71a8784cad3e5e7..89f73e8a7f5b429c89d051b44ea6c9cbecb97730 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -92,6 +92,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
@ -240,10 +240,10 @@ index f722d9e77fa074847a2bdc6a117816d176eb6dca..8982823efd8fd21d403c6c6fb158d57a
ChunkPos chunkcoordintpair = chunk.getPos();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 3faa808f41f057a9956c697ec1323330f5920b86..7ab28e9bd3f785838b7fa4ac5811c0e71cddcb61 100644
index e46ccbca0cfa63dd5143080375193a95a9249d60..094c07c3208b0c05f918b7ee19f1d5b9ceeece47 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -671,6 +671,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -672,6 +672,15 @@ public class ServerChunkCache extends ChunkSource {
} // Paper - Timings
}
@ -260,10 +260,10 @@ index 3faa808f41f057a9956c697ec1323330f5920b86..7ab28e9bd3f785838b7fa4ac5811c0e7
public void close() throws IOException {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 70106dda486d685dffafc0d4b3ae95b4861c6342..74753639ed095eab305c2facd0f00264a6253cef 100644
index 2188666675192cb02e0bccf845cf7863486a305b..225823ef8bb4171f770f90f083689850aa6a171e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1017,6 +1017,38 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
@@ -1023,6 +1023,38 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@ -303,7 +303,7 @@ index 70106dda486d685dffafc0d4b3ae95b4861c6342..74753639ed095eab305c2facd0f00264
ServerChunkCache chunkproviderserver = this.getChunkSource();
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index 91f5106cfe7914389b52a1ed001117b13e4f9768..31ea618547e0e452f9a495796a4197e718abbfa6 100644
index a857953f3488e79fd601ac63881bc4d87708afa7..3cf3b0486f786d7d043cce75767753e1cdacf781 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -29,6 +29,7 @@ public interface ChunkAccess extends BlockGetter, FeatureAccess {
@ -315,7 +315,7 @@ index 91f5106cfe7914389b52a1ed001117b13e4f9768..31ea618547e0e452f9a495796a4197e7
default boolean generateFlatBedrock() {
if (this instanceof ProtoChunk) {
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 bde00ca058f32eb55e940614f0fbc361fe3a501d..fe46fdb828d630f9dc9b212128608203f6c6f4bb 100644
index be5dfaa7259e5415e3ccbefdc2eae402fe2aebe0..6d7c90b3f41a2e5a1514fa32e1e088f5be9cb90d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -108,6 +108,13 @@ public class LevelChunk implements ChunkAccess {

View File

@ -14,7 +14,7 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1aa260504c9ff022a32ffbb770c8d133bbd68cfc..72d8936660f2f6c43e4f6c220b60eef20ac2d055 100644
index 7e4e2174665eaf0277c0b547fe6c9e05fdf59c81..3493fb7f526cb713340475734f176aa52ade2d12 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1345,6 +1345,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 72d8936660f2f6c43e4f6c220b60eef20ac2d055..8c182e3e4f81a6fc6554e8014e30c0cecf91cf5c 100644
index 3493fb7f526cb713340475734f176aa52ade2d12..ff0cb2ca36f052c55f2bd37b74c33b2192a03873 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2778,9 +2778,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -18,7 +18,7 @@ index a695e5a0c2e8846333ccb9aea499b5656af35163..c21c5134308a2a83fb50bfe37f05d19c
return false;
} else if (this.player.blockActionRestricted((Level) this.level, pos, this.gameModeForPlayer)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8c182e3e4f81a6fc6554e8014e30c0cecf91cf5c..2011ef91d026117be267cc3ea84d49a3288dd9ca 100644
index ff0cb2ca36f052c55f2bd37b74c33b2192a03873..56e93709ce955a7c65dc2b058b5b8b8a646d1775 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -788,7 +788,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 57d8b712cbdcc1ff082e9313d50dedafa239f50e..13b6cf4b3d5af77263051a5b17fa2b9da9803596 100644
index b2a53fde2ba0316c33a4bfc58020849d5db02b51..9d08ebbbf2f3ff710022fb3ef1fce802a15f1b4e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -540,7 +540,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 13b6cf4b3d5af77263051a5b17fa2b9da9803596..28f9b58c379306138f1528d91f2112c21ae9cb0a 100644
index 9d08ebbbf2f3ff710022fb3ef1fce802a15f1b4e..d961faf2609ef820d27837b8f0bf6382f9ce97b6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1024,7 +1024,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n

View File

@ -63,7 +63,7 @@ index e5f7f043cbdb28d85b8aa0eea7cbaeb584e5fb85..a5c1114f9b323e8a49c84d0e68461e47
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2011ef91d026117be267cc3ea84d49a3288dd9ca..c4a25ac9aad94c5ef610505db6d7539fa12cd31d 100644
index 56e93709ce955a7c65dc2b058b5b8b8a646d1775..fecb2a6b8674ca110d6af539396873e9dcdc0edb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3041,7 +3041,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Paper dumpitem command
Let's you quickly view the item in your hands NBT data
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..1700681197ca2ff47ea1618b06d811aa4f06ac7d 100644
index de45163023f436d386e90e6ded5e6105ba3ecf35..8fdfcf001cf2ed6184d86ee033ede08fdf9aa5d6 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -14,6 +14,7 @@ import net.minecraft.server.level.ServerPlayer;
@@ -20,6 +20,7 @@ import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.ThreadedLevelLightEngine;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.ChunkPos;
@ -17,7 +17,7 @@ index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..1700681197ca2ff47ea1618b06d811aa
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MCUtil;
import org.apache.commons.lang3.tuple.MutablePair;
@@ -27,7 +28,9 @@ import org.bukkit.command.CommandSender;
@@ -33,7 +34,9 @@ import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
@ -26,17 +26,17 @@ index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..1700681197ca2ff47ea1618b06d811aa
+import org.bukkit.inventory.ItemStack;
import java.io.File;
import java.time.LocalDateTime;
@@ -47,7 +50,7 @@ import java.util.stream.Collectors;
import java.io.FileOutputStream;
@@ -56,7 +59,7 @@ import java.util.stream.Collectors;
public class PaperCommand extends Command {
private static final String BASE_PERM = "bukkit.command.paper.";
- private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight").build();
+ private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight", "dumpitem").build();
- private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight", "syncloadinfo").build();
+ private static final ImmutableSet<String> SUBCOMMANDS = ImmutableSet.<String>builder().add("heap", "entity", "reload", "version", "debug", "chunkinfo", "fixlight", "syncloadinfo", "dumpitem").build();
public PaperCommand(String name) {
super(name);
@@ -156,6 +159,9 @@ public class PaperCommand extends Command {
@@ -165,6 +168,9 @@ public class PaperCommand extends Command {
case "reload":
doReload(sender);
break;
@ -46,7 +46,7 @@ index 7b5afc5d34b78e6404c1a5c6bb823d9589471f13..1700681197ca2ff47ea1618b06d811aa
case "debug":
doDebug(sender, args);
break;
@@ -420,6 +426,19 @@ public class PaperCommand extends Command {
@@ -466,6 +472,19 @@ public class PaperCommand extends Command {
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Paper config reload complete.");
}

Some files were not shown because too many files have changed in this diff Show More