Updated Upstream (Paper, Tuinity, & Airplane)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
8ed45920c Don't annotate type parameters using JetBrains annotations (#5600)
d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591)
29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504)
0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371

Tuinity Changes:
3350246ce Updated Upstream (Paper)
f773caf21 Fix rare ticket level recursion crash
0fa8a0e92 Starlight Handle concurrent chunk generation and lighting better

Airplane Changes:
fad74c215 Fix JB annotations for gradle (credit jpenilla)
d02f034e6 Updated Upstream (Tuinity)
This commit is contained in:
BillyGalbreath
2021-05-09 00:33:37 -05:00
parent 3b1531ad73
commit bedac1823f
17 changed files with 116 additions and 156 deletions

2
Paper

Submodule Paper updated: 8fcef3c1f6...8ed45920cf

View File

@@ -2059,7 +2059,7 @@ index 0000000000000000000000000000000000000000..5ea5b3933725d80dd193e815ac507ee5
\ No newline at end of file
diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java
new file mode 100644
index 0000000000000000000000000000000000000000..331f0ae05384b29ceb59f2846c52a2194658bb39
index 0000000000000000000000000000000000000000..f722f9838424f345b69aef11510c194c6629e439
--- /dev/null
+++ b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java
@@ -0,0 +1,289 @@
@@ -2298,16 +2298,16 @@ index 0000000000000000000000000000000000000000..331f0ae05384b29ceb59f2846c52a219
+
+ return ret.iterator();
+ } else {
+ if (chunk instanceof ProtoChunk) {
+ ProtoChunk protoChunk = (ProtoChunk)chunk;
+ protoChunk.lockLightSources();
+ // world gen and lighting run in parallel, and if lighting keeps up it can be lighting chunks that are
+ // being generated. In the nether, lava will add a lot of sources. This resulted in quite a few CME crashes.
+ // So all we do spinloop until we can collect a list of sources, and even if it is out of date we will pick up
+ // the missing sources from checkBlock.
+ for (;;) {
+ try {
+ return new ArrayList<>(chunk.getLightSources().collect(Collectors.toList())).iterator();
+ } finally {
+ protoChunk.releaseLightSources();
+ return chunk.getLightSources().collect(Collectors.toList()).iterator();
+ } catch (final Exception cme) {
+ continue;
+ }
+ } else {
+ return new ArrayList<>(chunk.getLightSources().collect(Collectors.toList())).iterator();
+ }
+ }
+ }
@@ -5514,10 +5514,10 @@ index 0000000000000000000000000000000000000000..df686b97460796004cad1477760647a9
+}
diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..b8df658c09a6dc739ff3f4d6e18c9cef7caea6c9
index 0000000000000000000000000000000000000000..20309334d81011f18fbb67be209a1eec25447b5c
--- /dev/null
+++ b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java
@@ -0,0 +1,30 @@
@@ -0,0 +1,33 @@
+package com.tuinity.tuinity.chunk.light;
+
+import net.minecraft.core.BlockPosition;
@@ -5526,7 +5526,10 @@ index 0000000000000000000000000000000000000000..b8df658c09a6dc739ff3f4d6e18c9cef
+/**
+ * Recommended implementation is {@link VariableBlockLightHandlerImpl}, but you can implement this interface yourself
+ * if you want.
+ *
+ * @deprecated To be removed in 1.17 due to Mojang adding a custom light block.
+ */
+@Deprecated
+public interface VariableBlockLightHandler {
+
+ /**
@@ -11199,7 +11202,7 @@ index df8270c40ed7ce6f628686ff6f4fa4cf96af6738..fa7a78549a9bb92b93c305dc16f43a9a
if (this.remoteControlListener != null) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
index 3644e8b24b082e17752ef52934625416130aaa08..a5fc023312c99e591fc269999c28a766a46f8849 100644
index 3644e8b24b082e17752ef52934625416130aaa08..58e14c174cdf76cdea861fd3d4d1195fa27f888a 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
@@ -8,6 +8,7 @@ import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
@@ -11401,31 +11404,32 @@ index 3644e8b24b082e17752ef52934625416130aaa08..a5fc023312c99e591fc269999c28a766
- if (!this.l.isEmpty()) {
- LongIterator longiterator = this.l.iterator();
+ // Tuinity start - replace level propagator
+ if (!this.ticketLevelUpdates.isEmpty()) {
+ ticket_update_loop:
+ while (!this.ticketLevelUpdates.isEmpty()) {
+ flag = true;
- while (longiterator.hasNext()) {
- long j = longiterator.nextLong();
+ boolean oldPolling = this.pollingPendingChunkUpdates;
+ this.pollingPendingChunkUpdates = true;
+ try {
+ for (java.util.Iterator<Long2IntMap.Entry> iterator = this.ticketLevelUpdates.long2IntEntrySet().fastIterator(); iterator.hasNext(); ) {
+ for (java.util.Iterator<Long2IntMap.Entry> iterator = this.ticketLevelUpdates.long2IntEntrySet().fastIterator(); iterator.hasNext();) {
+ Long2IntMap.Entry entry = iterator.next();
+ long key = entry.getLongKey();
+ int newLevel = entry.getIntValue();
+ PlayerChunk chunk = this.getUpdatingChunk(key);
- while (longiterator.hasNext()) {
- long j = longiterator.nextLong();
+
+ if (chunk == null && newLevel > PlayerChunkMap.GOLDEN_TICKET) {
+ // not loaded and it shouldn't be loaded!
+ continue;
+ }
+
+ int currentLevel = chunk == null ? PlayerChunkMap.GOLDEN_TICKET + 1 : chunk.getTicketLevel();
- if (this.e(j).stream().anyMatch((ticket) -> {
- return ticket.getTicketType() == TicketType.PLAYER;
- })) {
- PlayerChunk playerchunk = playerchunkmap.getUpdatingChunk(j);
+ int currentLevel = chunk == null ? PlayerChunkMap.GOLDEN_TICKET + 1 : chunk.getTicketLevel();
- if (playerchunk == null) {
- throw new IllegalStateException();
+ if (currentLevel == newLevel) {
+ // nothing to do
+ continue;
@@ -11433,7 +11437,9 @@ index 3644e8b24b082e17752ef52934625416130aaa08..a5fc023312c99e591fc269999c28a766
+
+ this.updateTicketLevel(key, newLevel, chunk, currentLevel);
+ }
+
- if (playerchunk == null) {
- throw new IllegalStateException();
+ long recursiveCheck = ++this.ticketLevelUpdateCount;
+ while (!this.ticketLevelUpdates.isEmpty()) {
+ long key = this.ticketLevelUpdates.firstLongKey();
@@ -11464,31 +11470,29 @@ index 3644e8b24b082e17752ef52934625416130aaa08..a5fc023312c99e591fc269999c28a766
+
+ chunk.handleLevelUpdate(playerchunkmap);
+ if (recursiveCheck != this.ticketLevelUpdateCount) {
+ if (!this.ticketLevelUpdates.isEmpty()) {
+ throw new IllegalStateException("Recursive call should have processed updates");
+ }
+ break;
+ // back to the start, we must create player chunks and update the ticket level fields before
+ // processing the actual level updates
+ continue ticket_update_loop;
}
}
- this.l.clear();
- }
+ for (;;) {
+ if (recursiveCheck != this.ticketLevelUpdateCount) {
+ break;
+ continue ticket_update_loop;
+ }
+ PlayerChunk pendingUpdate = this.pendingChunkUpdates.poll();
+ if (pendingUpdate == null) {
+ break;
+ }
+
- return flag;
+ pendingUpdate.handleLevelUpdate(playerchunkmap);
+ }
+ } finally {
+ this.pollingPendingChunkUpdates = oldPolling;
}
- return flag;
+ return true;
+ }
}
+
+ return flag;
@@ -12351,7 +12355,7 @@ index 4ee7070364a8989eece4fa4237b529926821f9c9..f22ab98d2e250081df8949be8a997370
this.a(Long.MAX_VALUE, i, j, flag);
}
diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5bf67f9746 100644
index 0b80569648c1df01aab52d0b8d47028cda925d86..76ac408021c5124fd634682cba97dc63392642f5 100644
--- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
+++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java
@@ -2,6 +2,11 @@ package net.minecraft.server.level;
@@ -12380,7 +12384,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
PlayerChunk playerChunk = playerChunkMap.getVisibleChunk(pair);
if (playerChunk == null) {
return false;
@@ -169,13 +175,184 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -169,13 +175,191 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
private volatile int f = 5;
private final AtomicBoolean g = new AtomicBoolean();
@@ -12451,8 +12455,8 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
+ this.queueUpdate();
+
+ return totalChunks;
}
+ }
+
+ protected final Long2IntOpenHashMap holdingChunks = new Long2IntOpenHashMap();
+ protected final LongArrayList postWorkTicketRelease = new LongArrayList();
+
@@ -12499,10 +12503,23 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
+ }
+
+ return CompletableFuture.completedFuture(playerChunk.getAvailableChunkNow());
+ }
+
}
+ // note: task is discarded if the chunk is not at light status or if the chunk is not lit
+ protected final void scheduleLightWorkTask(int chunkX, int chunkZ, LightEngineThreaded.Update type, Runnable task) {
+ IChunkAccess current = this.getChunk(chunkX, chunkZ);
+
+ if (current == null || !current.getChunkStatus().isAtLeastStatus(ChunkStatus.LIGHT)) {
+ return;
+ }
+
+ if (current.getChunkStatus() != ChunkStatus.FULL) {
+ // do not keep chunk loaded, we are probably in a gen thread
+ // if we proceed to add a ticket the chunk will be loaded, which is not what we want (avoid cascading gen)
+ this.scheduleTask(chunkX, chunkZ, type, task);
+ return;
+ }
+
+ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ this.playerChunkMap.mainInvokingExecutor.execute(() -> {
+ this.scheduleLightWorkTask(chunkX, chunkZ, type, task);
@@ -12510,12 +12527,6 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
+ return;
+ }
+
+ IChunkAccess current = this.getChunk(chunkX, chunkZ);
+
+ if (current == null || !current.isLit() || !current.getChunkStatus().isAtLeastStatus(ChunkStatus.LIGHT)) {
+ return;
+ }
+
+ this.acquireLightWorkChunk(chunkX, chunkZ).whenCompleteAsync((chunk, throwable) -> {
+ if (throwable != null) {
+ LOGGER.fatal("Failed to load light chunk for light work", throwable);
@@ -12565,7 +12576,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
public void close() {}
@Override
@@ -192,6 +369,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -192,6 +376,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
public void a(BlockPosition blockposition) {
BlockPosition blockposition1 = blockposition.immutableCopy();
@@ -12581,7 +12592,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(blockposition.getX() >> 4, blockposition.getZ() >> 4, LightEngineThreaded.Update.POST_UPDATE, SystemUtils.a(() -> {
super.a(blockposition1);
}, () -> {
@@ -200,6 +386,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -200,6 +393,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
}
protected void a(ChunkCoordIntPair chunkcoordintpair) {
@@ -12593,7 +12604,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> {
return 0;
}, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> {
@@ -224,6 +415,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -224,6 +422,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@Override
public void a(SectionPosition sectionposition, boolean flag) {
@@ -12608,7 +12619,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(sectionposition.a(), sectionposition.c(), () -> {
return 0;
}, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> {
@@ -235,6 +434,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -235,6 +441,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@Override
public void a(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
@@ -12620,7 +12631,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(chunkcoordintpair.x, chunkcoordintpair.z, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> {
super.a(chunkcoordintpair, flag);
}, () -> {
@@ -244,6 +448,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -244,6 +455,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@Override
public void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition, @Nullable NibbleArray nibblearray, boolean flag) {
@@ -12632,7 +12643,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(sectionposition.a(), sectionposition.c(), () -> {
return 0;
}, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> {
@@ -253,6 +462,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -253,6 +469,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
}));
}
@@ -12640,7 +12651,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
private void a(int i, int j, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) {
this.a(i, j, this.d.c(ChunkCoordIntPair.pair(i, j)), lightenginethreaded_update, runnable);
}
@@ -265,6 +475,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -265,6 +482,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@Override
public void b(ChunkCoordIntPair chunkcoordintpair, boolean flag) {
@@ -12652,7 +12663,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> {
return 0;
}, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> {
@@ -277,6 +492,35 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -277,6 +499,35 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
public CompletableFuture<IChunkAccess> a(IChunkAccess ichunkaccess, boolean flag) {
ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos();
@@ -12688,7 +12699,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
// Paper start
//ichunkaccess.b(false); // Don't need to disable this
long pair = chunkcoordintpair.pair();
@@ -324,7 +568,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -324,7 +575,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
}
public void queueUpdate() {
@@ -12697,7 +12708,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5b
this.b.a((() -> { // Paper - decompile error
this.b();
this.g.set(false);
@@ -338,17 +582,36 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
@@ -338,17 +589,36 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
private final java.util.List<Runnable> pre = new java.util.ArrayList<>();
private final java.util.List<Runnable> post = new java.util.ArrayList<>();
private void b() {
@@ -14043,7 +14054,7 @@ index 3c804c7b20a14ea6e510810e2be10c1cc89ff5c1..3738c51b5e673c439d88a7ef7f4614f3
return new TicketType<>(s, comparator, 0L);
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 47fbb8df04b2b77e10314666e87eaef621cffb3b..58e61aa19d71011c40c69a691f5644b3e823ad68 100644
index 47fbb8df04b2b77e10314666e87eaef621cffb3b..a42d3c6c227a74d691278a65a9c516f6507b6865 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -168,12 +168,13 @@ import org.bukkit.event.server.MapInitializeEvent;
@@ -14786,11 +14797,11 @@ index 47fbb8df04b2b77e10314666e87eaef621cffb3b..58e61aa19d71011c40c69a691f5644b3
+ }
+ chunk.a(entity);
+ // Tuinity end - gotta be careful here, sync load can teleport entity.
}
+ }
+ // Tuinity start
+ if (entity.inChunk && (oldRegionX != newRegionX || oldRegionZ != newRegionZ)) {
+ this.addNavigatorsIfPathingToRegion(entity);
+ }
}
+ // Tuinity end
}
@@ -15008,19 +15019,6 @@ index 47fbb8df04b2b77e10314666e87eaef621cffb3b..58e61aa19d71011c40c69a691f5644b3
this.tickingEntities = wasTicking; // Paper
}
@@ -2072,8 +2708,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata);
Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1);
+ // Paper start
+ // Tuinity - oh god not for each block set
if (!Objects.equals(optional, optional1)) {
- BlockPosition blockposition1 = blockposition.immutableCopy();
+ BlockPosition blockposition1 = blockposition.immutableCopy(); // Tuinity - oh god not for each block set
+ // Paper end
optional.ifPresent((villageplacetype) -> {
this.getMinecraftServer().execute(() -> {
diff --git a/src/main/java/net/minecraft/server/network/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java
index c67b94840e4c967baebf6eb351df15f0e4ead4be..ed836462123efc6903e406fa926e55e1cedddb95 100644
--- a/src/main/java/net/minecraft/server/network/LoginListener.java
@@ -15035,7 +15033,7 @@ index c67b94840e4c967baebf6eb351df15f0e4ead4be..ed836462123efc6903e406fa926e55e1
throw new IllegalStateException("Protocol error", cryptographyexception);
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca9931629a6d196d 100644
index 8c9e97bb093c0e6297397edc71d72deebbcfbed9..e0c606bb6ecf23f2118a65775c05b437a09826d3 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -542,6 +542,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -15145,7 +15143,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
}
@Override
@@ -1219,7 +1263,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1224,7 +1268,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
if (this.teleportPos != null) {
@@ -15154,7 +15152,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -1257,6 +1301,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1262,6 +1306,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
double currDeltaZ = toZ - prevZ;
double d11 = Math.max(d7 * d7 + d8 * d8 + d9 * d9, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
// Paper end - fix large move vectors killing the server
@@ -15167,7 +15165,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
if (this.player.isSleeping()) {
if (d11 > 1.0D) {
@@ -1289,7 +1339,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1294,7 +1344,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
speed = player.abilities.walkSpeed * 10f;
}
// Paper start - Prevent moving into unloaded chunks
@@ -15176,7 +15174,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet());
return;
}
@@ -1306,11 +1356,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1311,11 +1361,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
@@ -15192,7 +15190,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packetplayinflying.b() && flag) {
@@ -1345,6 +1395,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1350,6 +1400,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
@@ -15200,7 +15198,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move
// Paper start - prevent position desync
if (this.teleportPos != null) {
@@ -1364,12 +1415,23 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1369,12 +1420,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
@@ -15226,7 +15224,7 @@ index 9455cb9bc849a330e57fdc466fb51902631e22d8..53320d1d134305c0b37442dfca993162
this.a(d0, d1, d2, f, f1);
} else {
// CraftBukkit start - fire PlayerMoveEvent
@@ -1456,6 +1518,26 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1461,6 +1523,26 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
@@ -18727,7 +18725,7 @@ index 0fec15e141051863dbf51a2b3e1ace5028cd2fc1..d7757e60402be9939fc2d90ad79b2bb7
public String toString() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
index 7bfac4e852c4a6697435647dab173913df6034e9..c90f530b9cf556da950d8f61156159941815bd99 100644
index 7bfac4e852c4a6697435647dab173913df6034e9..1658f0bb379653c205d08c771a7c23242d50f66d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -54,7 +54,7 @@ public class ProtoChunk implements IChunkAccess {
@@ -18739,7 +18737,7 @@ index 7bfac4e852c4a6697435647dab173913df6034e9..c90f530b9cf556da950d8f6115615994
private final ShortList[] m;
private final Map<StructureGenerator<?>, StructureStart<?>> n;
private final Map<StructureGenerator<?>, LongSet> o;
@@ -66,6 +66,73 @@ public class ProtoChunk implements IChunkAccess {
@@ -66,6 +66,53 @@ public class ProtoChunk implements IChunkAccess {
private volatile boolean u;
final World world; // Paper - Anti-Xray - Add world // Paper - private -> default
@@ -18788,55 +18786,17 @@ index 7bfac4e852c4a6697435647dab173913df6034e9..c90f530b9cf556da950d8f6115615994
+ public void setBlockEmptinessMap(boolean[] emptinessMap) {
+ this.blockEmptinessMap = emptinessMap;
+ }
+
+ private void checkLightSourceLock() {
+ if (!this.lightSourcesLocked.get()) {
+ return;
+ }
+
+ IllegalStateException thr = new IllegalStateException("Concurrent access of light sources by thread '" + Thread.currentThread().getName() + "'");
+ LOGGER.fatal(thr.getMessage(), thr);
+ throw thr;
+ }
+
+ public void lockLightSources() {
+ if (this.lightSourcesLocked.getAndSet(true)) {
+ throw new IllegalStateException("Light sources is already locked!");
+ }
+ }
+
+ public void releaseLightSources() {
+ this.lightSourcesLocked.set(false);
+ }
+ // Tuinity end - rewrite light engine
+
// Paper start - Anti-Xray - Add world
@Deprecated public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) { this(chunkcoordintpair, chunkconverter, null); } // Notice for updates: Please make sure this constructor isn't used anywhere
public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, World world) {
@@ -170,7 +237,9 @@ public class ProtoChunk implements IChunkAccess {
}
public void k(BlockPosition blockposition) {
+ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently
this.l.add(blockposition.immutableCopy());
+ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently
}
@Nullable
@@ -185,26 +254,25 @@ public class ProtoChunk implements IChunkAccess {
return iblockdata;
} else {
if (iblockdata.f() > 0) {
+ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently
this.l.add(new BlockPosition((i & 15) + this.getPos().d(), j, (k & 15) + this.getPos().e()));
+ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently
}
@@ -191,20 +238,17 @@ public class ProtoChunk implements IChunkAccess {
ChunkSection chunksection = this.a(j >> 4);
IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata);
- if (this.g.b(ChunkStatus.FEATURES) && iblockdata != iblockdata1 && (iblockdata.b((IBlockAccess) this, blockposition) != iblockdata1.b((IBlockAccess) this, blockposition) || iblockdata.f() != iblockdata1.f() || iblockdata.e() || iblockdata1.e())) {
+ if ((com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (this.g.b(ChunkStatus.LIGHT) && this.isLit()) : (this.g.b(ChunkStatus.FEATURES))) && iblockdata != iblockdata1 && (iblockdata.b((IBlockAccess) this, blockposition) != iblockdata1.b((IBlockAccess) this, blockposition) || iblockdata.f() != iblockdata1.f() || iblockdata.e() || iblockdata1.e())) { // Tuinity - move block updates to only happen after lighting occurs
+ if ((com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (this.g.b(ChunkStatus.LIGHT)) : (this.g.b(ChunkStatus.FEATURES))) && iblockdata != iblockdata1 && (iblockdata.b((IBlockAccess) this, blockposition) != iblockdata1.b((IBlockAccess) this, blockposition) || iblockdata.f() != iblockdata1.f() || iblockdata.e() || iblockdata1.e())) { // Tuinity - move block updates to only happen after lighting occurs (or during, thanks chunk system)
LightEngine lightengine = this.e();
lightengine.a(blockposition);
@@ -18846,17 +18806,17 @@ index 7bfac4e852c4a6697435647dab173913df6034e9..c90f530b9cf556da950d8f6115615994
+ HeightMap.Type[] enumset = this.getChunkStatus().heightMaps; // Tuinity - reduce iterator creation
EnumSet<HeightMap.Type> enumset1 = null;
- Iterator iterator = enumset.iterator();
-
- HeightMap.Type heightmap_type;
+ // Tuinity - reduce iterator creation
- HeightMap.Type heightmap_type;
-
- while (iterator.hasNext()) {
- heightmap_type = (HeightMap.Type) iterator.next();
+ for (HeightMap.Type heightmap_type : enumset) { // Tuinity - reduce iterator creation
HeightMap heightmap = (HeightMap) this.f.get(heightmap_type);
if (heightmap == null) {
@@ -220,10 +288,9 @@ public class ProtoChunk implements IChunkAccess {
@@ -220,10 +264,9 @@ public class ProtoChunk implements IChunkAccess {
HeightMap.a(this, enumset1);
}

View File

@@ -1651,7 +1651,7 @@ index fa7a78549a9bb92b93c305dc16f43a9ace7f6f43..858bd62d2a17c15ee573c5cd607a876d
this.setPVP(dedicatedserverproperties.pvp);
this.setAllowFlight(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
index a5fc023312c99e591fc269999c28a766a46f8849..fb4d006f86229fd093f1a9ea8cab2add0a4cacfa 100644
index 58e14c174cdf76cdea861fd3d4d1195fa27f888a..fedd0482bd4ff8cc5857a71f509700df4490b8fb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java
@@ -215,7 +215,7 @@ public abstract class ChunkMapDistance {
@@ -1783,7 +1783,7 @@ index b28995ecfd7f45e6b6197be96c418aa0d05d3383..914c7a1b18151f29183cfe9474313ce1
return this.a(i);
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 58e61aa19d71011c40c69a691f5644b3e823ad68..51bb2502e4efb052f55de6eabce07f59e936c9d9 100644
index a42d3c6c227a74d691278a65a9c516f6507b6865..136faf61770011a830cc58259d1dad11830ca808 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1107,7 +1107,28 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -64,7 +64,7 @@ index fb61b6ac167b34486282a24e598020fb96081f28..c42a2813b40152079786dde33231d945
return this.serverStatisticManager;
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 51bb2502e4efb052f55de6eabce07f59e936c9d9..4f1b055dfe38f6a48763f75c1795dcd6dae9d378 100644
index 136faf61770011a830cc58259d1dad11830ca808..5cfab6b49d7b1f13fcf90a175c758f40bccea18a 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1002,7 +1002,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -86,7 +86,7 @@ index 51bb2502e4efb052f55de6eabce07f59e936c9d9..4f1b055dfe38f6a48763f75c1795dcd6
} else if (entityplayer.isSleeping()) {
++j;
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 53320d1d134305c0b37442dfca9931629a6d196d..1f4e45f6e70032bfeeafe30d038e14e052e6ad9d 100644
index e0c606bb6ecf23f2118a65775c05b437a09826d3..85964e7fe2cc96ad3b967dadd9ee5d095ee60e2a 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -399,6 +399,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -111,7 +111,7 @@ index 53320d1d134305c0b37442dfca9931629a6d196d..1f4e45f6e70032bfeeafe30d038e14e0
// Skip the first time we do this
if (true) { // Spigot - don't skip any move events
Location oldTo = to.clone();
@@ -1416,7 +1424,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1421,7 +1429,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
@@ -120,7 +120,7 @@ index 53320d1d134305c0b37442dfca9931629a6d196d..1f4e45f6e70032bfeeafe30d038e14e0
}
this.player.setLocation(d4, d5, d6, f, f1);
@@ -1466,6 +1474,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1471,6 +1479,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();

View File

@@ -67,10 +67,10 @@ index c42a2813b40152079786dde33231d945f3144580..6e3a3a50e01c41b40451bce05015714b
public Scoreboard getScoreboard() {
return getBukkitEntity().getScoreboard().getHandle();
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 1f4e45f6e70032bfeeafe30d038e14e052e6ad9d..568fea41d12f2817b09768ff3b03f76930ad676c 100644
index 85964e7fe2cc96ad3b967dadd9ee5d095ee60e2a..71ab9f136144aa7b06494144671b41e2af85de48 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1896,6 +1896,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1901,6 +1901,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];

View File

@@ -17,7 +17,7 @@ index b4c37287362907b8507d156b978ba5b9d961bb7b..9e6e6636539702507abb78515e002819
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 568fea41d12f2817b09768ff3b03f76930ad676c..54327914233580282ee86e46712d1ba0d176bcc4 100644
index 71ab9f136144aa7b06494144671b41e2af85de48..a0a476d55afdf5ed9850368e99ab25af019075a8 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -233,6 +233,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -50,7 +50,7 @@ index 568fea41d12f2817b09768ff3b03f76930ad676c..54327914233580282ee86e46712d1ba0
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
@@ -3079,6 +3095,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -3084,6 +3100,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@Override
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Zombie horse naturally spawn
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 4f1b055dfe38f6a48763f75c1795dcd6dae9d378..06517693aacc22c7507a09c15739e0779dbb82b0 100644
index 5cfab6b49d7b1f13fcf90a175c758f40bccea18a..da73ce172419224e8737e37b91de1d9bb119cbd0 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace;

View File

@@ -17,10 +17,10 @@ index 6e3a3a50e01c41b40451bce05015714b5a7fe1e3..43900bb788f4baef420de0782c77d74d
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 54327914233580282ee86e46712d1ba0d176bcc4..6451d5a6d491959ea537d11d0dde077578fed381 100644
index a0a476d55afdf5ed9850368e99ab25af019075a8..3559f52e2fa30a8a7600334ece981fe34896bd68 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -3073,6 +3073,15 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -3078,6 +3078,15 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}
// Paper end

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Allow color codes in books
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 6451d5a6d491959ea537d11d0dde077578fed381..e63e7f30db64d30840037d996c153822ce80fbbd 100644
index 3559f52e2fa30a8a7600334ece981fe34896bd68..9998f20c9cc9857612f94f91d27e77da9c632323 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1211,7 +1211,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1216,7 +1216,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (itemstack.getItem() == Items.WRITABLE_BOOK) {
NBTTagList nbttaglist = new NBTTagList();
@@ -18,7 +18,7 @@ index 6451d5a6d491959ea537d11d0dde077578fed381..e63e7f30db64d30840037d996c153822
ItemStack old = itemstack.cloneItemStack(); // CraftBukkit
itemstack.a("pages", (NBTBase) nbttaglist);
this.player.inventory.setItem(i, CraftEventFactory.handleEditBookEvent(player, i, old, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent)
@@ -1229,13 +1230,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1234,13 +1235,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
itemstack1.setTag(nbttagcompound.clone());
}
@@ -35,7 +35,7 @@ index 6451d5a6d491959ea537d11d0dde077578fed381..e63e7f30db64d30840037d996c153822
ChatComponentText chatcomponenttext = new ChatComponentText(s1);
String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext);
@@ -1247,6 +1249,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1252,6 +1254,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Entity lifespan
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index e63e7f30db64d30840037d996c153822ce80fbbd..1c7579a1426c831484fe095d13169c2c47906843 100644
index 9998f20c9cc9857612f94f91d27e77da9c632323..4e43cd877c45a014add62547a4dbfadbd09082d2 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -2458,6 +2458,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2463,6 +2463,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

@@ -5,7 +5,7 @@ Subject: [PATCH] Add no-random-tick block list
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 06517693aacc22c7507a09c15739e0779dbb82b0..9fce5ff2a7980a02510fdc5d1e45d39336d1542a 100644
index da73ce172419224e8737e37b91de1d9bb119cbd0..6da14a9190a0c863e620d6a065bcd8d86456da53 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -532,14 +532,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {

View File

@@ -88,7 +88,7 @@ index da708df0dc50ea02441f9db2bfd52f04d9a8e3da..867a6b7fe1788b20f8d0f4f1e42dd52b
public void playerTick() {
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 9fce5ff2a7980a02510fdc5d1e45d39336d1542a..535cd9faeeb8072b395bff7a3f7ca095afb02df4 100644
index 6da14a9190a0c863e620d6a065bcd8d86456da53..bf08a625d169aae69115a9385dfd6dfb444ce03d 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -216,6 +216,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -100,10 +100,10 @@ index 9fce5ff2a7980a02510fdc5d1e45d39336d1542a..535cd9faeeb8072b395bff7a3f7ca095
return new Throwable(entity + " Added to world at " + new java.util.Date());
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 1c7579a1426c831484fe095d13169c2c47906843..59eedbe9d249fd09673393651a8be76232ab16e9 100644
index 4e43cd877c45a014add62547a4dbfadbd09082d2..bf6c040cfe68f96fa25511967091677abdaf4f0e 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -2467,6 +2467,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -2472,6 +2472,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
this.server.getPluginManager().callEvent(event);

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/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 535cd9faeeb8072b395bff7a3f7ca095afb02df4..64feabfb860ac29a7f7692bcc9972369dbdc2e02 100644
index bf08a625d169aae69115a9385dfd6dfb444ce03d..ed0e5282a0718768ed2e7ab7f56b1dfa82403335 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -92,6 +92,7 @@ import net.minecraft.world.entity.EnumCreatureType;

View File

@@ -18,7 +18,7 @@ index 3086ee023685781d94e2fb99fc8dff5264f01165..74c1047305cac5673e274096709c757e
public PacketPlayOutUpdateTime() {}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 64feabfb860ac29a7f7692bcc9972369dbdc2e02..028911ebe843751080564d90e96306524e5a2e21 100644
index ed0e5282a0718768ed2e7ab7f56b1dfa82403335..5fe1665275cadf276a1560f7b13765e7f191ee61 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -64,6 +64,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutExplosion;

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] PlayerBookTooLargeEvent
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 59eedbe9d249fd09673393651a8be76232ab16e9..f55485094a5b676d8051d1f8d3151340bf176b33 100644
index bf6c040cfe68f96fa25511967091677abdaf4f0e..fbfb3eba79ded3720edf93b3d1c18cbc02c086dd 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1123,6 +1123,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1128,6 +1128,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 59eedbe9d249fd09673393651a8be76232ab16e9..f55485094a5b676d8051d1f8d3151340
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
return;
}
@@ -1135,6 +1136,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1140,6 +1141,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 59eedbe9d249fd09673393651a8be76232ab16e9..f55485094a5b676d8051d1f8d3151340
minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!"));
return;
}
@@ -1158,6 +1160,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1163,6 +1165,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] Dont run with scissors!
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index f55485094a5b676d8051d1f8d3151340bf176b33..03a61aa91191b44284e9b4d02f2c57eaf2de7105 100644
index fbfb3eba79ded3720edf93b3d1c18cbc02c086dd..0bed1f132200876122f92f0ca539e53afa222c14 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1547,6 +1547,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -1552,6 +1552,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.player.fallDistance = 0.0F;
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Config for skipping night
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 028911ebe843751080564d90e96306524e5a2e21..f84066233f551be145a7db2694b3c7cb0c918128 100644
index 5fe1665275cadf276a1560f7b13765e7f191ee61..01d6691ec3284ac0d29025b1a67743f9845bf74b 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1028,7 +1028,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {