Updated Upstream (Paper & Tuinity)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
0ea308381 Updated Upstream (Bukkit/CraftBukkit)

Tuinity Changes:
502d57ba Updated Upstream (Paper)
4415b59b Improve behavior for hard colliding entities
e5f54a3f Fix chunks refusing to unload at low TPS
2dfd22e4 Fix incorrect isRealPlayer init
This commit is contained in:
jmp
2021-02-16 15:19:26 -08:00
parent d7d72b326c
commit 70ec0e2e48
26 changed files with 851 additions and 739 deletions

2
Paper

Submodule Paper updated: 088fa6f28b...0ea3083817

View File

@@ -416,6 +416,28 @@ sometimes it is.
This patch also prevents the saving/unloading of POI data when
world saving is disabled.
Send full pos packets for hard colliding entities
Prevent collision problems due to desync (i.e boats)
Configurable under
`send-full-pos-for-hard-colliding-entities`
Fix chunks refusing to unload at low TPS
The full chunk future is appended to the chunk save future, but
when moving to unloaded ticket level it is not being completed with
the empty chunk access, so the chunk save must wait for the full
chunk future to complete. We can simply schedule to the immediate
executor to get this effect, rather than the main mailbox.
Fix incorrect isRealPlayer init
Some plugins, namely ProtocolSupport, don't route to where
paper placed their logic. So it wont correctly set in this case.
Fix by moving it to a different place.
diff --git a/pom.xml b/pom.xml
index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..e83e4241a56fe131a75fe21cc1518992c089da2c 100644
--- a/pom.xml
@@ -5119,10 +5141,10 @@ index 0000000000000000000000000000000000000000..125f59826a9b0174039139ed0715a4ed
+}
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..42ce3b80217b574a1852e12f500b366a912e23e2
index 0000000000000000000000000000000000000000..63dfad42c372a33b35c585aaa7ed24d8f16d44e0
--- /dev/null
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -0,0 +1,381 @@
@@ -0,0 +1,387 @@
+package com.tuinity.tuinity.config;
+
+import com.destroystokyo.paper.util.SneakyThrow;
@@ -5354,6 +5376,12 @@ index 0000000000000000000000000000000000000000..42ce3b80217b574a1852e12f500b366a
+ useNewLightEngine = TuinityConfig.getBoolean("use-new-light-engine", true);
+ }
+
+ public static boolean sendFullPosForHardCollidingEntities;
+
+ private static void sendFullPosForHardCollidingEntities() {
+ sendFullPosForHardCollidingEntities = TuinityConfig.getBoolean("send-full-pos-for-hard-colliding-entities", true);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;
@@ -9205,7 +9233,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..7f3887b0894aca0f972922f434382646
for (java.util.Iterator<Entry<ArraySetSorted<Ticket<?>>>> iterator = this.tickets.long2ObjectEntrySet().fastIterator(); iterator.hasNext();) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545faebcb3e 100644
index 0ea1b25bf98d71c251351807fa92d4d08eb6b06e..fdbf984e64f135abfdee465d76eb1112bccfa8c3 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -22,6 +22,12 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
@@ -9408,7 +9436,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) {
this.world = worldserver;
this.serverThreadQueue = new ChunkProviderServer.a(worldserver);
@@ -536,6 +701,8 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -544,6 +709,8 @@ public class ChunkProviderServer extends IChunkProvider {
Arrays.fill(this.cacheChunk, (Object) null);
}
@@ -9417,7 +9445,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getChunkFutureMainThread(int i, int j, ChunkStatus chunkstatus, boolean flag) {
// Paper start - add isUrgent - old sig left in place for dirty nms plugins
return getChunkFutureMainThread(i, j, chunkstatus, flag, false);
@@ -554,9 +721,12 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -562,9 +729,12 @@ public class ChunkProviderServer extends IChunkProvider {
PlayerChunk.State currentChunkState = PlayerChunk.getChunkState(playerchunk.getTicketLevel());
currentlyUnloading = (oldChunkState.isAtLeast(PlayerChunk.State.BORDER) && !currentChunkState.isAtLeast(PlayerChunk.State.BORDER));
}
@@ -9430,7 +9458,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
if (isUrgent) this.chunkMapDistance.markUrgent(chunkcoordintpair); // Paper
if (this.a(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -567,12 +737,20 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -575,12 +745,20 @@ public class ChunkProviderServer extends IChunkProvider {
playerchunk = this.getChunk(k);
gameprofilerfiller.exit();
if (this.a(playerchunk, l)) {
@@ -9452,7 +9480,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
if (isUrgent) {
future.thenAccept(either -> this.chunkMapDistance.clearUrgent(chunkcoordintpair));
}
@@ -591,8 +769,8 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -599,8 +777,8 @@ public class ChunkProviderServer extends IChunkProvider {
return !this.a(playerchunk, k);
}
@@ -9463,7 +9491,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
long k = ChunkCoordIntPair.pair(i, j);
PlayerChunk playerchunk = this.getChunk(k);
@@ -629,6 +807,8 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -637,6 +815,8 @@ public class ChunkProviderServer extends IChunkProvider {
public boolean tickDistanceManager() { // Paper - private -> public
if (chunkMapDistance.delayDistanceManagerTick) return false; // Paper
@@ -9472,7 +9500,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
boolean flag = this.chunkMapDistance.a(this.playerChunkMap);
boolean flag1 = this.playerChunkMap.b();
@@ -638,6 +818,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -646,6 +826,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.clearCache();
return true;
}
@@ -9480,7 +9508,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
}
public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER
@@ -726,7 +907,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -734,7 +915,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.getMethodProfiler().enter("purge");
this.world.timings.doChunkMap.startTiming(); // Spigot
this.chunkMapDistance.purgeTickets();
@@ -9489,7 +9517,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
this.tickDistanceManager();
this.world.timings.doChunkMap.stopTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("chunks");
@@ -736,7 +917,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -744,7 +925,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.timings.doChunkUnload.startTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("unload");
this.playerChunkMap.unloadChunks(booleansupplier);
@@ -9498,7 +9526,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
this.world.timings.doChunkUnload.stopTiming(); // Spigot
this.world.getMethodProfiler().exit();
this.clearCache();
@@ -813,19 +994,23 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -821,19 +1002,23 @@ public class ChunkProviderServer extends IChunkProvider {
//List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
//Collections.shuffle(list); // Paper
// Paper - moved up
@@ -9530,7 +9558,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
if (!this.playerChunkMap.isOutsideOfRange(playerchunk, chunkcoordintpair, false)) { // Paper - optimise isOutsideOfRange
@@ -837,11 +1022,15 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -845,11 +1030,15 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
this.world.a(chunk, k);
this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
@@ -9548,7 +9576,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
this.world.getMethodProfiler().enter("customSpawners");
if (flag1) {
try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
@@ -853,7 +1042,25 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -861,7 +1050,25 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.getMethodProfiler().exit();
}
@@ -9574,7 +9602,7 @@ index 96a6f4675dc10a0047b7d2ee4164d0376de36c27..9e6381a60b804a957eda5b72582d5545
}
private void a(long i, Consumer<Chunk> consumer) {
@@ -993,51 +1200,18 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -1001,51 +1208,18 @@ public class ChunkProviderServer extends IChunkProvider {
ChunkProviderServer.this.world.getMethodProfiler().c("runTask");
super.executeTask(runnable);
}
@@ -10674,7 +10702,7 @@ index 23017b5486530bcf76b3934cfa8621e8b4772b27..a4d94385ede0303417d676155c2c0b22
}
}
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 3960a975e74ed81c45819fe5e0f01c6c18252982..526c1419af7bd0b6098a8f9a0a24a64ba61c6ebc 100644
index 3960a975e74ed81c45819fe5e0f01c6c18252982..81869215876d10a84ab27c0e6f41963c1346fd1c 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -74,6 +74,7 @@ public class EntityTrackerEntry {
@@ -10685,6 +10713,15 @@ index 3960a975e74ed81c45819fe5e0f01c6c18252982..526c1419af7bd0b6098a8f9a0a24a64b
List<Entity> list = this.tracker.getPassengers();
if (!list.equals(this.p)) {
@@ -156,7 +157,7 @@ public class EntityTrackerEntry {
// Paper end - remove allocation of Vec3D here
boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
- if (!flag4 && this.o <= 400 && !this.q && this.r == this.tracker.isOnGround()) {
+ if (!flag4 && this.o <= 400 && !this.q && this.r == this.tracker.isOnGround() && !(com.tuinity.tuinity.config.TuinityConfig.sendFullPosForHardCollidingEntities && this.tracker.hardCollides())) { // Tuinity - send full pos for hard colliding entities to prevent collision problems due to desync
if ((!flag2 || !flag3) && !(this.tracker instanceof EntityArrow)) {
if (flag2) {
packet1 = new PacketPlayOutEntity.PacketPlayOutRelEntityMove(this.tracker.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.tracker.isOnGround());
diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java
index 05b0090ae36cf61f67e26aad478df30c89f31941..30ba21ac1bced18a9d0946b7c3ed55971ada48bb 100644
--- a/src/main/java/net/minecraft/server/EnumDirection.java
@@ -10844,7 +10881,7 @@ index 25e54a1fadc5d31fb250a3f47524b4f345fc8cc6..cce0ac8a36bef3b9e5a2b95e0c3dd137
return this.d(entity, axisalignedbb, predicate).allMatch(VoxelShape::isEmpty);
} finally { if (entity != null) entity.collisionLoadChunks = false; } // Paper
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index 2639c17b7f6100533f33124f9e49990cd303d161..cbaf18af1066e8bde10293bba5eb3060bae1e66f 100644
index 2639c17b7f6100533f33124f9e49990cd303d161..93f2ac996904ddefed04704e554209d047faa59f 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -55,16 +55,26 @@ public interface IEntityAccess {
@@ -10864,7 +10901,8 @@ index 2639c17b7f6100533f33124f9e49990cd303d161..cbaf18af1066e8bde10293bba5eb3060
if (axisalignedbb.a() < 1.0E-7D) {
return Stream.empty();
} else {
AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D);
- AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D);
+ AxisAlignedBB axisalignedbb1 = axisalignedbb.g(-1.0E-7D); // Tuinity - to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with. expanding by +epsilon gives us stuff we don't collide with, which will screw over callers in some cases.
- return this.getEntities(entity, axisalignedbb1, predicate.and((entity1) -> {
+ if (predicate == null) predicate = (e) -> true; // Tuinity - allow nullable
@@ -12722,7 +12760,7 @@ index 253377c6238594de1f76cafcbf8223592e4d3f6b..3ebe3d0dc4c2c6aee6ea349006a74cbe
if (entityliving == entityliving1) {
return false;
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab25e26be46 100644
index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..3127fc9dd87e82243e167862cae83ac87b7f4fa0 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -56,6 +56,12 @@ public class PlayerChunk {
@@ -12738,7 +12776,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
// Paper end - optimise isOutsideOfRange
// Paper start - optimize chunk status progression without jumping through thread pool
@@ -362,7 +368,7 @@ public class PlayerChunk {
@@ -366,7 +372,7 @@ public class PlayerChunk {
if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks
Chunk chunk = this.getSendingChunk(); // Paper - no-tick view distance
@@ -12747,7 +12785,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
byte b0 = (byte) SectionPosition.a(blockposition.getY());
if (b0 < 0 || b0 >= this.dirtyBlocks.length) return; // CraftBukkit - SPIGOT-6086, SPIGOT-6296
@@ -377,13 +383,14 @@ public class PlayerChunk {
@@ -381,13 +387,14 @@ public class PlayerChunk {
public void a(EnumSkyBlock enumskyblock, int i) {
Chunk chunk = this.getSendingChunk(); // Paper - no-tick view distance
@@ -12764,7 +12802,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
}
@@ -421,7 +428,7 @@ public class PlayerChunk {
@@ -425,7 +432,7 @@ public class PlayerChunk {
this.a(world, blockposition, iblockdata);
} else {
ChunkSection chunksection = chunk.getSections()[sectionposition.getY()];
@@ -12773,7 +12811,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
PacketPlayOutMultiBlockChange packetplayoutmultiblockchange = new PacketPlayOutMultiBlockChange(sectionposition, shortset, chunksection, this.x);
this.a(packetplayoutmultiblockchange, false);
@@ -504,6 +511,7 @@ public class PlayerChunk {
@@ -508,6 +515,7 @@ public class PlayerChunk {
// Paper end - per player view distance
}
@@ -12781,7 +12819,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) {
int i = chunkstatus.c();
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(i);
@@ -559,6 +567,7 @@ public class PlayerChunk {
@@ -563,6 +571,7 @@ public class PlayerChunk {
}
protected void a(PlayerChunkMap playerchunkmap) {
@@ -12789,7 +12827,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel);
ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel);
boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET;
@@ -568,7 +577,8 @@ public class PlayerChunk {
@@ -572,7 +581,8 @@ public class PlayerChunk {
// CraftBukkit start
// ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins.
if (playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && !playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) {
@@ -12799,7 +12837,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
Chunk chunk = (Chunk)either.left().orElse(null);
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
@@ -633,7 +643,8 @@ public class PlayerChunk {
@@ -637,7 +647,8 @@ public class PlayerChunk {
if (!flag2 && flag3) {
// Paper start - cache ticking ready status
int expectCreateCount = ++this.fullChunkCreateCount;
@@ -12809,7 +12847,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
if (either.left().isPresent() && PlayerChunk.this.fullChunkCreateCount == expectCreateCount) {
// note: Here is a very good place to add callbacks to logic waiting on this.
Chunk fullChunk = either.left().get();
@@ -664,7 +675,8 @@ public class PlayerChunk {
@@ -668,7 +679,8 @@ public class PlayerChunk {
if (!flag4 && flag5) {
// Paper start - cache ticking ready status
@@ -12819,7 +12857,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
if (either.left().isPresent()) {
// note: Here is a very good place to add callbacks to logic waiting on this.
Chunk tickingChunk = either.left().get();
@@ -674,6 +686,9 @@ public class PlayerChunk {
@@ -678,6 +690,9 @@ public class PlayerChunk {
// Paper start - rewrite ticklistserver
PlayerChunk.this.chunkMap.world.onChunkSetTicking(PlayerChunk.this.location.x, PlayerChunk.this.location.z);
// Paper end - rewrite ticklistserver
@@ -12829,7 +12867,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
});
@@ -684,6 +699,12 @@ public class PlayerChunk {
@@ -688,6 +703,12 @@ public class PlayerChunk {
if (flag4 && !flag5) {
this.tickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isTickingReady = false; // Paper - cache chunk ticking stage
this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@@ -12842,7 +12880,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
boolean flag6 = playerchunk_state.isAtLeast(PlayerChunk.State.ENTITY_TICKING);
@@ -695,13 +716,16 @@ public class PlayerChunk {
@@ -699,13 +720,16 @@ public class PlayerChunk {
}
// Paper start - cache ticking ready status
@@ -12861,7 +12899,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
@@ -713,6 +737,12 @@ public class PlayerChunk {
@@ -717,6 +741,12 @@ public class PlayerChunk {
if (flag6 && !flag7) {
this.entityTickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@@ -12874,7 +12912,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
}
// Paper start - raise IO/load priority if priority changes, use our preferred priority
@@ -738,7 +768,8 @@ public class PlayerChunk {
@@ -742,7 +772,8 @@ public class PlayerChunk {
// CraftBukkit start
// ChunkLoadEvent: Called after the chunk is loaded: isChunkLoaded returns true and chunk is ready to be modified by plugins.
if (!playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) {
@@ -12885,7 +12923,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c2a64e141 100644
index 49008cdec739b19409fdaf1b0ed806a6c0e93200..2c2becef8b56d7e5e998976222df85d2c8516c43 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -121,31 +121,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -13160,7 +13198,18 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
protected void c(ChunkCoordIntPair chunkcoordintpair) {
this.executor.a(SystemUtils.a(() -> {
this.chunkDistanceManager.b(TicketType.LIGHT, chunkcoordintpair, 33 + ChunkStatus.a(ChunkStatus.FEATURES), chunkcoordintpair);
@@ -1498,6 +1577,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1415,9 +1494,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
chunk.B();
return chunk;
});
- }, (runnable) -> {
- this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable));
- });
+ }, this.executor); // Tuinity - queue to execute immediately so this doesn't delay chunk unloading
}
public int c() {
@@ -1498,6 +1575,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public void setViewDistance(int i) { // Paper - public
@@ -13168,7 +13217,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
int j = MathHelper.clamp(i + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32
if (j != this.viewDistance) {
@@ -1511,6 +1591,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1511,6 +1589,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - no-tick view distance
public final void setNoTickViewDistance(int viewDistance) {
@@ -13176,7 +13225,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
viewDistance = viewDistance == -1 ? -1 : MathHelper.clamp(viewDistance, 2, 32);
this.noTickViewDistance = viewDistance;
@@ -1626,7 +1707,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1626,7 +1705,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (Thread.currentThread() != com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE) {
com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(
this.world, chunkcoordintpair.x, chunkcoordintpair.z, null, nbttagcompound,
@@ -13185,7 +13234,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
return;
}
super.write(chunkcoordintpair, nbttagcompound);
@@ -1710,6 +1791,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1710,6 +1789,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
}
// Paper end
@@ -13197,7 +13246,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
// Paper start - async io
@@ -2037,22 +2123,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2037,22 +2121,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private final void processTrackQueue() {
this.world.timings.tracker1.startTiming();
try {
@@ -13237,7 +13286,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..a42571cfd2c9c80df27e59db832cb64c
}
// Paper end - optimised tracker
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f 100644
index 87b1ff21957d5d708209257e569785aeaf191181..4185ec46435ddf48d9e25c4d71ac4e14eb6301cf 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -419,7 +419,9 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -13297,7 +13346,41 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
entity.setLocation(d0, d1, d2, f, f1);
player.setLocation(d0, d1, d2, this.player.yaw, this.player.pitch); // CraftBukkit
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
@@ -1068,7 +1081,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -546,7 +559,32 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
private boolean a(Entity entity) {
- return entity.world.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)).allMatch(BlockBase.BlockData::isAir);
+ // Tuinity start - stop using streams, this is already a known fixed problem in Entity#move
+ AxisAlignedBB box = entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D);
+ int minX = MathHelper.floor(box.minX);
+ int minY = MathHelper.floor(box.minY);
+ int minZ = MathHelper.floor(box.minZ);
+ int maxX = MathHelper.floor(box.maxX);
+ int maxY = MathHelper.floor(box.maxY);
+ int maxZ = MathHelper.floor(box.maxZ);
+
+ World world = entity.world;
+ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition();
+
+ for (int y = minY; y <= maxY; ++y) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ for (int x = minX; x <= maxX; ++x) {
+ pos.setValues(x, y, z);
+ IBlockData type = world.getTypeIfLoaded(pos);
+ if (type != null && !type.isAir()) {
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ // Tuinity end - stop using streams, this is already a known fixed problem in Entity#move
}
@Override
@@ -1068,7 +1106,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
if (this.teleportPos != null) {
@@ -13306,7 +13389,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -1138,7 +1151,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1138,7 +1176,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
speed = player.abilities.walkSpeed * 10f;
}
// Paper start - Prevent moving into unloaded chunks
@@ -13315,7 +13398,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet());
return;
}
@@ -1155,7 +1168,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1155,7 +1193,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
@@ -13324,7 +13407,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
d7 = d4 - this.o;
d8 = d5 - this.p;
@@ -1194,6 +1207,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1194,6 +1232,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
@@ -13332,7 +13415,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move
// Paper start - prevent position desync
if (this.teleportPos != null) {
@@ -1213,12 +1227,23 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1213,12 +1252,23 @@ public class PlayerConnection implements PacketListenerPlayIn {
boolean flag1 = false;
if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
@@ -13358,7 +13441,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94
this.a(d0, d1, d2, f, f1);
} else {
// CraftBukkit start - fire PlayerMoveEvent
@@ -1305,6 +1330,26 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1305,6 +1355,26 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
@@ -13568,6 +13651,27 @@ index 114e986e5132e5e4bb42d0f08a067429bce53ba6..05656ea8448aa569e8dd480461e2d5f7
} else {
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); // CraftBukkit - SPIGOT-5196
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 1eb44877e7384ae0a028a12b832684126b8d50ec..eabd1aa2b740bcb6db40be300cd6daf59674fa3f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -98,6 +98,7 @@ public abstract class PlayerList {
}
public void a(NetworkManager networkmanager, EntityPlayer entityplayer) {
+ entityplayer.isRealPlayer = true; // Paper // Tuinity - this is a better place to write this that works and isn't overriden by plugins
EntityPlayer prev = pendingPlayers.put(entityplayer.getUniqueID(), entityplayer);// Paper
if (prev != null) {
disconnectPendingPlayer(prev);
@@ -637,7 +638,7 @@ public abstract class PlayerList {
SocketAddress socketaddress = loginlistener.networkManager.getSocketAddress();
EntityPlayer entity = new EntityPlayer(this.server, this.server.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(this.server.getWorldServer(World.OVERWORLD)));
- entity.isRealPlayer = true; // Paper
+ // Tuinity - some plugins (namely protocolsupport) bypass this logic completely! So this needs to be moved.
Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress());
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index 5b0cd414ca1949ab53b289f7159f18da07d21f14..d8b759874545293764690b2ba08a4bd7605c76ae 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -16041,7 +16145,7 @@ index f011869880fedae4b69e505491e8bdbc5f51dfba..0d10d317cd0b60fc0866ae505c7fd71f
return this.j.d();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f894d5cd7b3 100644
index cf7d94aabab600822eb5e27f38690b06456d5fcc..43740b9b2d2c4a5b6bfe6061841ec4e4e437acf3 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -55,12 +55,13 @@ import org.bukkit.event.server.MapInitializeEvent;
@@ -16180,7 +16284,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
// Add env and gen to constructor, WorldData -> WorldDataServer
public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor
@@ -266,6 +372,243 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -266,6 +372,251 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.asyncChunkTaskManager = new com.destroystokyo.paper.io.chunk.ChunkTaskManager(this); // Paper
}
@@ -16200,7 +16304,11 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
+ if (axisalignedbb.isEmpty()) {
+ return false;
+ }
+ axisalignedbb = axisalignedbb.grow(MCUtil.COLLISION_EPSILON, MCUtil.COLLISION_EPSILON, MCUtil.COLLISION_EPSILON);
+
+ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with.
+ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems
+ // specifically with boat collisions.
+ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON);
+ List<Entity> entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList();
+ try {
+ if (entity != null && entity.hardCollides()) {
@@ -16370,7 +16478,11 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
+ if (axisalignedbb.isEmpty()) {
+ return;
+ }
+ axisalignedbb = axisalignedbb.grow(MCUtil.COLLISION_EPSILON, MCUtil.COLLISION_EPSILON, MCUtil.COLLISION_EPSILON);
+
+ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with.
+ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems
+ // specifically with boat collisions.
+ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON);
+ List<Entity> entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList();
+ try {
+ if (entity != null && entity.hardCollides()) {
@@ -16424,7 +16536,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
// CraftBukkit start
@Override
protected TileEntity getTileEntity(BlockPosition pos, boolean validate) {
@@ -319,6 +662,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -319,6 +670,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void doTick(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
@@ -16439,7 +16551,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
this.ticking = true;
gameprofilerfiller.enter("world border");
@@ -468,7 +819,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -468,7 +827,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
timings.scheduledBlocks.stopTiming(); // Paper
@@ -16448,7 +16560,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
gameprofilerfiller.exitEnter("raid");
this.timings.raids.startTiming(); // Paper - timings
this.persistentRaid.a();
@@ -477,7 +828,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -477,7 +836,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
timings.doSounds.startTiming(); // Spigot
this.ak();
timings.doSounds.stopTiming(); // Spigot
@@ -16457,7 +16569,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
this.ticking = false;
gameprofilerfiller.exitEnter("entities");
boolean flag3 = true || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
@@ -493,13 +844,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -493,13 +852,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
this.tickingEntities = true;
@@ -16473,7 +16585,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
Entity entity1 = entity.getVehicle();
/* CraftBukkit start - We prevent spawning in general, so this butchering is not needed
@@ -515,6 +865,15 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -515,6 +873,15 @@ public class WorldServer extends World implements GeneratorAccessSeed {
gameprofilerfiller.enter("checkDespawn");
if (!entity.dead) {
entity.checkDespawn();
@@ -16489,7 +16601,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
}
gameprofilerfiller.exit();
@@ -535,14 +894,22 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -535,14 +902,22 @@ public class WorldServer extends World implements GeneratorAccessSeed {
gameprofilerfiller.enter("remove");
if (entity.dead) {
this.removeEntityFromChunk(entity);
@@ -16513,7 +16625,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
this.tickingEntities = false;
// Paper start
for (java.lang.Runnable run : this.afterEntityTickingTasks) {
@@ -554,7 +921,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -554,7 +929,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
this.afterEntityTickingTasks.clear();
// Paper end
@@ -16522,7 +16634,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
Entity entity2;
@@ -564,7 +931,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -564,7 +939,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
timings.tickEntities.stopTiming(); // Spigot
@@ -16531,7 +16643,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
this.tickBlockEntities();
}
@@ -810,7 +1177,26 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -810,7 +1185,26 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
@@ -16558,7 +16670,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) {
this.chunkCheck(entity);
} else {
@@ -863,6 +1249,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -863,6 +1257,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
//} finally { timer.stopTiming(); } // Paper - timings - move up
}
@@ -16570,7 +16682,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
}
public void a(Entity entity, Entity entity1) {
@@ -921,6 +1312,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -921,6 +1320,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
int i = MathHelper.floor(entity.locX() / 16.0D);
int j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
int k = MathHelper.floor(entity.locZ() / 16.0D);
@@ -16583,7 +16695,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) {
// Paper start - remove entity if its in a chunk more correctly.
@@ -930,6 +1327,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -930,6 +1335,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Paper end
@@ -16596,7 +16708,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) {
this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY);
}
@@ -943,6 +1346,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -943,6 +1354,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
} else {
this.getChunkAt(i, k).a(entity);
}
@@ -16608,7 +16720,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
}
this.getMethodProfiler().exit();
@@ -1298,7 +1706,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1298,7 +1714,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Entity entity = (Entity) iterator.next();
if (!(entity instanceof EntityPlayer)) {
@@ -16617,7 +16729,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!")));
}
@@ -1326,6 +1734,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1326,6 +1742,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void unregisterEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot
@@ -16625,7 +16737,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
// Paper start - fix entity registration issues
if (entity instanceof EntityComplexPart) {
// Usually this is a no-op for complex parts, and ID's should be removed, but go ahead and remove it anyways
@@ -1392,17 +1801,108 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1392,17 +1809,108 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.getScoreboard().a(entity);
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
@@ -16737,7 +16849,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
private void registerEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
// Paper start - don't double enqueue entity registration
@@ -1413,7 +1913,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1413,7 +1921,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
return;
}
// Paper end
@@ -16746,7 +16858,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
if (!entity.isQueuedForRegister) { // Paper
this.entitiesToAdd.add(entity);
entity.isQueuedForRegister = true; // Paper
@@ -1421,6 +1921,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1421,6 +1929,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
} else {
entity.isQueuedForRegister = false; // Paper
this.entitiesById.put(entity.getId(), entity);
@@ -16754,7 +16866,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
if (entity instanceof EntityEnderDragon) {
EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eJ();
int i = aentitycomplexpart.length;
@@ -1429,6 +1930,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1429,6 +1938,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
EntityComplexPart entitycomplexpart = aentitycomplexpart[j];
this.entitiesById.put(entitycomplexpart.getId(), entitycomplexpart);
@@ -16762,7 +16874,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
}
}
@@ -1453,12 +1955,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1453,12 +1963,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// this.getChunkProvider().addEntity(entity); // Paper - moved down below valid=true
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
@@ -16782,7 +16894,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
}
entity.valid = true; // CraftBukkit
this.getChunkProvider().addEntity(entity); // Paper - from above to be below valid=true
@@ -1474,7 +1980,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1474,7 +1988,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
public void removeEntity(Entity entity) {
@@ -16791,7 +16903,7 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!")));
} else {
this.removeEntityFromChunk(entity);
@@ -1570,14 +2076,33 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1570,14 +2084,33 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@Override
public void notify(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) {
@@ -16825,8 +16937,8 @@ index 2b94c195db43d8e7fd58301a33377e87daa16e98..9c11a6ba0384baafaec1403a6a7c3f89
+ try { // Tuinity end
while (iterator.hasNext()) {
NavigationAbstract navigationabstract = (NavigationAbstract) iterator.next();
@@ -1585,7 +2110,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// CraftBukkit start - fix SPIGOT-6362
@@ -1596,7 +2129,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (!navigationabstract.i()) {
navigationabstract.b(blockposition);
}

View File

@@ -84,7 +84,7 @@ index 173a210392d71cdfc551f095dc0d9c9040d22d3f..af4fb76d000594229e0c0dfdcde48fba
return this.serverStatisticManager;
}
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index cbaf18af1066e8bde10293bba5eb3060bae1e66f..0c98a436021cbdedba5352073b1f8bf9852298eb 100644
index 93f2ac996904ddefed04704e554209d047faa59f..b1a546c9ef91169591ed5a71ac1c97dbc84afc03 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -174,28 +174,18 @@ public interface IEntityAccess {
@@ -149,7 +149,7 @@ index b5e1a860a2569d7668330827614d221b60f3fc78..5f85a1d513f4fdc21b64e1a2b6882e33
// Paper start
public static final Predicate<Entity> affectsSpawning = (entity) -> {
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f..caf9ce94a7cb6154981d42953c81b588b19e3814 100644
index 4185ec46435ddf48d9e25c4d71ac4e14eb6301cf..1d810a9b23d236493db121dde92c7ebce25a25fe 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -250,6 +250,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -174,7 +174,7 @@ index 4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f..caf9ce94a7cb6154981d42953c81b588
// Skip the first time we do this
if (true) { // Spigot - don't skip any move events
Location oldTo = to.clone();
@@ -1228,7 +1236,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1253,7 +1261,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
flag1 = true; // Tuinity - diff on change, this should be moved wrongly
@@ -183,7 +183,7 @@ index 4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f..caf9ce94a7cb6154981d42953c81b588
}
this.player.setLocation(d4, d5, d6, f, f1);
@@ -1278,6 +1286,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1303,6 +1311,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
@@ -193,10 +193,10 @@ index 4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f..caf9ce94a7cb6154981d42953c81b588
if (from.getX() != Double.MAX_VALUE) {
Location oldTo = to.clone();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9c11a6ba0384baafaec1403a6a7c3f894d5cd7b3..e99c3ad507f1381c9aa495052d2014ba8b7e0750 100644
index 43740b9b2d2c4a5b6bfe6061841ec4e4e437acf3..4464ac1b4cd240af03102a6f4dc47870e3fe0f30 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -782,7 +782,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -790,7 +790,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// CraftBukkit end
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
@@ -205,7 +205,7 @@ index 9c11a6ba0384baafaec1403a6a7c3f894d5cd7b3..e99c3ad507f1381c9aa495052d2014ba
})) {
// CraftBukkit start
long l = this.worldData.getDayTime() + 24000L;
@@ -1119,7 +1119,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1127,7 +1127,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();

View File

@@ -67,10 +67,10 @@ index af4fb76d000594229e0c0dfdcde48fbafc087de0..5e157aabc8326a32a6a1825fef0f9813
public Scoreboard getScoreboard() {
return getBukkitEntity().getScoreboard().getHandle();
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index caf9ce94a7cb6154981d42953c81b588b19e3814..e833447073585ff97f8ab3a95caea8866fcc24e2 100644
index 1d810a9b23d236493db121dde92c7ebce25a25fe..218ebc7befca683607b0b9863384a5b5d6bd3a2f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1708,6 +1708,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1733,6 +1733,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
@@ -79,10 +79,10 @@ index caf9ce94a7cb6154981d42953c81b588b19e3814..e833447073585ff97f8ab3a95caea886
this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus));
// Paper end
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 1eb44877e7384ae0a028a12b832684126b8d50ec..5b0fdcf5190e4ab2af249a5a0952b66d52f08751 100644
index eabd1aa2b740bcb6db40be300cd6daf59674fa3f..46043d3a4f4056fff93b867c65d363ac1277db7a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -914,6 +914,8 @@ public abstract class PlayerList {
@@ -915,6 +915,8 @@ public abstract class PlayerList {
}
// Paper end

View File

@@ -17,7 +17,7 @@ index 8e93f1540ba5f995489c1fbcec70d10b011cd9c3..470f92c4fb0919d052b19acff8dff533
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e833447073585ff97f8ab3a95caea8866fcc24e2..fdd517290a0b306dff9c0fffadc424b59b8504f3 100644
index 218ebc7befca683607b0b9863384a5b5d6bd3a2f..dc93f0c8f65e2a796604b8e4488c1b3bd155b64e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -84,6 +84,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -50,7 +50,7 @@ index e833447073585ff97f8ab3a95caea8866fcc24e2..fdd517290a0b306dff9c0fffadc424b5
if (this.isPendingPing()) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
@@ -2882,6 +2898,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2907,6 +2923,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@Override
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Zombie horse naturally spawn
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index e99c3ad507f1381c9aa495052d2014ba8b7e0750..49ae8bd50810473d121e786a06a813b777909904 100644
index 4464ac1b4cd240af03102a6f4dc47870e3fe0f30..5e9c09c3800c756b62c9b44a188c7033fd000bdf 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -996,12 +996,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1004,12 +1004,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
if (flag1) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Dont send useless entity packets
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 526c1419af7bd0b6098a8f9a0a24a64ba61c6ebc..81a82a1fa811956a8b5233677981c2d3783b34fb 100644
index 81869215876d10a84ab27c0e6f41963c1346fd1c..f3b37f5704d752d1ec4d4d916690907dace67183 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -172,6 +172,7 @@ public class EntityTrackerEntry {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Cat spawning options
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index 0c98a436021cbdedba5352073b1f8bf9852298eb..08778cc0de9b1ffefc52d12d31403c33c50ddb2f 100644
index b1a546c9ef91169591ed5a71ac1c97dbc84afc03..6edff6d8ce67f64420a845e992339dadf53641f8 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -47,6 +47,7 @@ public interface IEntityAccess {

View File

@@ -17,10 +17,10 @@ index 5e157aabc8326a32a6a1825fef0f9813b5abe8f6..c533c24aefa6693dd5c11d690930327c
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index fdd517290a0b306dff9c0fffadc424b59b8504f3..3fca11948fad36b6adec55883d365e58a17925fa 100644
index dc93f0c8f65e2a796604b8e4488c1b3bd155b64e..eaddc933261aeccc963ac0f35eebb387c16ae6a0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2879,6 +2879,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2904,6 +2904,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
// Paper end

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add permission for F3+N debug
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 5b0fdcf5190e4ab2af249a5a0952b66d52f08751..3c19e931ad7d5330f1c77ef65aaa5858a001e4df 100644
index 46043d3a4f4056fff93b867c65d363ac1277db7a..726e3292318f6a0de474f68fe30da4a954c7600a 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1073,6 +1073,7 @@ public abstract class PlayerList {
@@ -1074,6 +1074,7 @@ public abstract class PlayerList {
} else {
b0 = (byte) (24 + i);
}

View File

@@ -36,10 +36,10 @@ index b2a76db173ae12bff2e8a7de411cb489fdb2e9c7..2a5eda6a7e67d0b8682a96552248ea4e
private CraftMerchant craftMerchant;
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
index f1a509063c09e603140c74255a3fb901693d2cc5..74c2d89af516ffc252032d5cbd12b489ea46813e 100644
index fa3e786cd6ef67da378a5d51583ca84a82677d8c..47a89bdd163d4690fa96f63d7a9723b3bcc9fa0b 100644
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
@@ -40,6 +40,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -41,6 +41,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.5D));
this.goalSelector.a(1, new PathfinderGoalLookAtTradingPlayer(this));
this.goalSelector.a(2, new EntityVillagerTrader.a(this, 2.0D, 0.35D));

View File

@@ -33,10 +33,10 @@ index 1cde71b812c7721298e7addb74de01e4ea297499..e4aedb3df5d0a47b5bb9175627aa794f
@Override
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
index 74c2d89af516ffc252032d5cbd12b489ea46813e..96dda6a14fd17509e9bcb72cc7e9c8532c6a036b 100644
index 47a89bdd163d4690fa96f63d7a9723b3bcc9fa0b..298d2b6f6e352bb82f3a5a307466bb6e8f47d9d3 100644
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
@@ -47,6 +47,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -48,6 +48,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
}

View File

@@ -74,7 +74,7 @@ index d99cecc4075338d7b8f154ab94d8ac04190ba371..ec37d2c3b0393c43097bdfc6064ebe3a
+ // Purpur end
}
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 81a82a1fa811956a8b5233677981c2d3783b34fb..a9d60e5dc2f3b38a192a68d79bcf78e4873664a2 100644
index f3b37f5704d752d1ec4d4d916690907dace67183..1cae524fe4248370f6f6967327cb4a463b5f19fc 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -106,6 +106,15 @@ public class EntityTrackerEntry {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Allow color codes in books
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 3fca11948fad36b6adec55883d365e58a17925fa..ffccdc3bf1d28836f4fc2772ebfde843415ea232 100644
index eaddc933261aeccc963ac0f35eebb387c16ae6a0..67fa3bd958876abc39c46d9e517551836b0e86ed 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1029,7 +1029,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1054,7 +1054,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (itemstack.getItem() == Items.WRITABLE_BOOK) {
NBTTagList nbttaglist = new NBTTagList();
@@ -18,7 +18,7 @@ index 3fca11948fad36b6adec55883d365e58a17925fa..ffccdc3bf1d28836f4fc2772ebfde843
ItemStack old = itemstack.cloneItemStack(); // CraftBukkit
itemstack.a("pages", (NBTBase) nbttaglist);
CraftEventFactory.handleEditBookEvent(player, i, old, itemstack); // CraftBukkit
@@ -1047,13 +1048,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1072,13 +1073,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
itemstack1.setTag(nbttagcompound.clone());
}
@@ -35,7 +35,7 @@ index 3fca11948fad36b6adec55883d365e58a17925fa..ffccdc3bf1d28836f4fc2772ebfde843
ChatComponentText chatcomponenttext = new ChatComponentText(s1);
String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext);
@@ -1065,6 +1067,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1090,6 +1092,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}

View File

@@ -92,10 +92,10 @@ index 21f94651fcb47103b12806d456417882e7f84dcd..16a1e55bd01d0616ff04da6b1eb3e7f4
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index ffccdc3bf1d28836f4fc2772ebfde843415ea232..8932f4854d9fc52fb2ec66a748e640dfd8806461 100644
index 67fa3bd958876abc39c46d9e517551836b0e86ed..94353290087df17e441dba8fe8999ad558652cda 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2271,6 +2271,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2296,6 +2296,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
boolean triggerLeashUpdate = itemInHand != null && itemInHand.getItem() == Items.LEAD && entity instanceof EntityInsentient;
Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem();
PlayerInteractEntityEvent event;

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Duplicate paper's vanilla scoreboard colors patch to sync
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 8932f4854d9fc52fb2ec66a748e640dfd8806461..eff58bba46e5cb4bd412fcb65e293d5b9eb58aba 100644
index 94353290087df17e441dba8fe8999ad558652cda..05f2cc5904f196c70e8e83625810673f6110aba0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2030,7 +2030,15 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2055,7 +2055,15 @@ public class PlayerConnection implements PacketListenerPlayIn {
return null;
}
@@ -26,7 +26,7 @@ index 8932f4854d9fc52fb2ec66a748e640dfd8806461..eff58bba46e5cb4bd412fcb65e293d5b
PlayerConnection.this.minecraftServer.console.sendMessage(message);
if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) {
for (Object player : PlayerConnection.this.minecraftServer.getPlayerList().players) {
@@ -2063,7 +2071,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2088,7 +2096,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
// Paper Start - (Meh) Support for vanilla world scoreboard name coloring
String displayName = event.getPlayer().getDisplayName();
if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {

View File

@@ -18,7 +18,7 @@ index dae2e5d70756c5b61163d57099b65f7e415b288c..55b67f1057224101272f9d6023a93872
}
final Object val = config.get(key);
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
index 42ce3b80217b574a1852e12f500b366a912e23e2..03e4d9d8bd29587492afbaab9400f3ae1e5e6dea 100644
index 63dfad42c372a33b35c585aaa7ed24d8f16d44e0..3583efb41f80eac7b6dba3a8479ec74c5f60549c 100644
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
@@ -1,5 +1,6 @@
@@ -28,7 +28,7 @@ index 42ce3b80217b574a1852e12f500b366a912e23e2..03e4d9d8bd29587492afbaab9400f3ae
import com.destroystokyo.paper.util.SneakyThrow;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.TicketType;
@@ -376,6 +377,19 @@ public final class TuinityConfig {
@@ -382,6 +383,19 @@ public final class TuinityConfig {
this.spawnLimitAmbient = this.getInt(path + ".ambient", -1);
}

View File

@@ -22,7 +22,7 @@ index 829d4a7508e1656dbdc912096b7eafcf30cbb5b2..6aea156d7c7a9ca8a357aad6a6781d72
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 49ae8bd50810473d121e786a06a813b777909904..c92f3043f6993e569cf83ac69682b85ef178d622 100644
index 5e9c09c3800c756b62c9b44a188c7033fd000bdf..536d43593308e4a3202d5d5d82bfab3d3b81e092 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -321,14 +321,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -4378,10 +4378,10 @@ index a0bfef54c853d57c9a5c6d3f9f19591649295357..548a993a1de939396d075f9176e0d60e
this.h(entityhuman);
}
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
index 96dda6a14fd17509e9bcb72cc7e9c8532c6a036b..3ea66955df304fd13aac2cf9bb93ea156558ae57 100644
index 298d2b6f6e352bb82f3a5a307466bb6e8f47d9d3..d41960088bb8bc6a7fece0ef152403c43a768dde 100644
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
@@ -23,6 +23,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -24,6 +24,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@Override
protected void initPathfinder() {
this.goalSelector.a(0, new PathfinderGoalFloat(this));
@@ -4389,7 +4389,7 @@ index 96dda6a14fd17509e9bcb72cc7e9c8532c6a036b..3ea66955df304fd13aac2cf9bb93ea15
this.goalSelector.a(0, new PathfinderGoalUseItem<>(this, PotionUtil.a(new ItemStack(Items.POTION), Potions.INVISIBILITY), SoundEffects.ENTITY_WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> {
return this.world.isNight() && !entityvillagertrader.isInvisible();
}));
@@ -48,6 +49,16 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -49,6 +50,16 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
}
// Purpur - start
@@ -4406,7 +4406,7 @@ index 96dda6a14fd17509e9bcb72cc7e9c8532c6a036b..3ea66955df304fd13aac2cf9bb93ea15
@Override
public boolean a(EntityHuman entityhuman) {
return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed();
@@ -75,8 +86,9 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -76,8 +87,9 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
}
if (this.getOffers().isEmpty()) {
@@ -4974,10 +4974,10 @@ index 0000000000000000000000000000000000000000..44929182dfd7ad847d9657c324f440cb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index eff58bba46e5cb4bd412fcb65e293d5b9eb58aba..e9485684b7d5ddde72fc388d51cfef679178bad3 100644
index 05f2cc5904f196c70e8e83625810673f6110aba0..ef222cdfdfb49dcdcb0e3bf6f6cabc765be003cc 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2288,6 +2288,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2313,6 +2313,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.server.getPluginManager().callEvent(event);
@@ -5042,7 +5042,7 @@ index 1ac2e9f373ae5b4250ff9faf726a962a739d6faf..97cc98af100edfad82668200759a5eed
// Purpur end
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c92f3043f6993e569cf83ac69682b85ef178d622..5a6aace070e64b6db315d766d16773c408de638e 100644
index 536d43593308e4a3202d5d5d82bfab3d3b81e092..6d8983b851b877e6a5ac378e11097a6ef23794f4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -102,6 +102,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Allow toggling special MobSpawners per world
In vanilla, these are all hardcoded on for world type 0 (overworld) and hardcoded off for every other world type. Default config behaviour matches this.
diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java
index 8d89f51182444852062d549d23c00a93e601eb38..072ec40f751b19c2a78dfcc6e439c64358d864d3 100644
index 341af7474690b929cfa3e35cd464bbbbacb6685e..ad00ff2bd525768e4f06631d16b912c61c8eee28 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java
@@ -132,7 +132,17 @@ public class MobSpawnerTrader implements MobSpawner {
@@ -42,7 +42,7 @@ index 97cc98af100edfad82668200759a5eed8fc67558..ded92fe7c7871bae6e9741747a67636d
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 5a6aace070e64b6db315d766d16773c408de638e..ded19d1773237eaf51f72ce93a6794db8f56d160 100644
index 6d8983b851b877e6a5ac378e11097a6ef23794f4..154f49b96e3622f803e9599116fd60c77dea90d1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -339,7 +339,24 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -18,7 +18,7 @@ index 1b9b43ee696575d986c25cafec07d863acb951a7..e837db171545ceacbc84a2b360cf0d95
public PacketPlayOutUpdateTime() {}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ded19d1773237eaf51f72ce93a6794db8f56d160..cb2c429bda81b8c151a50ef3627716fef1e422d0 100644
index 154f49b96e3622f803e9599116fd60c77dea90d1..a873d60875b2c08c8813cb365566e46ee99cb625 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -94,6 +94,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -37,7 +37,7 @@ index ded19d1773237eaf51f72ce93a6794db8f56d160..cb2c429bda81b8c151a50ef3627716fe
}
// Tuinity start - optimise collision
@@ -964,7 +966,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -972,7 +974,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.nextTickListBlock.nextTick(); // Paper
this.nextTickListFluid.nextTick(); // Paper
this.worldDataServer.u().a(this.server, i);
@@ -60,7 +60,7 @@ index ded19d1773237eaf51f72ce93a6794db8f56d160..cb2c429bda81b8c151a50ef3627716fe
this.setDayTime(this.worldData.getDayTime() + 1L);
}
@@ -973,6 +989,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -981,6 +997,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void setDayTime(long i) {
this.worldDataServer.setDayTime(i);

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Spread out and optimise player list ticks
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 3c19e931ad7d5330f1c77ef65aaa5858a001e4df..0efc210ad55d843fd297f0caa88a5f355fbfef80 100644
index 726e3292318f6a0de474f68fe30da4a954c7600a..58a184c518c557b7e4cfeebba9e4a7a9fbaf8c85 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -71,7 +71,7 @@ public abstract class PlayerList {
@@ -17,7 +17,7 @@ index 3c19e931ad7d5330f1c77ef65aaa5858a001e4df..0efc210ad55d843fd297f0caa88a5f35
// CraftBukkit start
private CraftServer cserver;
@@ -928,22 +928,23 @@ public abstract class PlayerList {
@@ -929,22 +929,23 @@ public abstract class PlayerList {
}
public void tick() {

View File

@@ -1165,10 +1165,10 @@ index 60962553e4f374b38de82f2cd4d72cef3d956c72..eef51f8e5734b897164ca9514e7b49b2
@Override
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
index 3ea66955df304fd13aac2cf9bb93ea156558ae57..32864e522b63d5d02c73a4df9f996c2ebe1b53ad 100644
index d41960088bb8bc6a7fece0ef152403c43a768dde..9eb9ace0f59366787bc2789ecabf7800b6d29d5c 100644
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
@@ -63,6 +63,11 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
@@ -64,6 +64,11 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
public boolean a(EntityHuman entityhuman) {
return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed();
}

View File

@@ -37,10 +37,10 @@ index eea187723c1931a5db9a2d79a1abddd664d890a1..33d43478b1bc4b0ca3f16ba80e0cd99b
this.isRestarting = isRestarting;
if (flag) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 0efc210ad55d843fd297f0caa88a5f355fbfef80..ca19cfa1ff801e5292332ff7b92bba881762306e 100644
index 58a184c518c557b7e4cfeebba9e4a7a9fbaf8c85..7db99b6639a0afdd1f68539f6c6a6f48275e5b6b 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -513,6 +513,8 @@ public abstract class PlayerList {
@@ -514,6 +514,8 @@ public abstract class PlayerList {
if (entityplayer.didPlayerJoinEvent) cserver.getPluginManager().callEvent(playerQuitEvent); // Paper - if we disconnected before join ever fired, don't fire quit
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] PlayerBookTooLargeEvent
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e9485684b7d5ddde72fc388d51cfef679178bad3..75d955948a407d94e6f3a88f86afa8b1d6ba33cb 100644
index ef222cdfdfb49dcdcb0e3bf6f6cabc765be003cc..95c1ba7241069ad291c2acef6972937ac7c4c7c7 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -941,6 +941,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -966,6 +966,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
NBTTagList pageList = testStack.getTag().getList("pages", 8);
if (pageList.size() > 100) {
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages");
@@ -16,7 +16,7 @@ index e9485684b7d5ddde72fc388d51cfef679178bad3..75d955948a407d94e6f3a88f86afa8b1
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
return;
}
@@ -953,6 +954,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -978,6 +979,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) {
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with with a page too large!");
@@ -24,7 +24,7 @@ index e9485684b7d5ddde72fc388d51cfef679178bad3..75d955948a407d94e6f3a88f86afa8b1
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
return;
}
@@ -976,6 +978,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1001,6 +1003,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (byteTotal > byteAllowed) {
PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerEditBookEvent not saving new book
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 75d955948a407d94e6f3a88f86afa8b1d6ba33cb..ca190409b6718607183df2e86f0b4be98c9b6c33 100644
index 95c1ba7241069ad291c2acef6972937ac7c4c7c7..1471785da53a18edf31a20212f3cc6c19de92822 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1036,7 +1036,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1061,7 +1061,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
list.stream().map(s -> s = color(s, hasPerm, false)).map(NBTTagString::a).forEach(nbttaglist::add); // Purpur - edit book
ItemStack old = itemstack.cloneItemStack(); // CraftBukkit
itemstack.a("pages", (NBTBase) nbttaglist);