mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 7f89e96 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6209)
This commit is contained in:
@@ -16391,7 +16391,7 @@ index 8245c5834ec69beb8e3b95fb3900601009a9273f..88f30cd8e57ccb69da633daac49f8bc9
|
||||
@Override
|
||||
public BlockEntity getBlockEntity(BlockPos pos) {
|
||||
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 cc02b577453fa251f0f1b508281ddea2513138a1..54e23d303aad286ab46c3e5f9b17a5f9922e2942 100644
|
||||
index a84b75a53a0324fab9aeb9b80bf74eb0a84ecd2e..4f6a356e3a27915f1d95132a0a5fddb163735cf6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -1,5 +1,7 @@
|
||||
@@ -16652,7 +16652,7 @@ index cc02b577453fa251f0f1b508281ddea2513138a1..54e23d303aad286ab46c3e5f9b17a5f9
|
||||
Iterator iterator = protoChunk.getBlockEntities().values().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -788,6 +920,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
@@ -794,6 +926,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
|
||||
// CraftBukkit start
|
||||
public void loadCallback() {
|
||||
@@ -16660,7 +16660,7 @@ index cc02b577453fa251f0f1b508281ddea2513138a1..54e23d303aad286ab46c3e5f9b17a5f9
|
||||
// Paper start - neighbour cache
|
||||
int chunkX = this.chunkPos.x;
|
||||
int chunkZ = this.chunkPos.z;
|
||||
@@ -807,6 +940,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
@@ -813,6 +946,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
// Paper end - neighbour cache
|
||||
org.bukkit.Server server = this.level.getCraftServer();
|
||||
this.level.getChunkSource().addLoadedChunk(this); // Paper
|
||||
@@ -16668,7 +16668,7 @@ index cc02b577453fa251f0f1b508281ddea2513138a1..54e23d303aad286ab46c3e5f9b17a5f9
|
||||
if (server != null) {
|
||||
/*
|
||||
* If it's a new world, the first few chunks are generated inside
|
||||
@@ -842,6 +976,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
@@ -848,6 +982,7 @@ public class LevelChunk implements ChunkAccess {
|
||||
}
|
||||
|
||||
public void unloadCallback() {
|
||||
@@ -18639,10 +18639,10 @@ index dd435909ad16a7f732fd0a2056f986dd9b24c0d5..f243dbdf7673c06b0e2d36fe9af43234
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648efe082ee7 100644
|
||||
index 7dc26321e20e26821096e79356a358879306cd78..2e79e2a23a4aec4b526814f7e959232c0a074860 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -289,7 +289,7 @@ public class CraftWorld implements World {
|
||||
@@ -290,7 +290,7 @@ public class CraftWorld implements World {
|
||||
public int getTileEntityCount() {
|
||||
return net.minecraft.server.MCUtil.ensureMain(() -> {
|
||||
// We don't use the full world tile entity list, so we must iterate chunks
|
||||
@@ -18651,7 +18651,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
int size = 0;
|
||||
for (ChunkHolder playerchunk : chunks.values()) {
|
||||
net.minecraft.world.level.chunk.LevelChunk chunk = playerchunk.getTickingChunk();
|
||||
@@ -312,7 +312,7 @@ public class CraftWorld implements World {
|
||||
@@ -313,7 +313,7 @@ public class CraftWorld implements World {
|
||||
return net.minecraft.server.MCUtil.ensureMain(() -> {
|
||||
int ret = 0;
|
||||
|
||||
@@ -18660,7 +18660,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
if (chunkHolder.getTickingChunk() != null) {
|
||||
++ret;
|
||||
}
|
||||
@@ -351,13 +351,20 @@ public class CraftWorld implements World {
|
||||
@@ -352,13 +352,20 @@ public class CraftWorld implements World {
|
||||
this.generator = gen;
|
||||
|
||||
this.environment = env;
|
||||
@@ -18686,7 +18686,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -431,14 +438,7 @@ public class CraftWorld implements World {
|
||||
@@ -432,14 +439,7 @@ public class CraftWorld implements World {
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
@@ -18702,7 +18702,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -486,13 +486,16 @@ public class CraftWorld implements World {
|
||||
@@ -487,13 +487,16 @@ public class CraftWorld implements World {
|
||||
public Chunk[] getLoadedChunks() {
|
||||
// Paper start
|
||||
if (Thread.currentThread() != world.getLevel().thread) {
|
||||
@@ -18723,7 +18723,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
return chunks.values().stream().map(ChunkHolder::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.LevelChunk::getBukkitChunk).toArray(Chunk[]::new);
|
||||
}
|
||||
|
||||
@@ -2671,7 +2674,7 @@ public class CraftWorld implements World {
|
||||
@@ -2672,7 +2675,7 @@ public class CraftWorld implements World {
|
||||
// Paper end
|
||||
return this.world.getChunkSource().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> {
|
||||
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null);
|
||||
@@ -18732,7 +18732,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
return java.util.concurrent.CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk());
|
||||
}, net.minecraft.server.MinecraftServer.getServer());
|
||||
}
|
||||
@@ -2696,14 +2699,14 @@ public class CraftWorld implements World {
|
||||
@@ -2697,14 +2700,14 @@ public class CraftWorld implements World {
|
||||
throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
|
||||
}
|
||||
net.minecraft.server.level.ChunkMap chunkMap = getHandle().getChunkSource().chunkMap;
|
||||
@@ -18749,7 +18749,7 @@ index 4607dcfa911ab554e7ad0e043caf9bcc72e94823..67761ed1486c110eacd4c10fe617648e
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2712,11 +2715,22 @@ public class CraftWorld implements World {
|
||||
@@ -2713,11 +2716,22 @@ public class CraftWorld implements World {
|
||||
throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
|
||||
}
|
||||
net.minecraft.server.level.ChunkMap chunkMap = getHandle().getChunkSource().chunkMap;
|
||||
@@ -18860,7 +18860,7 @@ index 3acb5f8a1f863b5ba47eac4190be8228324fc8e7..68cacecde84a592839b738723fb0b73f
|
||||
@Override
|
||||
public boolean teleport(Location location) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 7b8885f48245c37ba7166abd44486027779e134e..5b2fcfac84f13ac2321676e484372597e8c665d0 100644
|
||||
index 9f8f3ad5fd2c9e43a5b99804e404f11e5056897f..538beaedac3f8fe85fe5125cce1043706a295f89 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -517,15 +517,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
Reference in New Issue
Block a user