Updated Upstream (Bukkit/CraftBukkit/Spigot) (#4659)
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 01e22e09 Misc maven build updates 746f5324 #556: Allow sending messages from specific UUIDs 92b99cde #501: Add PersistentDataHolder to Chunk CraftBukkit Changes: 4ef13f94 Misc maven build updates 04639f5a #759: Allow sending messages from specific UUIDs 77c894a2 #672: Add PersistentDataHolder to Chunk Spigot Changes: 57bbdd8e Rebuild patches Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
This commit is contained in:
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chun
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Chunk.java
|
||||
+++ b/src/main/java/org/bukkit/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public interface Chunk {
|
||||
@@ -0,0 +0,0 @@ public interface Chunk extends PersistentDataHolder {
|
||||
@NotNull
|
||||
Entity[] getEntities();
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chun
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Chunk.java
|
||||
+++ b/src/main/java/org/bukkit/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public interface Chunk {
|
||||
@@ -0,0 +0,0 @@ public interface Chunk extends PersistentDataHolder {
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
|
||||
@ -1891,6 +1891,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.command.RemoteConsoleCommandSender;
|
||||
+
|
||||
+import java.util.List;
|
||||
+import java.util.UUID;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
@ -2942,7 +2944,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.plugin.Plugin;
|
||||
+
|
||||
+import java.util.Set;
|
||||
+import java.util.UUID;
|
||||
+
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * For when all you care about is just messaging
|
||||
@ -2956,6 +2961,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ default void sendMessage(@Nullable UUID sender, @NotNull String message) {
|
||||
+ sendMessage(message);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ default void sendMessage(@Nullable UUID sender, @NotNull String[] messages) {
|
||||
+ for (String message : messages) {
|
||||
+ sendMessage(message);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ default Server getServer() {
|
||||
|
||||
@ -1014,7 +1014,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
chunksection.getBlocks().a(nbttagcompound2.getList("Palette", 10), nbttagcompound2.getLongArray("BlockStates"));
|
||||
chunksection.recalcBlockCounts();
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader {
|
||||
loadEntities(nbttagcompound1, chunk);
|
||||
// CraftBukkit end
|
||||
});
|
||||
} else {
|
||||
- ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1);
|
||||
|
||||
@ -2688,9 +2688,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- for (int i = -1; i < 17; ++i) {
|
||||
+ for (int i = -1; i < 17; ++i) { // Paper - conflict on loop parameter change
|
||||
int finalI = i;
|
||||
int finalI = i; // CraftBukkit - decompile errors
|
||||
ChunkSection chunksection = (ChunkSection) Arrays.stream(achunksection).filter((chunksection1) -> {
|
||||
return chunksection1 != null && chunksection1.getYPosition() >> 4 == finalI;
|
||||
return chunksection1 != null && chunksection1.getYPosition() >> 4 == finalI; // CraftBukkit - decompile errors
|
||||
}).findFirst().orElse(Chunk.a);
|
||||
- NibbleArray nibblearray = lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i));
|
||||
- NibbleArray nibblearray1 = lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i));
|
||||
|
||||
@ -25,9 +25,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, (chunk) -> {
|
||||
- loadEntities(nbttagcompound1, chunk);
|
||||
- // CraftBukkit start - load chunk persistent data from nbt
|
||||
- NBTTagCompound persistentBase = nbttagcompound1.getCompound("BukkitValues");
|
||||
- if (persistentBase != null) {
|
||||
- chunk.persistentDataContainer.putAll(nbttagcompound1);
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
- });
|
||||
+ object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, // Paper start - fix massive nbt memory leak due to lambda. move lambda into a container method to not leak scope. Only clone needed NBT keys.
|
||||
+ createLoadEntitiesConsumer(new SafeNBTCopy(nbttagcompound1, "TileEntities", "Entities"))
|
||||
+ createLoadEntitiesConsumer(new SafeNBTCopy(nbttagcompound1, "TileEntities", "Entities", "BukkitValues")) // Paper - move CB Chunk PDC into here
|
||||
+ );// Paper end
|
||||
} else {
|
||||
ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray - Add parameter
|
||||
@ -64,7 +70,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+ private static java.util.function.Consumer<Chunk> createLoadEntitiesConsumer(NBTTagCompound nbt) {
|
||||
+ return (chunk) -> loadEntities(nbt, chunk);
|
||||
+ return (chunk) -> {
|
||||
+ loadEntities(nbt, chunk);
|
||||
+ // CraftBukkit start - load chunk persistent data from nbt
|
||||
+ NBTBase persistentBase = nbt.get("BukkitValues"); // Paper - use NBTBase & #get
|
||||
+ if (persistentBase instanceof NBTTagCompound) { // Paper - instanceof to check nullability & type; previous was if(true)
|
||||
+ chunk.persistentDataContainer.putAll((NBTTagCompound) persistentBase); // Paper
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ };
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
|
||||
@ -2442,7 +2442,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
|
||||
int j = aheightmap_type.length;
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
public boolean needsDecoration;
|
||||
public final org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
|
||||
// CraftBukkit end
|
||||
|
||||
+ // Paper start
|
||||
|
||||
Submodule work/Bukkit updated: 9165c3c0b0...01e22e0972
Submodule work/CraftBukkit updated: 055870c4bc...4ef13f94d6
Submodule work/Spigot updated: 988b41197d...57bbdd8eb7
Reference in New Issue
Block a user