More more more work

This commit is contained in:
Nassim Jahnke 2024-12-03 19:54:10 +01:00
parent c60e47fa58
commit bd55e322d8
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
263 changed files with 522 additions and 539 deletions

View file

@ -59,19 +59,19 @@ index 4c8189a2a7edea824545a24dccb376b8eceac001..4623c8acd125dff4919c4e2045b84831
this.level.destroyBlockProgress(this.player.getId(), pos, -1); this.level.destroyBlockProgress(this.player.getId(), pos, -1);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a87ea0f22b44c2fb67fd51bc8c9b0067aacac7de..1be04d0c910ebd58f2eededcdf81c94279d521c7 100644 index a87ea0f22b44c2fb67fd51bc8c9b0067aacac7de..6ea2a25789fe7f90dae7e3de7966c88f39e929a8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1668,6 +1668,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1668,6 +1668,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
case START_DESTROY_BLOCK: case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK: case STOP_DESTROY_BLOCK:
+ // Paper start - Don't allow digging into unloaded chunks + // Paper start - Don't allow digging into unloaded chunks
+ if (this.player.level().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) == null) { + if (this.player.level().getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) == null) {
+ this.player.connection.ackBlockChangesUpTo(packet.getSequence()); + this.player.connection.ackBlockChangesUpTo(packet.getSequence());
+ return; + return;
+ } + }
+ // Paper end - Don't allow digging into unloaded chunks + // Paper end - Don't allow digging into unloaded chunks
this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level().getMaxY(), packet.getSequence()); this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level().getMaxY(), packet.getSequence());
this.player.connection.ackBlockChangesUpTo(packet.getSequence()); this.player.connection.ackBlockChangesUpTo(packet.getSequence());
return; return;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Book size limits
Puts some limits on the size of books. Puts some limits on the size of books.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1be04d0c910ebd58f2eededcdf81c94279d521c7..ca0aa2acbc1316201d7a9c69e4aad8ffe4d61d83 100644 index 6ea2a25789fe7f90dae7e3de7966c88f39e929a8..fb01e24ea6fd1d1f4beabb862c70332f92a80d78 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1117,6 +1117,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1117,6 +1117,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -119,7 +119,7 @@ index 6212d94503023f7bb5ca21785cbb69babe4421c3..642d5c6849debc5a266605b0df30d552
if (commandnode2.canUse(source)) { if (commandnode2.canUse(source)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ca0aa2acbc1316201d7a9c69e4aad8ffe4d61d83..c32dd209e751f8c0e8e73c91a9d4b2c21c59b883 100644 index fb01e24ea6fd1d1f4beabb862c70332f92a80d78..ba10d147705d7d775999d94053cf47b5f481b905 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -778,19 +778,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -778,19 +778,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c32dd209e751f8c0e8e73c91a9d4b2c21c59b883..969fee86d2422cbadfbce18d8bbaf72ff30b5c3d 100644 index ba10d147705d7d775999d94053cf47b5f481b905..9f984834f3da2582f21172f2d52783ad3ff5c46d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -310,6 +310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -310,6 +310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent teleporting dead entities
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 969fee86d2422cbadfbce18d8bbaf72ff30b5c3d..d754eda8e8111886e610bc68e8980b54b43eadb1 100644 index 9f984834f3da2582f21172f2d52783ad3ff5c46d..e9e0a3d0958b309ca17322b11a6612be59ca41a6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1625,6 +1625,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1625,6 +1625,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -13,7 +13,7 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method. of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d754eda8e8111886e610bc68e8980b54b43eadb1..7d7fff91beafd5cf67296efaa06308f1363585a0 100644 index e9e0a3d0958b309ca17322b11a6612be59ca41a6..b7e3c15055681b916482503f6b2370b362863c9c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1413,6 +1413,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1413,6 +1413,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7d7fff91beafd5cf67296efaa06308f1363585a0..a7d1b4d4668b90445e1cba786be74fbd069d3330 100644 index b7e3c15055681b916482503f6b2370b362863c9c..71785d4b2204030dc718c10494840013d5ea72fa 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -201,6 +201,7 @@ import net.minecraft.world.phys.Vec3; @@ -201,6 +201,7 @@ import net.minecraft.world.phys.Vec3;

View file

@ -18,7 +18,7 @@ index 4623c8acd125dff4919c4e2045b848310d785da5..86e4559da2344f228ef4d1c4ac3c115f
return false; return false;
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) { } else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a7d1b4d4668b90445e1cba786be74fbd069d3330..1aec0f76636b1bdc5bb0b300690099ad341873e8 100644 index 71785d4b2204030dc718c10494840013d5ea72fa..51e718812f2696f05824c735962aa885069d68e3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -816,7 +816,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -816,7 +816,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -76,7 +76,7 @@ index fe1975675189c6d1a63c42b7959fa40b5ac95ef8..9a3e73a5c206b78dfcf6f41a47b61434
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1aec0f76636b1bdc5bb0b300690099ad341873e8..11f9853bd48cec693c99edb3d43f0356a0852d5e 100644 index 51e718812f2696f05824c735962aa885069d68e3..20d7b673df5e2def564c9b0daee1e943d7522deb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3366,7 +3366,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3366,7 +3366,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Do not accept invalid client settings
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 11f9853bd48cec693c99edb3d43f0356a0852d5e..417930ad0ffe395e9211a6bf1e6c192af659471b 100644 index 20d7b673df5e2def564c9b0daee1e943d7522deb..d30febf2f37f2b9c864184f272d5949cbe2dc1e8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3352,6 +3352,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3352,6 +3352,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -9,7 +9,7 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported. Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 417930ad0ffe395e9211a6bf1e6c192af659471b..6f96f1522ae552940cf279194bd84630c3e4853c 100644 index d30febf2f37f2b9c864184f272d5949cbe2dc1e8..748458bf569e7b96fd7cea6bd8a29d1735eb7d25 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -680,7 +680,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -680,7 +680,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
Check movement distance also based on current position. Check movement distance also based on current position.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6f96f1522ae552940cf279194bd84630c3e4853c..bfcf0a27ab8d90742b83e9c200f2ec867e2424fe 100644 index 748458bf569e7b96fd7cea6bd8a29d1735eb7d25..8be41f7ea383a27331109813e04d807f38bf6736 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -499,9 +499,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -499,9 +499,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -33,7 +33,7 @@ index 6f96f1522ae552940cf279194bd84630c3e4853c..bfcf0a27ab8d90742b83e9c200f2ec86
+ double currDeltaZ = toZ - fromZ; + double currDeltaZ = toZ - fromZ;
+ double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); + double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
+ double otherFieldX = d3 - this.vehicleLastGoodX; + double otherFieldX = d3 - this.vehicleLastGoodX;
+ double otherFieldY = d4 - this.vehicleLastGoodY - 1.0E-6D; + double otherFieldY = d4 - this.vehicleLastGoodY;
+ double otherFieldZ = d5 - this.vehicleLastGoodZ; + double otherFieldZ = d5 - this.vehicleLastGoodZ;
+ d10 = Math.max(d10, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1); + d10 = Math.max(d10, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
+ // Paper end - fix large move vectors killing the server + // Paper end - fix large move vectors killing the server
@ -48,7 +48,7 @@ index 6f96f1522ae552940cf279194bd84630c3e4853c..bfcf0a27ab8d90742b83e9c200f2ec86
- d7 = d4 - this.vehicleLastGoodY; - d7 = d4 - this.vehicleLastGoodY;
- d8 = d5 - this.vehicleLastGoodZ; - d8 = d5 - this.vehicleLastGoodZ;
+ d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above + d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above
+ d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above + d7 = d4 - this.vehicleLastGoodY; // Paper - diff on change, used for checking large move vectors above
+ d8 = d5 - this.vehicleLastGoodZ; // Paper - diff on change, used for checking large move vectors above + d8 = d5 - this.vehicleLastGoodZ; // Paper - diff on change, used for checking large move vectors above
boolean flag1 = entity.verticalCollisionBelow; boolean flag1 = entity.verticalCollisionBelow;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index bfcf0a27ab8d90742b83e9c200f2ec867e2424fe..65bc724ba824e4b65005f0886de768506a9b4160 100644 index 8be41f7ea383a27331109813e04d807f38bf6736..bf4b64f07f21d816eb866d23b290c2f5e5471c70 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -279,6 +279,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -279,6 +279,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling mob spawner spawn egg transformation
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
index ac35651e4f415243a0f84cca9a4f776b1f1623a5..9956ed42df55daa6d97fd6e3ab5368dad91cfaf0 100644 index ecc3193b4276a083461780eddab9f7b1c34175a8..cc7e9b87e919b4ef8cf77cd780c890fd9a9cfa50 100644
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java --- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java +++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
@@ -68,6 +68,8 @@ public class SpawnEggItem extends Item { @@ -63,6 +63,8 @@ public class SpawnEggItem extends Item {
EntityType entitytypes; EntityType entitytypes;
if (tileentity instanceof Spawner) { if (tileentity instanceof Spawner) {
@ -16,4 +16,4 @@ index ac35651e4f415243a0f84cca9a4f776b1f1623a5..9956ed42df55daa6d97fd6e3ab5368da
+ +
Spawner spawner = (Spawner) tileentity; Spawner spawner = (Spawner) tileentity;
entitytypes = this.getType(itemstack); entitytypes = this.getType(world.registryAccess(), itemstack);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerFlowerPotManipulateEvent
diff --git a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
index c6de1b6587b300404c38c27f566c80de11bc0814..bee71ed48365694c488af88317a738fc6a4e5893 100644 index 4c7723b9f369391ab253c4a60510e318fb7cfce3..f45a8741e6707f033b0205eee03c59aa889565e1 100644
--- a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java --- a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
@@ -61,6 +61,18 @@ public class FlowerPotBlock extends Block { @@ -63,6 +63,18 @@ public class FlowerPotBlock extends Block {
} else if (!this.isEmpty()) { } else if (!this.isEmpty()) {
return InteractionResult.CONSUME; return InteractionResult.CONSUME;
} else { } else {
@ -27,7 +27,7 @@ index c6de1b6587b300404c38c27f566c80de11bc0814..bee71ed48365694c488af88317a738fc
world.setBlock(pos, blockState, 3); world.setBlock(pos, blockState, 3);
world.gameEvent(player, GameEvent.BLOCK_CHANGE, pos); world.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
player.awardStat(Stats.POT_FLOWER); player.awardStat(Stats.POT_FLOWER);
@@ -75,6 +87,18 @@ public class FlowerPotBlock extends Block { @@ -77,6 +89,18 @@ public class FlowerPotBlock extends Block {
return InteractionResult.CONSUME; return InteractionResult.CONSUME;
} else { } else {
ItemStack itemStack = new ItemStack(this.potted); ItemStack itemStack = new ItemStack(this.potted);

View file

@ -11,19 +11,19 @@ Subject: [PATCH] Fix interact event not being called sometimes
Co-authored-by: Moulberry <james.jenour@protonmail.com> Co-authored-by: Moulberry <james.jenour@protonmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f2c1893677004b1699beb16ebfcbe9816aad2a78..03e87e35f4478d948602569c319a7b5a0e938cd5 100644 index bf4b64f07f21d816eb866d23b290c2f5e5471c70..3d4ab22077eb358168b2959c3d1beb10b7104ab7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1785,7 +1785,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1842,7 +1842,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else if (enuminteractionresult instanceof InteractionResult.Success) { } else if (enuminteractionresult instanceof InteractionResult.Success) {
InteractionResult.Success enuminteractionresult_d = (InteractionResult.Success) enuminteractionresult; InteractionResult.Success enuminteractionresult_d = (InteractionResult.Success) enuminteractionresult;
- if (enuminteractionresult_d.swingSource() == InteractionResult.SwingSource.SERVER) { - if (enuminteractionresult_d.swingSource() == InteractionResult.SwingSource.SERVER) {
+ if (enuminteractionresult_d.swingSource() == InteractionResult.SwingSource.SERVER && !this.player.gameMode.interactResult) { + if (enuminteractionresult_d.swingSource() == InteractionResult.SwingSource.SERVER && !this.player.gameMode.interactResult) {
this.player.swing(enumhand, true); this.player.swing(enumhand, true);
}
} }
} @@ -2466,13 +2466,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2406,13 +2406,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange()); double d3 = Math.max(this.player.blockInteractionRange(), this.player.entityInteractionRange());
// SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time
// SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities // SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityLoadCrossbowEvent
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
index 710181cf04563f06690eee5b46a5a0d84844ac29..52c40eafc77e50a6fd21b9a7a250cea501f11690 100644 index a81e2f1e5abc20a95c562c1b9b1f7af489eaaaab..be1902a307a54434644b242b429ad47c271d2a0c 100644
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
@@ -89,7 +89,14 @@ public class CrossbowItem extends ProjectileWeaponItem { @@ -90,7 +90,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
public boolean releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) { public boolean releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) {
int i = this.getUseDuration(stack, user) - remainingUseTicks; int i = this.getUseDuration(stack, user) - remainingUseTicks;
float f = getPowerForTime(i, stack, user); float f = getPowerForTime(i, stack, user);
@ -24,7 +24,7 @@ index 710181cf04563f06690eee5b46a5a0d84844ac29..52c40eafc77e50a6fd21b9a7a250cea5
CrossbowItem.ChargingSounds chargingSounds = this.getChargingSounds(stack); CrossbowItem.ChargingSounds chargingSounds = this.getChargingSounds(stack);
chargingSounds.end() chargingSounds.end()
.ifPresent( .ifPresent(
@@ -110,8 +117,14 @@ public class CrossbowItem extends ProjectileWeaponItem { @@ -111,8 +118,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
} }
} }

View file

@ -64,7 +64,7 @@ index 7ea92a0b0f5d4eb6bd873e61c42bc0499d5d2028..09299e45552eb998fd02123c3921c065
public int get() { public int get() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8d2d5cae4de522676cc4764f8b36f93744f3c890..8fc7192b8eb56fb1411391153e37ae654af9b68e 100644 index b877904bd18c96a4a7e49fb3e1aba2b6109f15cd..69464a4fe467128121fe1a9ba08c9c7154e22c7f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1884,9 +1884,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -1884,9 +1884,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8364a52db57b43ba503cb8109c35a261de347109..6a10ef4f5e6d19ffbadd43cb3a606084b69b5ce9 100644 index c036c391172ffb4b14b7a5f77776a68e3670775c..d6fe710a4e3784ba38776a0496eac7fa702aed88 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2150,7 +2150,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2150,7 +2150,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add world settings for mobs picking up loot
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 8f63e27d904abb33492daf627d48d33d1193deef..723a098eabcc632caeb096f39c90e4e0581edc35 100644 index b7b567192f14ca8bac24b533dcbb5b5bd4f5a3aa..7c80c79a87ec438d0891c5c977e162f272d80039 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -150,7 +150,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -152,7 +152,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
this.populateDefaultEquipmentSlots(randomsource, difficulty); this.populateDefaultEquipmentSlots(randomsource, difficulty);
this.populateDefaultEquipmentEnchantments(world, randomsource, difficulty); this.populateDefaultEquipmentEnchantments(world, randomsource, difficulty);
this.reassessWeaponGoal(); this.reassessWeaponGoal();

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockFailedDispenseEvent
diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
index f4510b8e14d0b9997907ce1d1368ba3b3b5daf3e..f4853a5ff8a45efcda2d7781c1fa897c47d8ea46 100644 index 975c02461bb88d71a0e3efe91838fad3fd346587..d915ef1030728a3f6ff303977784097b712238d4 100644
--- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
@@ -98,8 +98,10 @@ public class DispenserBlock extends BaseEntityBlock { @@ -98,8 +98,10 @@ public class DispenserBlock extends BaseEntityBlock {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b2777f49f658914d2211edd29ac3661f57ef18e0..e4710b95685508a54d552cf916cbaa56ee48a11a 100644 index 1ed0940d8bdc4210992a335b3691c1cd3a13580a..e56f9e823f9460854c6f0f2f05422136c12aabba 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1780,6 +1780,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1786,6 +1786,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}); });
optional1.ifPresent((holder) -> { optional1.ifPresent((holder) -> {
this.getServer().execute(() -> { this.getServer().execute(() -> {

View file

@ -32,7 +32,7 @@ index fbe10666c4ec6caa95aa38a6f99ccca700e9a4d2..061bba184c8bc2569ce1d413435ec136
public boolean isWhiteListed(GameProfile profile) { public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0ec00d64947359c08d2315ebaebd76aee548b512..a9ba1ae986985e1af132e651059d4aee261779a3 100644 index 0aaea6091c5828782ed606d250423f3d75b9b27f..c93ec7e97c9af44ed75e7ea4fb1c6c58c2b6bc1a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -684,6 +684,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -684,6 +684,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -761,10 +761,10 @@ index 3f72e30b57fb2a4231e22a2234729408c1240af4..4638ba98dbbdb0f880337347be85a6e0
LOADERS.put(resourceLocation, () -> initializer.run(registry)); LOADERS.put(resourceLocation, () -> initializer.run(registry));
WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix WRITABLE_REGISTRY.register((ResourceKey)key, registry, RegistrationInfo.BUILT_IN); // Paper - decompile fix
diff --git a/src/main/java/net/minecraft/resources/RegistryDataLoader.java b/src/main/java/net/minecraft/resources/RegistryDataLoader.java diff --git a/src/main/java/net/minecraft/resources/RegistryDataLoader.java b/src/main/java/net/minecraft/resources/RegistryDataLoader.java
index a75f6fefdd72188fa8d16df2b5cbb34c4129f52d..61774165a25209ee6d26cf8d80149b220c3874e6 100644 index b9b9ec93442423e99def9b2c51aedc955a7799d5..b8c1840eeda982c0c6350e49fae2784a599ef3ce 100644
--- a/src/main/java/net/minecraft/resources/RegistryDataLoader.java --- a/src/main/java/net/minecraft/resources/RegistryDataLoader.java
+++ b/src/main/java/net/minecraft/resources/RegistryDataLoader.java +++ b/src/main/java/net/minecraft/resources/RegistryDataLoader.java
@@ -351,6 +351,7 @@ public class RegistryDataLoader { @@ -349,6 +349,7 @@ public class RegistryDataLoader {
RegistryDataLoader.Loader<T> create(Lifecycle lifecycle, Map<ResourceKey<?>, Exception> errors) { RegistryDataLoader.Loader<T> create(Lifecycle lifecycle, Map<ResourceKey<?>, Exception> errors) {
WritableRegistry<T> writableRegistry = new MappedRegistry<>(this.key, lifecycle); WritableRegistry<T> writableRegistry = new MappedRegistry<>(this.key, lifecycle);
@ -773,7 +773,7 @@ index a75f6fefdd72188fa8d16df2b5cbb34c4129f52d..61774165a25209ee6d26cf8d80149b22
} }
diff --git a/src/main/java/net/minecraft/server/ReloadableServerRegistries.java b/src/main/java/net/minecraft/server/ReloadableServerRegistries.java diff --git a/src/main/java/net/minecraft/server/ReloadableServerRegistries.java b/src/main/java/net/minecraft/server/ReloadableServerRegistries.java
index 8e8d6214adbd21a221147f0fc0d91cd9c06a080c..6fddef967b6314ca0158f5bd4b8898670ea5e9ec 100644 index 257cfce009fb6fcd24d1fddfd8001e9b2a8ae1ae..185752185549ebd5f431932b63d8e5fea50a2cb2 100644
--- a/src/main/java/net/minecraft/server/ReloadableServerRegistries.java --- a/src/main/java/net/minecraft/server/ReloadableServerRegistries.java
+++ b/src/main/java/net/minecraft/server/ReloadableServerRegistries.java +++ b/src/main/java/net/minecraft/server/ReloadableServerRegistries.java
@@ -64,6 +64,7 @@ public class ReloadableServerRegistries { @@ -64,6 +64,7 @@ public class ReloadableServerRegistries {
@ -782,8 +782,8 @@ index 8e8d6214adbd21a221147f0fc0d91cd9c06a080c..6fddef967b6314ca0158f5bd4b889867
WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental()); WritableRegistry<T> writableRegistry = new MappedRegistry<>(type.registryKey(), Lifecycle.experimental());
+ io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry + io.papermc.paper.registry.PaperRegistryAccess.instance().registerReloadableRegistry(type.registryKey(), writableRegistry); // Paper - register reloadable registry
Map<ResourceLocation, T> map = new HashMap<>(); Map<ResourceLocation, T> map = new HashMap<>();
String string = Registries.elementsDirPath(type.registryKey()); SimpleJsonResourceReloadListener.scanDirectory(resourceManager, type.registryKey(), ops, type.codec(), map);
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, ops, type.codec(), map); map.forEach((id, value) -> writableRegistry.register(ResourceKey.create(type.registryKey(), id), (T)value, DEFAULT_REGISTRATION_INFO));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
index 0d091c7b328fb70a82f5b5ded7dec61b7cd3d59a..249f0dcad04a35244da6dab837a461bb42aad00a 100644 index 0d091c7b328fb70a82f5b5ded7dec61b7cd3d59a..249f0dcad04a35244da6dab837a461bb42aad00a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add StructuresLocateEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
index 115deba41ec48143570489e8494785a3a48cd789..e3c5a49611d584fbd19a44da5aa78ff6d7c43881 100644 index 0acf8b62ddb5e005f8f861558934e8afc8673725..416b1afcbab093f45900a4d55708609ba5a7de7a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
@@ -126,6 +126,24 @@ public abstract class ChunkGenerator { @@ -127,6 +127,24 @@ public abstract class ChunkGenerator {
@Nullable @Nullable
public Pair<BlockPos, Holder<Structure>> findNearestMapStructure(ServerLevel world, HolderSet<Structure> structures, BlockPos center, int radius, boolean skipReferencedStructures) { public Pair<BlockPos, Holder<Structure>> findNearestMapStructure(ServerLevel world, HolderSet<Structure> structures, BlockPos center, int radius, boolean skipReferencedStructures) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e08d20b65fdea46be94228b4b10ba1cb7b3beeb6..0832d43ca1be2581bcda9fc32d3359689d8c0384 100644 index 341cfedfb06ac0a18b8cca1df5aa4f72b1455737..e556788a7c5e38c6ed293d566f75ef6501b7464c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2025,6 +2025,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2048,6 +2048,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void push(Entity entity) { public void push(Entity entity) {
if (!this.isPassengerOfSameVehicle(entity)) { if (!this.isPassengerOfSameVehicle(entity)) {
if (!entity.noPhysics && !this.noPhysics) { if (!entity.noPhysics && !this.noPhysics) {
@ -17,7 +17,7 @@ index e08d20b65fdea46be94228b4b10ba1cb7b3beeb6..0832d43ca1be2581bcda9fc32d335968
double d1 = entity.getZ() - this.getZ(); double d1 = entity.getZ() - this.getZ();
double d2 = Mth.absMax(d0, d1); double d2 = Mth.absMax(d0, d1);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
index a9661ab34bc98c19d525eb4b60b1f0d05d73241e..3590f4bc1af829cdb6e0cfdc8fa6857197b9219e 100644 index e2bbb4b519010cbabc0796c5b2f749b4fac32bb7..8a5b3ebc875e5c71ca0d57a52e01b74cfee408b6 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
@@ -196,6 +196,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { @@ -196,6 +196,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Configurable max leash distance
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
index e53c3b53ea9c0932f0f049bf76f1f6de0432506a..dc39ecc3e1aada638337d31bfe68b400c6454af7 100644 index 4692704b58d1b73a45f1d587782dc706da94a6e6..5e67402340a81a965b0b3af88307d36500c2dc6b 100644
--- a/src/main/java/net/minecraft/world/entity/Leashable.java --- a/src/main/java/net/minecraft/world/entity/Leashable.java
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java +++ b/src/main/java/net/minecraft/world/entity/Leashable.java
@@ -180,7 +180,7 @@ public interface Leashable { @@ -201,7 +201,7 @@ public interface Leashable {
return; return;
} }
@ -18,15 +18,15 @@ index e53c3b53ea9c0932f0f049bf76f1f6de0432506a..dc39ecc3e1aada638337d31bfe68b400
} else if ((double) f > 6.0D) { } else if ((double) f > 6.0D) {
((Leashable) entity).elasticRangeLeashBehaviour(entity1, f); ((Leashable) entity).elasticRangeLeashBehaviour(entity1, f);
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index f239ab65d914ee9ec819e112f0a0466a06a77929..d2785628368b65854b6e1f35005c478d490a2f8c 100644 index 144ef3cc71bb265646e48f3a5f10d971b5768154..9c6e2124da7c2358d2d524c52d3e77422f15f6e5 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java --- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -98,7 +98,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @@ -101,7 +101,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@Override @Override
public boolean handleLeashAtDistance(Entity leashHolder, float distance) { public boolean handleLeashAtDistance(Entity leashHolder, float distance) {
if (this.isInSittingPose()) { if (this.isInSittingPose()) {
- if (distance > 10.0F) { - if (distance > 10.0F) {
+ if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance + if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
this.dropLeash(true, true); this.dropLeash();
} }

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add BlockPreDispenseEvent
diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
index f4853a5ff8a45efcda2d7781c1fa897c47d8ea46..a02f24448b002824b068278fa427003008c0d0f1 100644 index d915ef1030728a3f6ff303977784097b712238d4..6a8e0df7d0150ad8dbbffcd5f49c4623a259e680 100644
--- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
@@ -107,6 +107,7 @@ public class DispenserBlock extends BaseEntityBlock { @@ -107,6 +107,7 @@ public class DispenserBlock extends BaseEntityBlock {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerChangeBeaconEffectEvent
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
index a191cef8037d94c7e93f79b86fc26ebefae95d8f..cad0b581c992edc5cd312a727695a443e26e96d8 100644 index cb063d6e7f4d34eab3a5f52b11f671e0c99bbd40..c257660c79516a5919032b771fc3ac9575e9db9d 100644
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
@@ -157,12 +157,25 @@ public class BeaconMenu extends AbstractContainerMenu { @@ -157,12 +157,25 @@ public class BeaconMenu extends AbstractContainerMenu {

View file

@ -0,0 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 27 Nov 2020 17:14:27 -0800
Subject: [PATCH] Add PlayerStonecutterRecipeSelectEvent
Co-Authored-By: MiniDigger <admin@benndorf.dev>
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
index 46d6bc61ba54ab23eb35915073cfd5a3ab0111f1..74ea3f0154733ed4f096d88403fe011cca663e02 100644
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
@@ -64,7 +64,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
public StonecutterMenu(int syncId, Inventory playerInventory, final ContainerLevelAccess context) {
super(MenuType.STONECUTTER, syncId);
- this.selectedRecipeIndex = DataSlot.standalone();
+ this.selectedRecipeIndex = DataSlot.shared(new int[1], 0); // Paper - Add PlayerStonecutterRecipeSelectEvent
this.recipesForInput = SelectableRecipe.SingleInputSet.empty();
this.input = ItemStack.EMPTY;
this.slotUpdateListener = () -> {
@@ -153,8 +153,34 @@ public class StonecutterMenu extends AbstractContainerMenu {
return false;
} else {
if (this.isValidRecipeIndex(id)) {
- this.selectedRecipeIndex.set(id);
- this.setupResultSlot(id);
+ // Paper start - Add PlayerStonecutterRecipeSelectEvent
+ int recipeIndex = id;
+ this.selectedRecipeIndex.set(recipeIndex);
+ this.selectedRecipeIndex.checkAndClearUpdateFlag(); // mark as changed
+ paperEventBlock: if (this.isValidRecipeIndex(id)) {
+ final Optional<RecipeHolder<StonecutterRecipe>> recipe = this.recipesForInput.entries().get(id).recipe().recipe();
+ if (recipe.isEmpty()) break paperEventBlock; // The recipe selected does not have an actual server recipe (presumably its the empty one). Cannot call the event, just break.
+
+ io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent event = new io.papermc.paper.event.player.PlayerStonecutterRecipeSelectEvent((Player) player.getBukkitEntity(), getBukkitView().getTopInventory(), (org.bukkit.inventory.StonecuttingRecipe) recipe.get().toBukkitRecipe());
+ if (!event.callEvent()) {
+ player.containerMenu.sendAllDataToRemote();
+ return false;
+ }
+
+ net.minecraft.resources.ResourceLocation key = org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getStonecuttingRecipe().getKey());
+ if (!recipe.get().id().location().equals(key)) { // If the recipe did NOT stay the same
+ for (int newRecipeIndex = 0; newRecipeIndex < this.recipesForInput.entries().size(); newRecipeIndex++) {
+ if (this.recipesForInput.entries().get(newRecipeIndex).recipe().recipe().filter(r -> r.id().location().equals(key)).isPresent()) {
+ recipeIndex = newRecipeIndex;
+ break;
+ }
+ }
+ }
+ }
+ player.containerMenu.sendAllDataToRemote();
+ this.selectedRecipeIndex.set(recipeIndex); // set new index, so that listeners can read it
+ this.setupResultSlot(recipeIndex);
+ // Paper end - Add PlayerStonecutterRecipeSelectEvent
}
return true;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expand EntityUnleashEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0832d43ca1be2581bcda9fc32d3359689d8c0384..bac2165553262bc3b26cddd607d83ca15807e9d2 100644 index e556788a7c5e38c6ed293d566f75ef6501b7464c..a18e716a8c1c6f1fe23dcd3f4da033da95417e22 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2690,12 +2690,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2715,12 +2715,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (leashable.getLeashHolder() == player) { if (leashable.getLeashHolder() == player) {
if (!this.level().isClientSide()) { if (!this.level().isClientSide()) {
// CraftBukkit start - fire PlayerUnleashEntityEvent // CraftBukkit start - fire PlayerUnleashEntityEvent
@ -21,46 +21,50 @@ index 0832d43ca1be2581bcda9fc32d3359689d8c0384..bac2165553262bc3b26cddd607d83ca1
return InteractionResult.PASS; return InteractionResult.PASS;
} }
// CraftBukkit end // CraftBukkit end
- leashable.dropLeash(true, !player.hasInfiniteMaterials()); - if (player.hasInfiniteMaterials()) {
+ leashable.dropLeash(true, event.isDropLeash()); // Paper - Expand EntityUnleashEvent + if (!event.isDropLeash()) { // Paper - Expand EntityUnleashEvent
this.gameEvent(GameEvent.ENTITY_INTERACT, player); leashable.removeLeash();
} } else {
leashable.dropLeash();
@@ -3660,9 +3663,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3690,9 +3693,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
protected void removeAfterChangingDimensions() { protected void removeAfterChangingDimensions() {
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
- if (this instanceof Leashable leashable) { - if (this instanceof Leashable leashable) {
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit - this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
- leashable.dropLeash(true, false); - leashable.removeLeash();
+ if (this instanceof Leashable leashable && leashable.isLeashed()) { // Paper - only call if it is leashed + if (this instanceof Leashable leashable && leashable.isLeashed()) { // Paper - only call if it is leashed
+ // Paper start - Expand EntityUnleashEvent + // Paper start - Expand EntityUnleashEvent
+ final EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, false); // CraftBukkit + final EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, false); // CraftBukkit
+ event.callEvent(); + event.callEvent();
+ leashable.dropLeash(true, event.isDropLeash()); + if (!event.isDropLeash()) {
+ leashable.removeLeash();
+ } else {
+ leashable.dropLeash();
+ }
+ // Paper end - Expand EntityUnleashEvent + // Paper end - Expand EntityUnleashEvent
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
index dc39ecc3e1aada638337d31bfe68b400c6454af7..b7721ed97305d1cd6725935f965c2effc1bef5a1 100644 index 5e67402340a81a965b0b3af88307d36500c2dc6b..68b869c5d76aeb390a05b053eef70486bd4126fd 100644
--- a/src/main/java/net/minecraft/world/entity/Leashable.java --- a/src/main/java/net/minecraft/world/entity/Leashable.java
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java +++ b/src/main/java/net/minecraft/world/entity/Leashable.java
@@ -167,8 +167,11 @@ public interface Leashable { @@ -184,8 +184,11 @@ public interface Leashable {
if (leashable_a != null && leashable_a.leashHolder != null) { if (leashable_a != null && leashable_a.leashHolder != null) {
if (!entity.isAlive() || !leashable_a.leashHolder.isAlive()) { if (!entity.isAlive() || !leashable_a.leashHolder.isAlive()) {
- world.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit - world.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
- Leashable.dropLeash(entity, true, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin - if (world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved) { // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+ // Paper start - Expand EntityUnleashEvent + // Paper start - Expand EntityUnleashEvent
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved); + final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, world.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !entity.pluginRemoved);
+ event.callEvent(); + event.callEvent();
+ Leashable.dropLeash(entity, true, event.isDropLeash()); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin + if (event.isDropLeash()) { // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
+ // Paper end - Expand EntityUnleashEvent + // Paper end - Expand EntityUnleashEvent
} ((Leashable) entity).dropLeash();
} else {
Entity entity1 = ((Leashable) entity).getLeashHolder(); ((Leashable) entity).removeLeash();
@@ -199,11 +202,16 @@ public interface Leashable { @@ -220,11 +223,20 @@ public interface Leashable {
default void leashTooFarBehaviour() { default void leashTooFarBehaviour() {
// CraftBukkit start // CraftBukkit start
@ -71,51 +75,63 @@ index dc39ecc3e1aada638337d31bfe68b400c6454af7..b7721ed97305d1cd6725935f965c2eff
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true); + final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true);
+ if (!event.callEvent()) return; + if (!event.callEvent()) return;
+ dropLeash = event.isDropLeash(); + dropLeash = event.isDropLeash();
+ // Paper end - Expand EntityUnleashEvent
} }
// CraftBukkit end // CraftBukkit end
- this.dropLeash(true, true); - this.dropLeash();
+ this.dropLeash(true, dropLeash); // Paper + if (dropLeash) {
+ this.dropLeash();
+ } else {
+ this.removeLeash();
+ }
+ // Paper end - Expand EntityUnleashEvent
} }
default void closeRangeLeashBehaviour(Entity entity) {} default void closeRangeLeashBehaviour(Entity entity) {}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index a8ab3c03a6f96658ce2a3f5758225954a36de6a9..ac7a52e77fd2fcbe9f95709b95ba54f8c2a6514b 100644 index b3c27cdf7d336404403fe09553080835f2d3de49..7d3e165bae2c00737019689b7bf1e74ad2517270 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1613,8 +1613,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -1612,8 +1612,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
boolean flag1 = super.startRiding(entity, force); boolean flag1 = super.startRiding(entity, force);
if (flag1 && this.isLeashed()) { if (flag1 && this.isLeashed()) {
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit - this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
- this.dropLeash(true, true); - this.dropLeash();
+ // Paper start - Expand EntityUnleashEvent + // Paper start - Expand EntityUnleashEvent
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, true); + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, true);
+ if (!event.callEvent()) { return flag1; } + if (!event.callEvent()) { return flag1; }
+ this.dropLeash(true, event.isDropLeash()); + if (event.isDropLeash()) {
+ this.dropLeash();
+ } else {
+ this.removeLeash();
+ }
+ // Paper end - Expand EntityUnleashEvent + // Paper end - Expand EntityUnleashEvent
} }
return flag1; return flag1;
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index d2785628368b65854b6e1f35005c478d490a2f8c..cd565d1a8dab8d45196e4d29cab3d93a3ca619eb 100644 index 9c6e2124da7c2358d2d524c52d3e77422f15f6e5..45a340fddcec48dfb796f4515a500452adb30c59 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java --- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -99,7 +99,11 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @@ -102,7 +102,15 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
public boolean handleLeashAtDistance(Entity leashHolder, float distance) { public boolean handleLeashAtDistance(Entity leashHolder, float distance) {
if (this.isInSittingPose()) { if (this.isInSittingPose()) {
if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
- this.dropLeash(true, true); - this.dropLeash();
+ // Paper start - Expand EntityUnleashEvent + // Paper start - Expand EntityUnleashEvent
+ org.bukkit.event.entity.EntityUnleashEvent event = new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE, true); + org.bukkit.event.entity.EntityUnleashEvent event = new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE, true);
+ if (!event.callEvent()) return false; + if (!event.callEvent()) return false;
+ this.dropLeash(true, event.isDropLeash()); + if (event.isDropLeash()) {
+ this.dropLeash();
+ } else {
+ this.removeLeash();
+ }
+ // Paper end - Expand EntityUnleashEvent + // Paper end - Expand EntityUnleashEvent
} }
return false; return false;
diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
index 4b44830ef5d08887274ebb39e2780606fe3a76b4..d3a7953a3f42a0020342845e9107c6991637b050 100644 index d4955d4174e5c2920d5cccaa4494db2c27284660..d06ec03ad16630f2dfd81cf9f32542bd1c2592de 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java --- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
@@ -119,13 +119,18 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity { @@ -119,13 +119,18 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity {
@ -134,11 +150,11 @@ index 4b44830ef5d08887274ebb39e2780606fe3a76b4..d3a7953a3f42a0020342845e9107c699
continue; continue;
} }
} }
- leashable1.dropLeash(true, !player.getAbilities().instabuild); // false -> survival mode boolean - if (player.getAbilities().instabuild){
+ leashable1.dropLeash(true, dropLeash); // false -> survival mode boolean // Paper - Expand EntityUnleashEvent + if (!dropLeash) { // Paper - Expand EntityUnleashEvent
// CraftBukkit end leashable1.removeLeash();
flag1 = true; } else {
} leashable1.dropLeash();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 6d1d3451054af05e2381d70d71b99869f37c0901..697c69b60aa45b6a229f3bec77dc728e50a895ce 100644 index 6d1d3451054af05e2381d70d71b99869f37c0901..697c69b60aa45b6a229f3bec77dc728e50a895ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Reset shield blocking on dimension change
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 46de03e961438faaf44b8bd39aed7535daef1bf9..5571e89876317e7b4b304bb1ec9c31078d0f69ee 100644 index 6344947f445e1da19d21de67a51b88de65eceb7a..f046b8e6307079878d94eab615a5463a807e6c6c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1613,6 +1613,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -1604,6 +1604,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
this.level().getCraftServer().getPluginManager().callEvent(changeEvent); this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
// CraftBukkit end // CraftBukkit end

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6a10ef4f5e6d19ffbadd43cb3a606084b69b5ce9..6920554bfaaadfa230f329784f0d9e0f12835745 100644 index d6fe710a4e3784ba38776a0496eac7fa702aed88..b28a2756429270414f8ef89539f91ce0595d13c6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1647,6 +1647,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1647,6 +1647,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -17,10 +17,10 @@ index 6a10ef4f5e6d19ffbadd43cb3a606084b69b5ce9..6920554bfaaadfa230f329784f0d9e0f
gameprofilerfiller.push(() -> { gameprofilerfiller.push(() -> {
String s = String.valueOf(worldserver); String s = String.valueOf(worldserver);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e4710b95685508a54d552cf916cbaa56ee48a11a..9d62a76a82097f1fc934312e6b764c66c673a8e8 100644 index e56f9e823f9460854c6f0f2f05422136c12aabba..de948bb8903c48e0431c1a46f5aac4fc1828b581 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -229,6 +229,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -230,6 +230,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid; public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
@ -29,10 +29,10 @@ index e4710b95685508a54d552cf916cbaa56ee48a11a..9d62a76a82097f1fc934312e6b764c66
public LevelChunk getChunkIfLoaded(int x, int z) { public LevelChunk getChunkIfLoaded(int x, int z) {
return this.chunkSource.getChunk(x, z, false); return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b725bd297ed40aa8ccf3ad77f8652b39980efcf2..6b5d8328ae9ce819f6ff1b9ba109a67ce8f121e8 100644 index d7e5c2d5935a86bab9987c36df8e1b957fe90ba0..2d3f418b5a7a5414ca5be8525146e480add51635 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3627,6 +3627,20 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3638,6 +3638,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.pushEntities(); this.pushEntities();
gameprofilerfiller.pop(); gameprofilerfiller.pop();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9d62a76a82097f1fc934312e6b764c66c673a8e8..d8eeedcc52ae939246caa61a6bacd3b15c8ae239 100644 index de948bb8903c48e0431c1a46f5aac4fc1828b581..dc2b8d8e62cf1405191aa4fc8d4fa548c7249032 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1362,6 +1362,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1363,6 +1363,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.getChunkSource().blockChanged(pos); this.getChunkSource().blockChanged(pos);
this.pathTypesByPosCache.invalidate(pos); this.pathTypesByPosCache.invalidate(pos);
@ -16,7 +16,7 @@ index 9d62a76a82097f1fc934312e6b764c66c673a8e8..d8eeedcc52ae939246caa61a6bacd3b1
VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
@@ -1403,6 +1404,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -1404,6 +1405,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
} }
} }

View file

@ -7,7 +7,7 @@ Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is
critical section for much of the server, including the lighting engine. critical section for much of the server, including the lighting engine.
diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
index 69ccada8ea78c05d3fb886222698c07dee421506..3fde5abde736b2c19d8819d9aec0397a0245ccd1 100644 index acecb0e9df1b157579d2b438abf1568d7672b570..690e1d2394e68356c56a39ac083cc53ee0388d71 100644
--- a/src/main/java/net/minecraft/core/Direction.java --- a/src/main/java/net/minecraft/core/Direction.java
+++ b/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java
@@ -57,6 +57,12 @@ public enum Direction implements StringRepresentable { @@ -57,6 +57,12 @@ public enum Direction implements StringRepresentable {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] living entity allow attribute registration
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 3a6c55a7f07e8871a77c91679732dd63db604004..94d04a20f97405e02d7cccaabadc7a7e86e336f7 100644 index b3707ca404245ae048ddba4ce2190c0801b474d4..fb967ac7b3e7828301f08a7fe9b039441cf7da30 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -149,4 +149,12 @@ public class AttributeMap { @@ -162,4 +162,12 @@ public class AttributeMap {
} }
} }
} }
@ -38,7 +38,7 @@ index 5678d2007d5adf45dec0638c5dd848b601801814..0a7ed5a4f1644a70d8f98ad7a6962b81
+ // Paper end - living entity allow attribute registration + // Paper end - living entity allow attribute registration
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index ff3b53eff8f5fc1e02e7b30d59ff27dfe8f5d431..5749e2b5174be23633c8a811baec8c05da12e3e2 100644 index 1ca252f36500322d56c0c12b6ec80c069214c0e8..a4be1eea356ba99358d707381df70032ded42140 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -775,6 +775,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -775,6 +775,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,12 +5,12 @@ Subject: [PATCH] Add PlayerNameEntityEvent
diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java
index dd5aa4bbf2e7bab3be1c3582b090fdf0fa3fb0df..000d1863bfba98b5132dfc6743362d687b2f54f3 100644 index 244663ff31bdb29bbff8b3ffd9fe99279b173296..df9cdcb9544a171a5a07c65ba0150933fb70d5fc 100644
--- a/src/main/java/net/minecraft/world/item/NameTagItem.java --- a/src/main/java/net/minecraft/world/item/NameTagItem.java
+++ b/src/main/java/net/minecraft/world/item/NameTagItem.java +++ b/src/main/java/net/minecraft/world/item/NameTagItem.java
@@ -18,8 +18,13 @@ public class NameTagItem extends Item { @@ -18,8 +18,13 @@ public class NameTagItem extends Item {
Component component = stack.get(DataComponents.CUSTOM_NAME); Component component = stack.get(DataComponents.CUSTOM_NAME);
if (component != null && entity.getType().canSerialize()) { if (component != null && entity.getType().canSerialize() && entity.canBeNameTagged()) {
if (!user.level().isClientSide && entity.isAlive()) { if (!user.level().isClientSide && entity.isAlive()) {
- entity.setCustomName(component); - entity.setCustomName(component);
- if (entity instanceof Mob mob) { - if (entity instanceof Mob mob) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add recipe to cook events
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 187f380eae3948eb5e37e8703db6ea785aaf833d..08b94e5e31ca835c1f9eaefbab07076c91deadeb 100644 index b2c0de191fdc84d4a007373309a5df81cacd5466..4acf487f9a5f3fa828ee76f9708d6a2ae28707e1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -332,7 +332,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -327,7 +327,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);

View file

@ -5,15 +5,15 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 03e87e35f4478d948602569c319a7b5a0e938cd5..03ab4e27e141716e1c9ae92d41f42cfb7a48db66 100644 index 3d4ab22077eb358168b2959c3d1beb10b7104ab7..e23b1f98c4ea066e1c35e15454ed524a20f65b4d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1770,7 +1770,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1827,7 +1827,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int i = this.player.level().getMaxY(); int i = this.player.level().getMaxY();
if (blockposition.getY() <= i) { if (blockposition.getY() <= i) {
- if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) { - if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
+ if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection + if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706 this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock); InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);

View file

@ -67,7 +67,7 @@ index 5ae8f646083fb580ac8d28fcbfe8ed2208b45d09..3cfacacd1d8fd17ec4b54936afd81248
// Check if a World already exists with the UID. // Check if a World already exists with the UID.
if (this.getWorld(world.getUID()) != null) { if (this.getWorld(world.getUID()) != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index e88b384e3d640dd77e419611f3c0e588fbf4f406..28948975c5adcf78d9c0e0b6fb63db981a369a77 100644 index 5f0fd1d4fe419435ac7293106c0ebb5382d64074..8d9380b50424546bcebdfa868635f94c8efa5899 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -538,6 +538,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -538,6 +538,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] forced whitelist: use configurable kick message
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6920554bfaaadfa230f329784f0d9e0f12835745..c0cf470807ddeaecd63946cc9e3bdbe18fdb7092 100644 index b28a2756429270414f8ef89539f91ce0595d13c6..0ab92fb362729108beca6bc0230fb6fb06ca6280 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2325,7 +2325,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2325,7 +2325,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 03ab4e27e141716e1c9ae92d41f42cfb7a48db66..1b4a19eb510c3efa2f2459554bed5e16bcb23430 100644 index e23b1f98c4ea066e1c35e15454ed524a20f65b4d..ddf2b9c6de079f55c3ac8836345c1e681f23fcac 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1165,7 +1165,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1219,7 +1219,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList(); List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList();
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1)); itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Expose protocol version
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 28948975c5adcf78d9c0e0b6fb63db981a369a77..25a206cf1eb07e826b549aacf9a4d0fbffb32177 100644 index 8d9380b50424546bcebdfa868635f94c8efa5899..30f2ddb66385718304b4b0302f7efcafd54bc42a 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -543,6 +543,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -543,6 +543,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -9,10 +9,10 @@ till their item is switched.
This patch clears the active item when the event is cancelled This patch clears the active item when the event is cancelled
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6b5d8328ae9ce819f6ff1b9ba109a67ce8f121e8..123f9a7675c1f194273fff0fdd804cb6ab409201 100644 index 2d3f418b5a7a5414ca5be8525146e480add51635..509139ab9a3070c8c96d14fdc4d07bc229b41bd6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4142,6 +4142,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -4149,6 +4149,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
entityPlayer.getBukkitEntity().updateInventory(); entityPlayer.getBukkitEntity().updateInventory();
entityPlayer.getBukkitEntity().updateScaledHealth(); entityPlayer.getBukkitEntity().updateScaledHealth();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Set area affect cloud rotation
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
index e0ff8e8ed03a6a78c9fd8e4630c8b95600bee10a..f8ce309c6ec8c294378d2cd9bc542e43338f8376 100644 index 0ebcf7ed1cb9e896de5fbac60afdb937ba86d15c..95c2ef53e6c5574e69614d8058eb3ed94ab6b0d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
@@ -428,7 +428,7 @@ public final class CraftEntityTypes { @@ -426,7 +426,7 @@ public final class CraftEntityTypes {
register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new,
spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper
)); ));

View file

@ -5,10 +5,10 @@ Subject: [PATCH] add consumeFuel to FurnaceBurnEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index 08b94e5e31ca835c1f9eaefbab07076c91deadeb..9c1267df7057caa3500c7a9e6c705ea58c2b5e11 100644 index 4acf487f9a5f3fa828ee76f9708d6a2ae28707e1..7b63e2fd004ae452c7350f0b2d8d7c57a42891ea 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -255,7 +255,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -250,7 +250,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) { if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) {
// CraftBukkit end // CraftBukkit end
flag1 = true; flag1 = true;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1b4a19eb510c3efa2f2459554bed5e16bcb23430..2bd2f1cdf3467cacee55094d43bd3eccf61b9aa7 100644 index ddf2b9c6de079f55c3ac8836345c1e681f23fcac..47f925707d8756796ce169b7cbd8f2410b0b7104 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1954,6 +1954,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2014,6 +2014,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.isImmobile()) return; // CraftBukkit if (this.player.isImmobile()) return; // CraftBukkit
if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerDeepSleepEvent
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 78bb666dbc5ccd84820e1c7b382249510dd5795c..57850f16a681af4fc302895c7608247675b44ab4 100644 index 136a6b8e2065c7bada396e0f54f91c841a85c3d8..13f21822d0eb1d167b9b71addb46c4f508301c8d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -262,6 +262,13 @@ public abstract class Player extends LivingEntity { @@ -265,6 +265,13 @@ public abstract class Player extends LivingEntity {
if (this.isSleeping()) { if (this.isSleeping()) {
++this.sleepCounter; ++this.sleepCounter;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] More World API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8fc7192b8eb56fb1411391153e37ae654af9b68e..956f7206f26325ed1be639bd6289991332763a70 100644 index 69464a4fe467128121fe1a9ba08c9c7154e22c7f..f20717ee4505d28fa44f0f9ced5c71ae75c8a6d9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2130,6 +2130,28 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -2130,6 +2130,28 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerBedFailEnterEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
index bee869b62af5fc845425458b713d1efaf8b28b51..b09fa473426a6c7e006a071827e5a68560d6c685 100644 index 1e5f1b4c746fe9a105c2771c785976aae70a9a3e..30db6ae29e2fe03866dfa656330f7341e0a3f9ab 100644
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
@@ -120,14 +120,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock @@ -120,14 +120,23 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 5571e89876317e7b4b304bb1ec9c31078d0f69ee..563b20033a5280091f93ab72a8600369035b6a0a 100644 index f046b8e6307079878d94eab615a5463a807e6c6c..c22dce8b30c8af3e37b497b0d97c6ceef0295883 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1456,7 +1456,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -1447,7 +1447,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
Player respawnPlayer = this.getBukkitEntity(); Player respawnPlayer = this.getBukkitEntity();
Location location = CraftLocation.toBukkit(teleportTransition.position(), teleportTransition.newLevel().getWorld(), teleportTransition.yRot(), teleportTransition.xRot()); Location location = CraftLocation.toBukkit(teleportTransition.position(), teleportTransition.newLevel().getWorld(), teleportTransition.yRot(), teleportTransition.xRot());

View file

@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..0d7e7db9e37ef0183c32b217bd944fb4
+ COMPRESSION_DISABLED + COMPRESSION_DISABLED
+} +}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index ba41646a5edb57c4d9766df08bbc57016e2de189..2b86415e4ea197c5c44c23072c9a1cda595544a8 100644 index 448bde861b4190a678a8ccb63cade43c4a3d6ad9..f5fe87103ce53ba07b43c6c10fc9dafcc5ea4958 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -680,6 +680,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -680,6 +680,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityBlockStorage#clearEntities()
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
index 0fab8826e14af9184f07bc1262555a71effcd84b..8224d5bddb7f7893dee09222a673af54791abcfa 100644 index 333189cf01ce571993e8152f5851b8c362ba4b70..801528022c902714138c264bc4d05ef0df85912e 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
@@ -152,6 +152,11 @@ public class BeehiveBlockEntity extends BlockEntity { @@ -152,6 +152,11 @@ public class BeehiveBlockEntity extends BlockEntity {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 723a098eabcc632caeb096f39c90e4e0581edc35..0cb179bc28cc863b09a079b37b957744f26f3e1d 100644 index 7c80c79a87ec438d0891c5c977e162f272d80039..cb89a95e6ff9db73c912bba04d27657683135153 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -95,9 +95,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -97,9 +97,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
abstract SoundEvent getStepSound(); abstract SoundEvent getStepSound();
@ -26,7 +26,7 @@ index 723a098eabcc632caeb096f39c90e4e0581edc35..0cb179bc28cc863b09a079b37b957744
if (flag) { if (flag) {
ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
@@ -236,7 +242,20 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -243,7 +249,20 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt); super.readAdditionalSaveData(nbt);
this.reassessWeaponGoal(); this.reassessWeaponGoal();
@ -48,7 +48,7 @@ index 723a098eabcc632caeb096f39c90e4e0581edc35..0cb179bc28cc863b09a079b37b957744
@Override @Override
public void setItemSlot(EquipmentSlot slot, ItemStack stack) { public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index d0820b3a561db7e1e5667594b2b6ea13214dfa58..150fd890ac65097b5434fd88e8d2b24a89dca79a 100644 index 1171a4e45bed0455b29b2cf012fbc2883b16d061..4ff75412452649ebf106ef591cb97dc7ac8175e7 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -139,7 +139,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -139,7 +139,7 @@ public class Phantom extends FlyingMob implements Enemy {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add environment variable to disable server gui
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 59d623dd45c395552ffd99e6fa744c0f71d94998..cf071610ed662c4a309cc26ee73a74fa490d846f 100644 index da61f3a4ec9bb9726d9d45552b8eada3f87d9e58..c551f6827476b6432ebe1d48e7ca5d168df305c5 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -318,6 +318,7 @@ public class Main { @@ -320,6 +320,7 @@ public class Main {
*/ */
boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");

View file

@ -45,10 +45,10 @@ index 7f09119bc7d661e08a960dd2bd46006efe752d3e..d1da3600dc07107309b20ebe6e7c0c4d
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 563b20033a5280091f93ab72a8600369035b6a0a..bbbf48a43c48ba0db7ee74a8b9a1f1beeb211f68 100644 index c22dce8b30c8af3e37b497b0d97c6ceef0295883..2125f9dc87dbf31a66004dc859788f584e099e73 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2335,10 +2335,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -2315,10 +2315,18 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} }
public boolean setGameMode(GameType gameMode) { public boolean setGameMode(GameType gameMode) {
@ -69,7 +69,7 @@ index 563b20033a5280091f93ab72a8600369035b6a0a..bbbf48a43c48ba0db7ee74a8b9a1f1be
} else { } else {
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId())); this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId()));
if (gameMode == GameType.SPECTATOR) { if (gameMode == GameType.SPECTATOR) {
@@ -2354,7 +2362,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -2334,7 +2342,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
this.onUpdateAbilities(); this.onUpdateAbilities();
this.updateEffectVisibility(); this.updateEffectVisibility();
@ -78,7 +78,7 @@ index 563b20033a5280091f93ab72a8600369035b6a0a..bbbf48a43c48ba0db7ee74a8b9a1f1be
} }
} }
@@ -2803,6 +2811,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -2783,6 +2791,16 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
} }
public void loadGameTypes(@Nullable CompoundTag nbt) { public void loadGameTypes(@Nullable CompoundTag nbt) {
@ -134,10 +134,10 @@ index 546be40a8e4470fb5a6686072cdd342cdaa6fe15..e000a918230187f6841b03b7b0dd7368
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2bd2f1cdf3467cacee55094d43bd3eccf61b9aa7..c3b4b800c5a34afa03ed7c31e14f26ca16109982 100644 index 47f925707d8756796ce169b7cbd8f2410b0b7104..f97bbed2b0098fb9b9b0a9e7c2a124e1370608cc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2751,7 +2751,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2818,7 +2818,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit
this.resetPosition(); this.resetPosition();
if (this.server.isHardcore()) { if (this.server.isHardcore()) {
@ -147,7 +147,7 @@ index 2bd2f1cdf3467cacee55094d43bd3eccf61b9aa7..c3b4b800c5a34afa03ed7c31e14f26ca
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a9ba1ae986985e1af132e651059d4aee261779a3..6f8e56117a78b9bd41668580414c2b4ebe2e1ec7 100644 index c93ec7e97c9af44ed75e7ea4fb1c6c58c2b6bc1a..0b151a66d7419653088526bd72119ebd2d6dd18e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1671,7 +1671,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1671,7 +1671,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack repair check API
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 25a206cf1eb07e826b549aacf9a4d0fbffb32177..079cb08b92061bb14952cf4ad2bda61e154f4438 100644 index 30f2ddb66385718304b4b0302f7efcafd54bc42a..fa4e8cb2d53e0ac4e15a8188454ceed0afafe503 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -548,6 +548,14 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -548,6 +548,14 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -5,18 +5,18 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c3b4b800c5a34afa03ed7c31e14f26ca16109982..cad988c90749183e3af01b319206d49a8734ac15 100644 index f97bbed2b0098fb9b9b0a9e7c2a124e1370608cc..10376b24e3a09c023a73a21a4499415589795423 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1757,6 +1757,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1814,6 +1814,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (itemstack.isItemEnabled(worldserver.enabledFeatures())) { if (itemstack.isItemEnabled(worldserver.enabledFeatures())) {
BlockHitResult movingobjectpositionblock = packet.getHitResult(); BlockHitResult movingobjectpositionblock = packet.getHitResult();
Vec3 vec3d = movingobjectpositionblock.getLocation(); Vec3 vec3d = movingobjectpositionblock.getLocation();
+ // Paper start - improve distance check + // Paper start - improve distance check
+ if (!Double.isFinite(vec3d.x) || !Double.isFinite(vec3d.y) || !Double.isFinite(vec3d.z)) { + if (!Double.isFinite(vec3d.x) || !Double.isFinite(vec3d.y) || !Double.isFinite(vec3d.z)) {
+ return; + return;
+ } + }
+ // Paper end - improve distance check + // Paper end - improve distance check
BlockPos blockposition = movingobjectpositionblock.getBlockPos(); BlockPos blockposition = movingobjectpositionblock.getBlockPos();
if (this.player.canInteractWithBlock(blockposition, 1.0D)) { if (this.player.canInteractWithBlock(blockposition, 1.0D)) {

View file

@ -8,7 +8,7 @@ in order to fire the BlockDispenseEvent. This patch corrects
that. that.
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index c63a86af95849cacdfed3b061122b90651fd5bdf..5793569ae8a088f21b0d8d6771a5099b1e88be09 100644 index ab002c2a5cfb029bd61b7d8e0548fd135b95cdcc..780f83d50aac70c819608f4c79c08ef34664d7b0 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -330,7 +330,13 @@ public interface DispenseItemBehavior { @@ -330,7 +330,13 @@ public interface DispenseItemBehavior {

View file

@ -87,10 +87,10 @@ index d6d7f1c446ba5507f67038ff27775ba75156f4a7..c63c194c44646e6bc1a5942655278701
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cad988c90749183e3af01b319206d49a8734ac15..34258a58ea7b75363eff825e3db27832d3559557 100644 index 10376b24e3a09c023a73a21a4499415589795423..979f2aa4716cd5ddc35e2d81a3de82af4b4c296e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2566,6 +2566,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2631,6 +2631,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start // Spigot Start
public SocketAddress getRawAddress() public SocketAddress getRawAddress()
{ {

View file

@ -77,7 +77,7 @@ index de1b64e0cbe7f2de63f04262428c9e6ec340916e..c045b1cccf0047dbef8c04d5a28d31d5
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
index 1cc807a7a73ea35919259d7d8370fa3bcc44fb2f..18d4020017d76303d3179fad8974574777ea6305 100644 index e03e2f1d84b4f12d78974b90eb4b741818cdac17..1b94f26e78db062f80d806b82f714a815b4710ff 100644
--- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
@@ -112,6 +112,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @@ -112,6 +112,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
@ -89,7 +89,7 @@ index 1cc807a7a73ea35919259d7d8370fa3bcc44fb2f..18d4020017d76303d3179fad89745747
entity.hurt(world.damageSources().campfire().directBlock(world, pos), (float) this.fireDamage); // CraftBukkit entity.hurt(world.damageSources().campfire().directBlock(world, pos), (float) this.fireDamage); // CraftBukkit
} }
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
index 93c9f093eef0568a3816412fa497c12487ff04e3..79ebc37a779bf6cba66a34a7604f819e95fd86a2 100644 index 91dd550de860fd16585218814eae0b9dc877c77d..6fe896079c0ae622976c2055f8d13cda5ed3ea3d 100644
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
@@ -174,6 +174,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @@ -174,6 +174,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
@ -113,7 +113,7 @@ index 1e2f56b5c40c3dc72bc38354160f8e7de1f4f5cf..fa1c4defd0d4e4cd888eb26eed131539
if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) { if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) {
this.checkPressed(world, pos, state); this.checkPressed(world, pos, state);
diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
index ae32d7819ee45d6d334be19c78f8150d104fb787..bb4800c60ac05f2db8821737b2b884ea99b64799 100644 index b27b09fcb895b72c51335bdcb095f0f3bd3a190b..58b2454ac5bd3400559aba3c64f228f41f6218ae 100644
--- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java --- a/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndGatewayBlock.java
@@ -92,6 +92,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal { @@ -92,6 +92,7 @@ public class EndGatewayBlock extends BaseEntityBlock implements Portal {
@ -125,7 +125,7 @@ index ae32d7819ee45d6d334be19c78f8150d104fb787..bb4800c60ac05f2db8821737b2b884ea
BlockEntity tileentity = world.getBlockEntity(pos); BlockEntity tileentity = world.getBlockEntity(pos);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index 5744944455b08d45a7c0fe2289414b50b6c0d66a..6ed6c2123ed4c54f191ed8cf6da72109fb95eb69 100644 index 8887d35d188510cf10da3dc46b0b56373ac346bd..8ca226641588a88c8b068a7acac9d7e92b077144 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java --- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -68,6 +68,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal { @@ -68,6 +68,7 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
@ -161,10 +161,10 @@ index 3ddf43a8afe8f00ca910d7838356dfc6d007a4f9..5c360c6768582c1a35431739613e9b40
this.maybeDoSlideAchievement(entity, pos); this.maybeDoSlideAchievement(entity, pos);
this.doSlideMovement(entity); this.doSlideMovement(entity);
diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
index 19ace6115a80f2696746bd98a5465259e4f1a633..b61324fe162f32817b87e4adb80df57b9433259f 100644 index 882e7e6c7fa77eef109f8203f22edfa9536a96f8..9da02e643948aaea91307e28eb83177aa5d0ecec 100644
--- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java --- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java +++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
@@ -183,6 +183,7 @@ public class HopperBlock extends BaseEntityBlock { @@ -178,6 +178,7 @@ public class HopperBlock extends BaseEntityBlock {
@Override @Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -197,7 +197,7 @@ index c088d713e80f16ead333ea5283f7f95a2de08523..4ab73a083eba2ad3e12526af0a0dbcfb
if (entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) { if (entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start - moved down // CraftBukkit start - moved down
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
index dea13596eb8a3b7bc69c19545b2227b4c45ed241..c00507fa7af579263caed67dafc2ea9eba09512b 100644 index e404722c119631e31c0519111ccd5f1682c2638d..151025a407a07271bc205955f0ce06f84231563b 100644
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java --- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -115,6 +115,7 @@ public class NetherPortalBlock extends Block implements Portal { @@ -115,6 +115,7 @@ public class NetherPortalBlock extends Block implements Portal {
@ -233,7 +233,7 @@ index aaf9350a096022c87ccb788d657c1ae6a7b53a47..53f1a7ed6b4bd6e2d8460531226aabf2
entity.makeStuckInBlock(state, new Vec3(0.8999999761581421D, 1.5D, 0.8999999761581421D)); entity.makeStuckInBlock(state, new Vec3(0.8999999761581421D, 1.5D, 0.8999999761581421D));
if (world.isClientSide) { if (world.isClientSide) {
diff --git a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
index 3cd04097fc698d29d395c0ee28aadaec7c87b5a2..d61173ae5818fe6b507823fd9ddc0584cd5809b9 100644 index a044a2d7e5cb7027394c95c495c59530bc5e18ce..265c85413da04dbc7292a0af934a8b665b2fced5 100644
--- a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java --- a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
@@ -84,6 +84,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock @@ -84,6 +84,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock
@ -281,7 +281,7 @@ index 4b621793da3d6fbc44f90df863b099ba992930fb..fc209fab3ed1ccb35706a5529ec23ad8
if (entity instanceof LivingEntity livingEntity && livingEntity.hasEffect(MobEffects.WEAVING)) { if (entity instanceof LivingEntity livingEntity && livingEntity.hasEffect(MobEffects.WEAVING)) {
vec3 = new Vec3(0.5, 0.25, 0.5); vec3 = new Vec3(0.5, 0.25, 0.5);
diff --git a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
index 2f67e26b4c030c1747346f6d02076bd21f11d32e..b481d67e3646242b8eb1b9890e09b56b9406fecb 100644 index b42924ebdd0f5369151b8a37f0070dec7f402073..8b79b2b7766d873b7e689309d936982fc1724686 100644
--- a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java --- a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java +++ b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
@@ -63,6 +63,7 @@ public class WitherRoseBlock extends FlowerBlock { @@ -63,6 +63,7 @@ public class WitherRoseBlock extends FlowerBlock {

View file

@ -62,7 +62,7 @@ index 68756419ac6ee292db9569eab380a5c14d748002..6d76cc1db3ac3f1ae74c13511937fb86
return defaultAttributes.build(); return defaultAttributes.build();
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 079cb08b92061bb14952cf4ad2bda61e154f4438..6855210dc58f455b5af05d9c039da55e8dfc93f1 100644 index fa4e8cb2d53e0ac4e15a8188454ceed0afafe503..e613ea0eba9a1d162b8f7dfe32c9c31d82f17dd2 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -386,7 +386,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -386,7 +386,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

Some files were not shown because too many files have changed in this diff Show more