even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even even more patches

This commit is contained in:
Jason Penilla 2021-11-25 00:10:26 -08:00 committed by MiniDigger | Martin
parent b39fa92d5d
commit 055b8ab9cf
31 changed files with 96 additions and 97 deletions

View File

@ -7,6 +7,8 @@ Instead of allocating the 4KB for every chunk section, cache it locally and
reuse it for other chunk sections to save on allocations. These allocations add
up very quickly when saving chunks frequently.
1.18: PalettedContainer changed
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index c9e942669458668a184aaec3bc0a5509dd6ab5f0..ac84d49d7819666a89cacbe9ef1199cf22ac2ac3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java

View File

@ -25,7 +25,7 @@ index dcfc726ab96dccc05848219e824ad7612dbfbdab..7713f26d4a97df94c27694d28881d298
return this.isPassenger() ? false : this.saveAsPassenger(nbt);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index ee50ea695585639d0ff184b675f3fb3b205b9f86..0bd800e1aeda87689a6c56ee6fadda381c74a4ff 100644
index ee50ea695585639d0ff184b675f3fb3b205b9f86..5aae88e20bc04560d6ad52cfcaa872d28bfcee8f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1276,5 +1276,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -40,7 +40,7 @@ index ee50ea695585639d0ff184b675f3fb3b205b9f86..0bd800e1aeda87689a6c56ee6fadda38
+ entity.level = ((CraftWorld) location.getWorld()).getHandle();
+ entity.setPos(location.getX(), location.getY(), location.getZ());
+ entity.setRot(location.getYaw(), location.getPitch());
+ return !entity.valid && entity.level.addEntity(entity, reason);
+ return !entity.valid && entity.level.addFreshEntity(entity, reason);
+ }
// Paper end
}

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Use Velocity compression and cipher natives
diff --git a/build.gradle.kts b/build.gradle.kts
index c7ebad49e04c36c27341cabc4a024f170d762f3f..f46f11c32560da6f4955284d93da3dd7e22555a3 100644
index 7d69f9e39361644796895254dfa518ef83d9e578..e572f524046d4799adec7f08b1609d82a64ab94f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -55,6 +55,7 @@ dependencies {
implementation("io.netty:netty-all:4.1.65.Final") // Paper
@@ -49,6 +49,7 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0")
implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
+ implementation("com.velocitypowered:velocity-native:1.1.0-SNAPSHOT") // Paper
@ -17,10 +17,10 @@ index c7ebad49e04c36c27341cabc4a024f170d762f3f..f46f11c32560da6f4955284d93da3dd7
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("junit:junit:4.13.1")
diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java
index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd88ad3ee4d 100644
index 778beb445eac5769b9e4e07b4d1294c50ae2602b..c712fb8193115e1ab71b5e40fb0ccb9413062b03 100644
--- a/src/main/java/net/minecraft/network/CipherDecoder.java
+++ b/src/main/java/net/minecraft/network/CipherDecoder.java
@@ -7,14 +7,30 @@ import java.util.List;
@@ -7,13 +7,29 @@ import java.util.List;
import javax.crypto.Cipher;
public class CipherDecoder extends MessageToMessageDecoder<ByteBuf> {
@ -33,7 +33,6 @@ index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd8
+ this.cipher = cipher; // Paper
}
@Override
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
- list.add(this.cipher.decipher(channelHandlerContext, byteBuf));
+ // Paper start
@ -56,10 +55,10 @@ index 06d545bc7206dd0d56cf27c31935c0f5ed21ef08..201e5eb2d0ec985ea60c59ac89593bd8
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/network/CipherEncoder.java b/src/main/java/net/minecraft/network/CipherEncoder.java
index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd4325531af8a98 100644
index 0f3d502a9680006bcdcd7d272240a2e5c3b46790..5dd7be70603e8754d2625bb9d16900cb01b9c730 100644
--- a/src/main/java/net/minecraft/network/CipherEncoder.java
+++ b/src/main/java/net/minecraft/network/CipherEncoder.java
@@ -4,16 +4,33 @@ import io.netty.buffer.ByteBuf;
@@ -4,15 +4,32 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import javax.crypto.Cipher;
@ -76,7 +75,6 @@ index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd43255
+ this.cipher = cipher; // Paper
}
@Override
- protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) throws Exception {
- this.cipher.encipher(byteBuf, byteBuf2);
+ protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
@ -100,7 +98,7 @@ index 50a7058b18a8ca05363b73eaefbd812ef50d53f1..7319da27dfa5029c9893ec04bfd43255
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/network/CompressionDecoder.java b/src/main/java/net/minecraft/network/CompressionDecoder.java
index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b9069797834ae32613 100644
index b62be99c57b0a5bba0dc29809557d4d247698b13..f4d4ad983baf24d889441541d5a84dc1f49ea4d4 100644
--- a/src/main/java/net/minecraft/network/CompressionDecoder.java
+++ b/src/main/java/net/minecraft/network/CompressionDecoder.java
@@ -12,13 +12,20 @@ public class CompressionDecoder extends ByteToMessageDecoder {
@ -112,20 +110,20 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783
private boolean validateDecompressed;
+ // Paper start
public CompressionDecoder(int compressionThreshold, boolean bl) {
+ this(null, compressionThreshold, bl);
public CompressionDecoder(int compressionThreshold, boolean rejectsBadPackets) {
+ this(null, compressionThreshold, rejectsBadPackets);
+ }
+ public CompressionDecoder(com.velocitypowered.natives.compression.VelocityCompressor compressor, int compressionThreshold, boolean bl) {
+ public CompressionDecoder(com.velocitypowered.natives.compression.VelocityCompressor compressor, int compressionThreshold, boolean rejectsBadPackets) {
this.threshold = compressionThreshold;
this.validateDecompressed = bl;
this.validateDecompressed = rejectsBadPackets;
- this.inflater = new Inflater();
+ this.inflater = compressor == null ? new Inflater() : null;
+ this.compressor = compressor;
+ // Paper end
}
@Override
@@ -39,6 +46,8 @@ public class CompressionDecoder extends ByteToMessageDecoder {
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
@@ -38,6 +45,8 @@ public class CompressionDecoder extends ByteToMessageDecoder {
}
}
@ -134,7 +132,7 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783
byte[] bs = new byte[friendlyByteBuf.readableBytes()];
friendlyByteBuf.readBytes(bs);
this.inflater.setInput(bs);
@@ -46,10 +55,36 @@ public class CompressionDecoder extends ByteToMessageDecoder {
@@ -45,10 +54,36 @@ public class CompressionDecoder extends ByteToMessageDecoder {
this.inflater.inflate(cs);
list.add(Unpooled.wrappedBuffer(cs));
this.inflater.reset();
@ -168,14 +166,14 @@ index efd05c8c1114aab4c237ccbc2e4e935a08c076ee..3569fc49e87b773dce0e59b906979783
+ }
+ // Paper end
+
public void setThreshold(int compressionThreshold, boolean bl) {
public void setThreshold(int compressionThreshold, boolean rejectsBadPackets) {
this.threshold = compressionThreshold;
this.validateDecompressed = bl;
this.validateDecompressed = rejectsBadPackets;
diff --git a/src/main/java/net/minecraft/network/CompressionEncoder.java b/src/main/java/net/minecraft/network/CompressionEncoder.java
index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c06b01730 100644
index 792883afe53d2b7989c25a81c2f9a639d5e21d20..c04379ca8a4db0f4de46ad2b3b3384310eebddf3 100644
--- a/src/main/java/net/minecraft/network/CompressionEncoder.java
+++ b/src/main/java/net/minecraft/network/CompressionEncoder.java
@@ -6,23 +6,38 @@ import io.netty.handler.codec.MessageToByteEncoder;
@@ -6,22 +6,37 @@ import io.netty.handler.codec.MessageToByteEncoder;
import java.util.zip.Deflater;
public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
@ -203,7 +201,6 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c
+ // Paper end
}
@Override
- protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) {
+ protected void encode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, ByteBuf byteBuf2) throws Exception { // Paper
int i = byteBuf.readableBytes();
@ -217,7 +214,7 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c
byte[] bs = new byte[i];
byteBuf.readBytes(bs);
friendlyByteBuf.writeVarInt(bs.length);
@@ -35,10 +50,48 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
@@ -34,10 +49,48 @@ public class CompressionEncoder extends MessageToByteEncoder<ByteBuf> {
}
this.deflater.reset();
@ -267,10 +264,10 @@ index 524c0c674f63cfcb601416a18348f37aabb4e3ff..89bf5066b83e8d79c77c90fce1f7858c
return this.threshold;
}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e64f833f61 100644
index a1aafb037fd340dc93dd2afb758ffc7457d15f84..a7e7fe4be2784ff34f7f8d0b6c2f82d65de8c145 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -657,11 +657,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -628,11 +628,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
return networkmanager;
}
@ -303,16 +300,16 @@ index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e6
public boolean isEncrypted() {
return this.encrypted;
@@ -690,16 +707,17 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -661,16 +678,17 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
public void setupCompression(int compressionThreshold, boolean flag) {
public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) {
if (compressionThreshold >= 0) {
+ com.velocitypowered.natives.compression.VelocityCompressor compressor = com.velocitypowered.natives.util.Natives.compress.get().create(-1); // Paper
if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) {
((CompressionDecoder) this.channel.pipeline().get("decompress")).setThreshold(compressionThreshold, flag);
((CompressionDecoder) this.channel.pipeline().get("decompress")).setThreshold(compressionThreshold, rejectsBadPackets);
} else {
- this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressionThreshold, flag));
+ this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressor, compressionThreshold, flag)); // Paper
- this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressionThreshold, rejectsBadPackets));
+ this.channel.pipeline().addBefore("decoder", "decompress", new CompressionDecoder(compressor, compressionThreshold, rejectsBadPackets)); // Paper
}
if (this.channel.pipeline().get("compress") instanceof CompressionEncoder) {
@ -324,7 +321,7 @@ index 0dae504f49a4a3c66a01eb03896833a010cd5821..5f43459884daea61178c3fdb913204e6
} else {
if (this.channel.pipeline().get("decompress") instanceof CompressionDecoder) {
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 961660f6f9e00b93252519e38b74c66c53388ed2..a7046da8c097254907e01cd17f4107c8744f4a6e 100644
index f7aa0125e4724f1efddf28814f926289c1ae37d4..477aa83c3b342705a8a9b7ab41b2f77008e2e281 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -104,6 +104,11 @@ public class ServerConnectionListener {
@ -340,10 +337,10 @@ index 961660f6f9e00b93252519e38b74c66c53388ed2..a7046da8c097254907e01cd17f4107c8
protected void initChannel(Channel channel) {
try {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 45e77d96f673ce68cf15ce3d45fd1eeffed4d8d8..01fee879c946b6640da34d5890d686f0152437dc 100644
index 45db764f4499ee71bef691d37b604f21da120fe7..d2dd8b802ecea7fd2efe5f07fcef65c26e1adfbc 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -275,12 +275,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@@ -276,12 +276,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
SecretKey secretkey = packet.getSecretKey(privatekey);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Reduce worldgen thread worker count for low core count CPUs
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 69faebb95924946f648cf9f86ff777d3274e3f28..505546d32eea4682452dbac02311433157f6a30e 100644
index f4b8dca0a3cbccb55b23b2408e9a17185fd2896f..faffd25b11836915764add5c6afd63cfe424979a 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -120,7 +120,19 @@ public class Util {
@@ -124,7 +124,19 @@ public class Util {
private static ExecutorService makeExecutor(String s, int priorityModifier) { // Paper - add priority
// Paper start - use simpler thread pool that allows 1 thread

View File

@ -16,17 +16,17 @@ of a chance that we're about to eat a dirtload of chunk load callbacks, thus
making this issue much more of an issue
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 07dfe575dea0f41a75bb9dad0ee2d541e983f6d7..f194dbf29fefab6c94fe5aa11f565349499f4706 100644
index fa1b3762ce94290f3a162f7b9628779cf8a2849c..587d5535c9ad3aa5a6b91d63a52e57b4f3fe008b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -127,46 +127,6 @@ public class CraftChunk implements Chunk {
@@ -128,46 +128,6 @@ public class CraftChunk implements Chunk {
this.getWorld().getChunkAt(x, z); // Transient load for this tick
}
- PersistentEntitySectionManager<net.minecraft.world.entity.Entity> entityManager = this.getCraftWorld().getHandle().entityManager;
- long pair = ChunkPos.asLong(x, z);
-
- if (entityManager.areEntitiesLoaded(pair)) { // PAIL rename isEntitiesLoaded
- if (entityManager.areEntitiesLoaded(pair)) {
- return getCraftWorld().getHandle().getChunkEntities(this.x, this.z); // Paper - optimise this
- }
-
@ -55,7 +55,7 @@ index 07dfe575dea0f41a75bb9dad0ee2d541e983f6d7..f194dbf29fefab6c94fe5aa11f565349
- // now we wait until the entities are loaded,
- // the converting from NBT to entity object is done on the main Thread which is why we wait
- while (!supplier.getAsBoolean()) {
- if (mailbox.size() != 0) { // PAIL rename size
- if (mailbox.size() != 0) {
- mailbox.run();
- } else {
- Thread.yield();

View File

@ -8,7 +8,7 @@ Now in 1.17, this state is _even more_ critical than it was before,
so these must exist to catch stupid plugins.
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095026c4f39 100644
index d963243431e1a75f95e673e1268faa7c2320c6b6..114569250b8bb99ebf5714f334b7a23dc3d3ca37 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
@@ -138,6 +138,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@ -59,14 +59,14 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
long i = chunkPos.toLong();
if (trackingStatus == Visibility.HIDDEN) {
@@ -295,6 +302,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -280,6 +287,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
private boolean storeChunkSections(long chunkPos, Consumer<T> action, boolean callEvent) {
// CraftBukkit end
public void ensureChunkQueuedForLoad(long chunkPos) {
+ org.spigotmc.AsyncCatcher.catchOp("Entity chunk save"); // Paper
PersistentEntitySectionManager.ChunkLoadStatus persistententitysectionmanager_b = (PersistentEntitySectionManager.ChunkLoadStatus) this.chunkLoadStatuses.get(chunkPos);
if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.PENDING) {
if (persistententitysectionmanager_b == PersistentEntitySectionManager.ChunkLoadStatus.FRESH) {
@@ -324,6 +332,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
@ -91,7 +91,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
ChunkEntities<T> chunkentities; // CraftBukkit - decompile error
while ((chunkentities = (ChunkEntities) this.loadingInbox.poll()) != null) {
@@ -383,6 +394,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -377,6 +388,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
public void tick() {
@ -99,7 +99,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
this.processPendingLoads();
this.processUnloads();
}
@@ -403,6 +415,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -397,6 +409,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
public void autoSave() {
@ -107,7 +107,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
this.getAllChunksToSave().forEach((java.util.function.LongConsumer) (i) -> { // CraftBukkit - decompile error
boolean flag = this.chunkVisibility.get(i) == Visibility.HIDDEN;
@@ -417,6 +430,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -411,6 +424,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
}
public void saveAll() {
@ -115,7 +115,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
LongSet longset = this.getAllChunksToSave();
while (!longset.isEmpty()) {
@@ -524,6 +538,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -513,6 +527,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
long i = SectionPos.asLong(blockposition); final long newSectionPos = i; // Paper - diff on change, new position section
if (i != this.currentSectionKey) {
@ -123,7 +123,7 @@ index 28c1f144f2cc8675ed61dc814456859309970480..8cb246863e06c5b95ba1442e2ec47095
PersistentEntitySectionManager.this.entitySliceManager.moveEntity((Entity)this.entity); // Paper
Visibility visibility = this.currentSection.getStatus(); final Visibility oldVisibility = visibility; // Paper - diff on change - this should be OLD section visibility
// Paper start
@@ -589,6 +604,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@@ -578,6 +593,7 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
@Override
public void onRemove(Entity.RemovalReason reason) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 536c53fd1d009b86d2c1c3ca2364f458448bc38c..d40a367670ccea01978cabf7d45f3c1a690662fc 100644
index 8837c9793eb25ad88bdb4b0f6198dc7ae353b9b2..e84969a7b4ed92727a9917b266e5fbe3c9dac1f9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2419,6 +2419,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2406,6 +2406,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 71b4d5f7bbccf56cb519333ad2751d6a953f2c68..029c21d9416520469548293f9a2ec0c056507d05 100644
index 7b6cf326dfab9bd0b13dfc330d143d2efeea9aa1..3eba6962040f33b7b31b16c9de22d90f225710b4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -796,6 +796,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -762,6 +762,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
// Paper end
// CraftBukkit end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure valid vehicle status
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4dfd185e47849c18c552e28370d93b48799d2eb9..11f46c1b8f4c8414e0667d1873542c17d6e01f2a 100644
index 67b482f6cafc55b6b262f23c2b56e4d8c6d089c2..510334bc98d2112489fcece46b660000b14ce6a5 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -509,7 +509,7 @@ public class ServerPlayer extends Player {
@@ -487,7 +487,7 @@ public class ServerPlayer extends Player {
}
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent softlocked end exit portal generation
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index dec99c9d40705a89c395437d0d050f3ab36bc17b..44551fc6fc5888206c1a2da3ece5baa486faa1d5 100644
index 467e2af08698ca40fbbe1fa7b0bafb9561f4fa65..be5952133720bf0ac3483cc2fed334967e6fc0c4 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -409,6 +409,12 @@ public class EndDragonFight {
@@ -412,6 +412,12 @@ public class EndDragonFight {
}
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Mark fish and axolotls from buckets as persistent
diff --git a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
index fc0cd86397b12e42756273a0317164d79ac51937..0701adf77a04a82df4fe1dceee196fee5d820961 100644
index 58428eebf24e328b3faf32ca473be8f19d4f6cca..3484defdfd5a487b11917310d7b1d1543291eee1 100644
--- a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
+++ b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java
@@ -90,7 +90,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
@@ -81,7 +81,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
@Override
public void setFromBucket(boolean fromBucket) {
this.entityData.set(AbstractFish.FROM_BUCKET, fromBucket);
@ -18,10 +18,10 @@ index fc0cd86397b12e42756273a0317164d79ac51937..0701adf77a04a82df4fe1dceee196fee
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index f75333190f8b824e0b52ad2d74739f420644f469..2b8725087fd3bfeca7162bda2783fdacd13a8390 100644
index 67bb476693fa16aa391c120f8acae7c7279efc20..86acf89ce875e215da8469947b382f70e42314b0 100644
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -236,7 +236,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
@@ -237,7 +237,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable {
@Override
public void setFromBucket(boolean fromBucket) {
this.entityData.set(Axolotl.FROM_BUCKET, fromBucket);

View File

@ -12,11 +12,11 @@ time to save, as flush saving performs a full flush at
the end anyways.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4b1797659f6bb5913b105641ecaac38954ce8bc0..65090afbb510231c05db3132ba416502d188f1c0 100644
index 6fc7c1cf269466362dce91fa2cf525e67bee6c15..176065656029a8486f2bfb39bdd4da1e86fbca89 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -950,6 +950,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
@@ -665,6 +665,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void saveAllChunks(boolean flush) {
+ // Paper start - do not overload I/O threads with too much work when saving
@ -32,7 +32,7 @@ index 4b1797659f6bb5913b105641ecaac38954ce8bc0..65090afbb510231c05db3132ba416502
if (flush) {
List<ChunkHolder> list = (List) this.updatingChunks.getVisibleValuesCopy().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper
MutableBoolean mutableboolean = new MutableBoolean();
@@ -972,6 +982,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -687,6 +697,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}).filter((ichunkaccess) -> {
return ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk;
}).filter(this::save).forEach((ichunkaccess) -> {

View File

@ -10,10 +10,10 @@ chunk bans via the large amount of NBT created by unstacking the items.
Fixes GH-5140 and GH-4748.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f1b1e0455806443cd55c350f9b4f74ef8f3a1158..00e302a278c1aef17596a5f1b91230614b13ceb2 100644
index 7eacd9265a8d4cee6e3c3608ab08603a3b6e5a15..a9c7aae7668c3dbc307b26680efba4cd827ba528 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -935,6 +935,11 @@ public class PaperWorldConfig {
@@ -844,6 +844,11 @@ public class PaperWorldConfig {
allowPlayerCrammingDamage = getBoolean("allow-player-cramming-damage", allowPlayerCrammingDamage);
}
@ -26,7 +26,7 @@ index f1b1e0455806443cd55c350f9b4f74ef8f3a1158..00e302a278c1aef17596a5f1b9123061
private Table<String, String, Integer> behaviorTickRates;
private void tickRates() {
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
index db80db9d6382dd4748aa8f27dd3c3d3ae9fe9380..9827229d125addcfec8b0025724b9a4570c40a12 100644
index 276c444a0fddb6962818635d5fc7721a56b30784..4f240fc74fb9551d752855dcdf2a376ff30f536b 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTable.java
@@ -54,9 +54,17 @@ public class LootTable {
@ -58,10 +58,10 @@ index db80db9d6382dd4748aa8f27dd3c3d3ae9fe9380..9827229d125addcfec8b0025724b9a45
public List<ItemStack> getRandomItems(LootContext context) {
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java b/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java
index 6d63c5318e1711a27b254db950ae7576d333ad47..6b5e481980751ed83cda7badc160b738d5c56af9 100644
index 057676201aa2d19032537832849f3857425d357a..b5c6b7280a9c6964e2ad4aa9bd4517146c98e727 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/functions/SetContainerContents.java
@@ -39,7 +39,7 @@ public class SetContainerContents extends LootItemConditionalFunction {
@@ -46,7 +46,7 @@ public class SetContainerContents extends LootItemConditionalFunction {
NonNullList<ItemStack> nonNullList = NonNullList.create();
this.entries.forEach((entry) -> {
entry.expand(context, (choice) -> {

View File

@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..4f164f238177b5e2b18c76b7cc14596ec93409d1 100644
index 96794dcb87c3606e9d112d4159be8be31ad4329e..9cb875b2904c902f3fb0af5b0dd571c3e02aacbd 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1742,6 +1742,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1616,6 +1616,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
@ -19,7 +19,7 @@ index 94857a736d2a16e8ade286c6f2ddf8bd798008eb..4f164f238177b5e2b18c76b7cc14596e
}
public void absMoveTo(double x, double y, double z) {
@@ -1780,6 +1781,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1654,6 +1655,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.setXRot(pitch);
this.setOldPosAndRot();
this.reapplyPosition();

View File

@ -5,7 +5,7 @@ Subject: [PATCH] prevent unintended light block manipulation
diff --git a/src/main/java/net/minecraft/world/level/block/LightBlock.java b/src/main/java/net/minecraft/world/level/block/LightBlock.java
index 7f4acaab7e77f5184c8f8a30ed13b34949780227..59faf48727cfbccacdd5ffa067758466a240e90a 100644
index d648902737350103c2078c80796038a054f16acc..98124ee3bea51e40a9a3cb9014ee84bfc26e91f7 100644
--- a/src/main/java/net/minecraft/world/level/block/LightBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LightBlock.java
@@ -46,6 +46,7 @@ public class LightBlock extends Block implements SimpleWaterloggedBlock {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Dont count named piglins and hoglins towards mob cap
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 0b228b8bcae5ed2840ab244b6de35732f737504d..f316585ccf6baf5e7e514ba3a68b4344e781a82d 100644
index e9a37fc6791366ea421f2766a36dc2e014ab7951..578d7282190ca97368529cd24b578d31399c4867 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -83,7 +83,7 @@ public final class NaturalSpawner {

View File

@ -10,10 +10,10 @@ tile entity type to determine the block state factory and falls back on
the material type of the block at that location.
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 38c4dac82793930777eaf0189c5534234a9162ed..9b4a464fe820effa906af486cf71a74e283ccd4e 100644
index 0e37da7227eaba0d089e5bd136eca088ab2b5eb3..5601d0c2fe635a2a4f073c333531e1a8adf1833c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -232,7 +232,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
@@ -270,7 +270,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
// Paper end
if (this.level == null) return null;
org.bukkit.block.Block block = this.level.getWorld().getBlockAt(this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add config option for logging player ip addresses
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index b3f4ac2ce6f515e406d2f31b1d2429729c9e2b60..0277627e97b51e20470ccf578cee48470e06a34b 100644
index 95b52e9f6d2b87c525b9eac88fae2e73b08bca82..fee271d0f1200df6475db5aa463b921a958648d7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -489,6 +489,11 @@ public class PaperConfig {
@@ -91,6 +91,11 @@ public class PaperConfig {
}
}
@ -52,7 +52,7 @@ index 3962e82d4e4c5f792a37e825891e6960e737452d..dddc97094f0a7847b2818e6ea3b3f6cd
InetSocketAddress virtualHost = com.destroystokyo.paper.network.PaperNetworkClient.prepareVirtualHost(host, port);
com.destroystokyo.paper.event.server.PaperServerListPingEvent event = PaperLegacyStatusClient.processRequest(
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index a7046da8c097254907e01cd17f4107c8744f4a6e..43b085ee4c747a813ec5e2fa965c3369690789c5 100644
index 477aa83c3b342705a8a9b7ab41b2f77008e2e281..a821b68fbe7e172c08540e4b04c857b8b5929120 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -204,7 +204,7 @@ public class ServerConnectionListener {
@ -65,10 +65,10 @@ index a7046da8c097254907e01cd17f4107c8744f4a6e..43b085ee4c747a813ec5e2fa965c3369
networkmanager.send(new ClientboundDisconnectPacket(chatcomponenttext), (future) -> {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 01fee879c946b6640da34d5890d686f0152437dc..494ca8fa8c742d4eac9fb11878d3b3170d850265 100644
index d2dd8b802ecea7fd2efe5f07fcef65c26e1adfbc..33a29890435d6065a2cc4f8e8bf8209c01d5d114 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -223,7 +223,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@@ -224,7 +224,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
public String getUserName() {
@ -81,10 +81,10 @@ index 01fee879c946b6640da34d5890d686f0152437dc..494ca8fa8c742d4eac9fb11878d3b317
@Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 99aa8f2ba2f10578f37de621d1a5a8e222cd70b1..eaa005c1c9b4386bcdbe1d6eb28c3eca7635066c 100644
index dca3b995c02507e5df299abe60f518480ce56d21..600005948a3106f2e074be5e816e4b4b82519a11 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -237,7 +237,7 @@ public abstract class PlayerList {
@@ -236,7 +236,7 @@ public abstract class PlayerList {
String s1 = "local";
if (connection.getRemoteAddress() != null) {
@ -93,7 +93,7 @@ index 99aa8f2ba2f10578f37de621d1a5a8e222cd70b1..eaa005c1c9b4386bcdbe1d6eb28c3eca
}
// Spigot start - spawn location event
@@ -301,7 +301,7 @@ public abstract class PlayerList {
@@ -299,7 +299,7 @@ public abstract class PlayerList {
playerconnection.playerJoinReady = () -> {
postChunkLoadJoin(
player, finalWorldserver, connection, playerconnection,

View File

@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..6bd0afddbcc461149dfe9a5c7a86fff6
+ }
+}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 7ce1ce59eeba8b57cd76b1c9c561733b476e7ebf..b6ee0e709b0f0529b99567bc9b8fb6bfd99bcd8e 100644
index 82cee660a029547eda8abdf4188b9d1fb4ba0d53..38a0fb9a7c4ade9cacfd30dffabfea7e6b773981 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -190,6 +190,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -188,6 +188,16 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Always allow item changing in Fireball
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Fireball.java b/src/main/java/net/minecraft/world/entity/projectile/Fireball.java
index 913edd9f55543332eb891a722d0b98a23637f85c..6a945497cdcd1aa607a1cb7fa9a96c7950902e7d 100644
index 838ba52969550f783d26e626267c556ab09b5f3e..7f4e3dfab421591151fda7ec39d9c00b464d62de 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Fireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Fireball.java
@@ -28,7 +28,7 @@ public abstract class Fireball extends AbstractHurtingProjectile implements Item
@ -14,6 +14,6 @@ index 913edd9f55543332eb891a722d0b98a23637f85c..6a945497cdcd1aa607a1cb7fa9a96c79
public void setItem(ItemStack stack) {
- if (!stack.is(Items.FIRE_CHARGE) || stack.hasTag()) {
+ if (true || !stack.is(Items.FIRE_CHARGE) || stack.hasTag()) { // Paper - always allow item changing
this.getEntityData().set(Fireball.DATA_ITEM_STACK, (ItemStack) Util.make(stack.copy(), (itemstack1) -> { // CraftBukkit - decompile error
this.getEntityData().set(Fireball.DATA_ITEM_STACK, (ItemStack) Util.make(stack.copy(), (itemstack1) -> {
itemstack1.setCount(1);
}));

View File

@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e17bda0d13bae337cfad5ae31b118aa7a85499fc..2ce32495758abf64eeeeeea1cdbf4904be77b697 100644
index 9cb875b2904c902f3fb0af5b0dd571c3e02aacbd..e8ed9ae272ee203b3e8ad036bd4e45aac14f9a6a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -702,7 +702,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -673,7 +673,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
// CraftBukkit start
public void postTick() {
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Call onRemove logic for breakNaturally
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 5154cfffc414e1f6039e55f1a256bbaacb56bc55..6f01af8cc3f9ed4d2eaa3304990ca33f8692a453 100644
index 808bdd0e8d6b679c2eee87c3078a4c3dbcd08b8b..2da1609c42bc85f173ed56767933bcafd5f0422e 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -513,8 +513,14 @@ public class CraftBlock implements Block {
@@ -516,8 +516,14 @@ public class CraftBlock implements Block {
if (triggerEffect) world.levelEvent(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.world.level.block.Block.getId(block.defaultBlockState())); // Paper
result = true;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix anvil prepare event not working with zero xp
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index 593e23c10f2b1616db7256158dfe564b2d289df1..b62c6b56867b645520cb3c3e382ec96d421e7e97 100644
index b40377e882d9cc3571f527e706862e27c59b1fd0..073cec4838b88bf4e7444321a74ab73fff732486 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -60,7 +60,7 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -59,7 +59,7 @@ public class AnvilMenu extends ItemCombinerMenu {
@Override
protected boolean mayPickup(Player player, boolean present) {