This commit is contained in:
Bjarne Koll 2024-10-23 17:13:43 +02:00
parent 09b625eccf
commit 1f8b53733f
No known key found for this signature in database
GPG Key ID: 27F6CCCF55D2EE62
58 changed files with 197 additions and 205 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent
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 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..73d9451f4419dfe47620aed0edc7bd386a2c87da 100644 index 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..f80bf569089bdc049f861f876ab91183a1860d54 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
@@ -1201,7 +1201,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1201,7 +1201,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -37,7 +37,7 @@ index 2cc5663878a7c0f4b4d5f4b9a0f69de2326bf415..73d9451f4419dfe47620aed0edc7bd38
+ this.player.jumpFromGround(); + this.player.jumpFromGround();
+ } else { + } else {
+ from = event.getFrom(); + from = event.getFrom();
+ this.internalTeleport(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.emptySet()); + this.internalTeleport(new PositionMoveRotation(org.bukkit.craftbukkit.util.CraftLocation.toVec3D(from), Vec3.ZERO, from.getYaw(), from.getPitch()), Collections.emptySet());
+ return; + return;
+ } + }
+ // Paper end - Add PlayerJumpEvent + // Paper end - Add PlayerJumpEvent

View File

@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent
Co-authored-by: Aikar <aikar@aikar.co> Co-authored-by: Aikar <aikar@aikar.co>
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 73d9451f4419dfe47620aed0edc7bd386a2c87da..0cce81cb61665b2dbd445fa9a0fcfeb42ce3be2c 100644 index f80bf569089bdc049f861f876ab91183a1860d54..fd5ce79bb1e976dac5109be12aa4b9b550e94f41 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
@@ -714,21 +714,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -714,21 +714,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -75,7 +75,7 @@ index 98aeafcc51e23a7534c8d57e4db0eb58abb3f30b..29b836a75b835f0d5233db419fc5ca8d
this.doCloseContainer(); this.doCloseContainer();
} }
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 0cce81cb61665b2dbd445fa9a0fcfeb42ce3be2c..bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414 100644 index fd5ce79bb1e976dac5109be12aa4b9b550e94f41..9033c0e720a432d9abffdd7aebee2d26e595ee93 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
@@ -2633,10 +2633,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2633,10 +2633,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@ -22,26 +22,18 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things. plugins doing unsafe things.
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 bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414..816b53894c6420a6b1603252e53facacecc07c52 100644 index 9033c0e720a432d9abffdd7aebee2d26e595ee93..c20ae23e4ca340cd5ec093578f88d16529c3523a 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
@@ -7,6 +7,7 @@ import com.mojang.brigadier.ParseResults; @@ -272,6 +272,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.logging.LogUtils;
+import io.papermc.paper.configuration.GlobalConfiguration;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
@@ -272,6 +273,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private int tickCount; private int tickCount;
private int ackBlockChangesUpTo = -1; private int ackBlockChangesUpTo = -1;
private final TickThrottler chatSpamThrottler = new TickThrottler(20, 200); private final TickThrottler chatSpamThrottler = new TickThrottler(20, 200);
+ private final TickThrottler tabSpamThrottler = new TickThrottler(GlobalConfiguration.get().spamLimiter.tabSpamIncrement, GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits + private final TickThrottler tabSpamThrottler = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits
private final TickThrottler dropSpamThrottler = new TickThrottler(20, 1480); private final TickThrottler dropSpamThrottler = new TickThrottler(20, 1480);
private double firstGoodX; private double firstGoodX;
private double firstGoodY; private double firstGoodY;
@@ -387,6 +389,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -387,6 +388,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.keepConnectionAlive(); this.keepConnectionAlive();
this.chatSpamThrottler.tick(); this.chatSpamThrottler.tick();
@ -49,7 +41,7 @@ index bcceb9d18524ddcf7cdf2ab6dcb95a67f1155414..816b53894c6420a6b1603252e53facac
this.dropSpamThrottler.tick(); this.dropSpamThrottler.tick();
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) { if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
@@ -722,7 +725,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -722,7 +724,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
// CraftBukkit start // CraftBukkit start

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
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 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d048720e7 100644 index c20ae23e4ca340cd5ec093578f88d16529c3523a..ff378b29a2dfec293f7a926d1e8383627795303a 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
@@ -491,9 +491,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -490,9 +490,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d0 = entity.getX(); double d0 = entity.getX();
double d1 = entity.getY(); double d1 = entity.getY();
double d2 = entity.getZ(); double d2 = entity.getZ();
@ -22,7 +22,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d
float f = Mth.wrapDegrees(packet.getYRot()); float f = Mth.wrapDegrees(packet.getYRot());
float f1 = Mth.wrapDegrees(packet.getXRot()); float f1 = Mth.wrapDegrees(packet.getXRot());
double d6 = d3 - this.vehicleFirstGoodX; double d6 = d3 - this.vehicleFirstGoodX;
@@ -527,6 +527,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -526,6 +526,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
@ -39,7 +39,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d
if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end // CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
@@ -1160,9 +1170,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1159,9 +1169,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
if (!this.updateAwaitingTeleport()) { if (!this.updateAwaitingTeleport()) {
@ -52,7 +52,7 @@ index 816b53894c6420a6b1603252e53facacecc07c52..825e181edc612daa2deaee2977d82a0d
float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot()));
float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot()));
@@ -1220,6 +1230,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1219,6 +1229,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else { } else {
speed = this.player.getAbilities().walkingSpeed * 10f; speed = this.player.getAbilities().walkingSpeed * 10f;
} }

View File

@ -59,10 +59,10 @@ 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 825e181edc612daa2deaee2977d82a0d048720e7..5b5c5864fa1ad96946b0892998284fab26e54095 100644 index ff378b29a2dfec293f7a926d1e8383627795303a..3f9025405e90ebcbab5ce4c1edef55fe74e529c6 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
@@ -1599,6 +1599,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1598,6 +1598,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:

View File

@ -6,10 +6,10 @@ 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 5b5c5864fa1ad96946b0892998284fab26e54095..9c04eb00c80a343502ece3001a6b21382d011d30 100644 index 3f9025405e90ebcbab5ce4c1edef55fe74e529c6..c234ee2b72249accbaee4f8005fa4c2f1be0fdc8 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
@@ -1049,6 +1049,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1048,6 +1048,44 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleEditBook(ServerboundEditBookPacket packet) { public void handleEditBook(ServerboundEditBookPacket packet) {

View File

@ -119,10 +119,10 @@ index e812cc865baaa1ee03872f7969ee98600b82483b..c847fbdb6f52386570eb4c070fcc01d3
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 9c04eb00c80a343502ece3001a6b21382d011d30..0552007b5f12055b72b01ddeef17c30236642eaf 100644 index c234ee2b72249accbaee4f8005fa4c2f1be0fdc8..77e111973ae33389315af72eb950b6f9d9abee12 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
@@ -773,19 +773,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -772,19 +772,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip()));
} }
} }

View File

@ -22,10 +22,10 @@ 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 0552007b5f12055b72b01ddeef17c30236642eaf..0b7e47418aa7a9891ee4a070430de6b2599f66e3 100644 index 77e111973ae33389315af72eb950b6f9d9abee12..fd5ad700154a7b75f2ecff6a8d47f6d75ac789e4 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
@@ -307,6 +307,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -306,6 +306,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault();
private final FutureChain chatMessageChain; private final FutureChain chatMessageChain;
private boolean waitingForSwitchToConfig; private boolean waitingForSwitchToConfig;
@ -33,7 +33,7 @@ index 0552007b5f12055b72b01ddeef17c30236642eaf..0b7e47418aa7a9891ee4a070430de6b2
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
super(server, connection, clientData, player); // CraftBukkit super(server, connection, clientData, player); // CraftBukkit
@@ -3197,7 +3198,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3196,7 +3197,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) { public void handleSignUpdate(ServerboundSignUpdatePacket packet) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid
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 0b7e47418aa7a9891ee4a070430de6b2599f66e3..01dbc23369661e141ee81a2357f7b0b5602b56d5 100644 index fd5ad700154a7b75f2ecff6a8d47f6d75ac789e4..7d3a64ad036470e9cd540131c2c3a58d871bc392 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
@@ -899,7 +899,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -898,7 +898,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handlePickItem(ServerboundPickItemPacket packet) { public void handlePickItem(ServerboundPickItemPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -5,10 +5,10 @@ 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 01dbc23369661e141ee81a2357f7b0b5602b56d5..7b8aaf763020cf7be7114f329f22af75f7a80ef0 100644 index 7d3a64ad036470e9cd540131c2c3a58d871bc392..452fdd64669765d5dc73faa90d94bf474cbe1a07 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
@@ -1564,6 +1564,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1563,6 +1563,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
public void internalTeleport(PositionMoveRotation positionmoverotation, Set<Relative> set) { public void internalTeleport(PositionMoveRotation positionmoverotation, Set<Relative> set) {

View File

@ -13,10 +13,10 @@ 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 7b8aaf763020cf7be7114f329f22af75f7a80ef0..e329503681961566a76a383245303e88acef37a4 100644 index 452fdd64669765d5dc73faa90d94bf474cbe1a07..4ac071f31583cd7fa0d80d8bbaddd3f5de8d648c 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
@@ -1352,6 +1352,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1351,6 +1351,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move

View File

@ -5,10 +5,10 @@ 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 e329503681961566a76a383245303e88acef37a4..5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1 100644 index 4ac071f31583cd7fa0d80d8bbaddd3f5de8d648c..b180bc19f4a8fa413a84429895bcd5d0f6a30a43 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
@@ -200,6 +200,7 @@ import net.minecraft.world.phys.Vec3; @@ -199,6 +199,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -16,7 +16,7 @@ index e329503681961566a76a383245303e88acef37a4..5b1c8fb2765407cab1ca41d8d2fce83d
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -3086,21 +3087,41 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3085,21 +3086,41 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
ServerGamePacketListenerImpl.LOGGER.debug("Player {} tried to place impossible recipe {}", this.player, recipeholder.id().location()); ServerGamePacketListenerImpl.LOGGER.debug("Player {} tried to place impossible recipe {}", this.player, recipeholder.id().location());
return; return;
} }

View File

@ -18,10 +18,10 @@ 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 5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1..fc595e04191ffe3434d54156e924cec0f4b19cee 100644 index b180bc19f4a8fa413a84429895bcd5d0f6a30a43..ac073dab2d2552f9bb0394379a237a4dc37c8fb2 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
@@ -811,7 +811,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -810,7 +810,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) { if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
@ -30,7 +30,7 @@ index 5b1c8fb2765407cab1ca41d8d2fce83df1cc5fe1..fc595e04191ffe3434d54156e924cec0
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed")); this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
} else { } else {
BaseCommandBlock commandblocklistenerabstract = null; BaseCommandBlock commandblocklistenerabstract = null;
@@ -878,7 +878,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -877,7 +877,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) { if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled")); this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));

View File

@ -76,10 +76,10 @@ index 82d5f1235d158326ce6fb1eb6d481c00f57467d3..20a3138c6c2a6c8ada8b6008913abae0
@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 fc595e04191ffe3434d54156e924cec0f4b19cee..510c97062d77541425aed6ddaaad58be4290967b 100644 index ac073dab2d2552f9bb0394379a237a4dc37c8fb2..7865ff33b0163460a9ffdb7ed4bb3970b5674344 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
@@ -3304,7 +3304,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3303,7 +3303,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {

View File

@ -5,10 +5,10 @@ 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 510c97062d77541425aed6ddaaad58be4290967b..09bb38460ab6fa7b6132e245d52b60244bd248eb 100644 index 7865ff33b0163460a9ffdb7ed4bb3970b5674344..f146787c935287eb5cc545643036eeb2a2d7dc9b 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
@@ -3296,6 +3296,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -3295,6 +3295,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override @Override
public void handleClientInformation(ServerboundClientInformationPacket packet) { public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());

View File

@ -9,10 +9,10 @@ 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 09bb38460ab6fa7b6132e245d52b60244bd248eb..319717d5b67b9bc2a261bc69679c2e6634d7696c 100644 index f146787c935287eb5cc545643036eeb2a2d7dc9b..c430434485baa7fc5a213efd9523cee8c2c46b44 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
@@ -678,7 +678,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -677,7 +677,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return; return;
} }

View File

@ -7,7 +7,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity
public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider; public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index c17dd4205983855615289cf0a5619056d237f325..6cda13df52ee4d56dd1d3c213307bfd38175584c 100644 index b2ab430392fc0f214ba8c5383e3f3ad5c548bda2..9022555db0df8c269fc039c895422cf36c08097e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -471,6 +471,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -471,6 +471,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
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 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d92448109 100644 index 465b6a1bbdbb193c6ecf5fd1598e1e4a4f8dbbbc..a3ce6feff0826dcfb2a11b0f6cd01a5368c2de3a 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
@@ -1228,6 +1228,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1223,6 +1223,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
} else { } else {
@ -23,10 +23,10 @@ index 9114ba1742a4fc8683848d431fa92046a85fe871..c60967b7833a23cff0305219b02b308d
if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false; return false;
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index d4bd44210d58b30696feeea48e1909472a546702..5de472df78940d1b8320f73d18b2edf3a796227e 100644 index 86e4559da2344f228ef4d1c4ac3c115fa0266d23..546be40a8e4470fb5a6686072cdd342cdaa6fe15 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -437,10 +437,12 @@ public class ServerPlayerGameMode { @@ -435,10 +435,12 @@ public class ServerPlayerGameMode {
// return true; // CraftBukkit // return true; // CraftBukkit
} }
// CraftBukkit start // CraftBukkit start

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
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 f1383906dbd16e088f57c9c77c051c8501b155cc..c01a9305eb1c3e2ee5effab1e11980c2540d3c2a 100644 index f8fd729d53248c7598a118d89fedf340f82cdd61..ac1b2b3982e5ceb8fecf20867dd2ac6e143463c3 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
@@ -4508,4 +4508,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4704,4 +4704,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
void accept(Entity entity, double x, double y, double z); void accept(Entity entity, double x, double y, double z);
} }
@ -21,7 +21,7 @@ index f1383906dbd16e088f57c9c77c051c8501b155cc..c01a9305eb1c3e2ee5effab1e11980c2
+ // Paper end - Expose entity id counter + // Paper end - Expose entity id counter
} }
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 8b11f5f8cec74c57d614d73233a449c97cd56d18..d7e8663e21ade1b53d4b936147f57b632f67a156 100644 index 180259d1e5401777e121a8c1ec95034afbc0917b..3448ada171a9fb8c8294b0ba93eb2c846788a679 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
@@ -511,6 +511,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -511,6 +511,11 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
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 c01a9305eb1c3e2ee5effab1e11980c2540d3c2a..6ab665efcac4c2543bab9d95472026e0ec8580c5 100644 index ac1b2b3982e5ceb8fecf20867dd2ac6e143463c3..0bd608894ab596c773570f92b4662aee5a6934cc 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
@@ -4513,5 +4513,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4709,5 +4709,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public static int nextEntityId() { public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet(); return ENTITY_COUNTER.incrementAndGet();
} }
@ -19,10 +19,10 @@ index c01a9305eb1c3e2ee5effab1e11980c2540d3c2a..6ab665efcac4c2543bab9d95472026e0
// Paper end - Expose entity id counter // Paper end - Expose entity id counter
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 5f5788a502642463091fb76e98703aaec7a86836..98e8ad81b8c9c0636abe59f70ce891fe926a37fe 100644 index abecb0235eee3e62a84f15f2ef100efcf3fcbf2a..925626b74005ec9c031c3773171f7684ecc9ccd3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1062,4 +1062,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1063,4 +1063,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return getHandle().isInLava(); return getHandle().isInLava();
} }
// Paper end - entity liquid API // Paper end - entity liquid API

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
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 d2866b9f7e6c8f0ca30d451c93c56caefb2c1b5c..05aa3323e9ae971fba5ab8c6c319c7805a3808aa 100644 index b1447fb684f5cbdc9106363870f5551ee9e1342c..263ed74fd8a8a53ce6d676201f75c5b334345c84 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
@@ -2270,13 +2270,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2352,13 +2352,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) { if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList(); PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList(); UserWhiteList whitelist = playerlist.getWhiteList();

View File

@ -11,10 +11,10 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
See #3522 See #3522
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 93337fd026fefb76c8a288674fed05cb3c1eca38..a12299604ea88c268db5065191d641eb7d52c3e3 100644 index a16229f5eaa9e8320751e4fd1faf016f796d3414..0f34a5ce0352f627099a719b78e530e5e572581a 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -474,6 +474,7 @@ public class EndDragonFight { @@ -475,6 +475,7 @@ public class EndDragonFight {
entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F); entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F);
this.level.addFreshEntity(entityenderdragon); this.level.addFreshEntity(entityenderdragon);
this.dragonUUID = entityenderdragon.getUUID(); this.dragonUUID = entityenderdragon.getUUID();

View File

@ -6,10 +6,10 @@ 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 82f49aad1d0ce2d62bf61aa634ebef3711d4d930..d33cf08f7c47111823abbce481505946db249577 100644 index c430434485baa7fc5a213efd9523cee8c2c46b44..e3e43c361d8612dbc79fe88730a3794eb44d85e4 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
@@ -492,9 +492,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -489,9 +489,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
float prevYaw = this.player.getYRot(); float prevYaw = this.player.getYRot();
float prevPitch = this.player.getXRot(); float prevPitch = this.player.getXRot();
// CraftBukkit end // CraftBukkit end
@ -22,7 +22,7 @@ index 82f49aad1d0ce2d62bf61aa634ebef3711d4d930..d33cf08f7c47111823abbce481505946
double d3 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX()); final double toX = d3; // Paper - OBFHELPER double d3 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX()); final double toX = d3; // Paper - OBFHELPER
double d4 = ServerGamePacketListenerImpl.clampVertical(packet.getY()); final double toY = d4; // Paper - OBFHELPER double d4 = ServerGamePacketListenerImpl.clampVertical(packet.getY()); final double toY = d4; // Paper - OBFHELPER
double d5 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ()); final double toZ = d5; // Paper - OBFHELPER double d5 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ()); final double toZ = d5; // Paper - OBFHELPER
@@ -504,7 +504,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -501,7 +501,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d7 = d4 - this.vehicleFirstGoodY; double d7 = d4 - this.vehicleFirstGoodY;
double d8 = d5 - this.vehicleFirstGoodZ; double d8 = d5 - this.vehicleFirstGoodZ;
double d9 = entity.getDeltaMovement().lengthSqr(); double d9 = entity.getDeltaMovement().lengthSqr();
@ -40,7 +40,7 @@ index 82f49aad1d0ce2d62bf61aa634ebef3711d4d930..d33cf08f7c47111823abbce481505946
// CraftBukkit start - handle custom speeds and skipped ticks // CraftBukkit start - handle custom speeds and skipped ticks
this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick; this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
@@ -550,9 +559,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -547,9 +556,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D)); boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D));
@ -53,7 +53,7 @@ index 82f49aad1d0ce2d62bf61aa634ebef3711d4d930..d33cf08f7c47111823abbce481505946
boolean flag1 = entity.verticalCollisionBelow; boolean flag1 = entity.verticalCollisionBelow;
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
@@ -1253,7 +1262,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1256,7 +1265,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d7 = d1 - this.firstGoodY; double d7 = d1 - this.firstGoodY;
double d8 = d2 - this.firstGoodZ; double d8 = d2 - this.firstGoodZ;
double d9 = this.player.getDeltaMovement().lengthSqr(); double d9 = this.player.getDeltaMovement().lengthSqr();
@ -71,7 +71,7 @@ index 82f49aad1d0ce2d62bf61aa634ebef3711d4d930..d33cf08f7c47111823abbce481505946
if (this.player.isSleeping()) { if (this.player.isSleeping()) {
if (d10 > 1.0D) { if (d10 > 1.0D) {
@@ -1309,9 +1327,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1312,9 +1330,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
AABB axisalignedbb = this.player.getBoundingBox(); AABB axisalignedbb = this.player.getBoundingBox();

View File

@ -27,10 +27,10 @@ index 065d140ca4f987e14138a37f4c7d60879dd7b6e1..601135f3368272bf1ca3a43ec9c199e3
super(block, propertyMap, codec); super(block, propertyMap, codec);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java
index f2ce97e46cdbda0f8960eed9b601c797d8eaef48..85029f1acfdbb411d9ebdf95838d6db3898f4e58 100644 index a845ebd6262e05a1395c9a503480319e4b4a65ce..c88e4ba701b2a2325b76478b7f47278157afd2ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java
@@ -99,7 +99,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { @@ -100,7 +100,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
public Material getBlockType(int x, int y, int z) { public Material getBlockType(int x, int y, int z) {
this.validateChunkCoordinates(x, y, z); this.validateChunkCoordinates(x, y, z);
@ -40,7 +40,7 @@ index f2ce97e46cdbda0f8960eed9b601c797d8eaef48..85029f1acfdbb411d9ebdf95838d6db3
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index a586442422a2b2c06b785af0d261d3e19eb1d59b..aa644231425b9622437538b5c092d4064a40cced 100644 index 3fa3de9a89550ec2fcb8ca663742826c0c3136b6..5f4dcf6d86db66186dc31075bdb739f5dbae6480 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -220,7 +220,7 @@ public class CraftBlock implements Block { @@ -220,7 +220,7 @@ public class CraftBlock implements Block {
@ -66,10 +66,10 @@ index fabdec2d66cc6d676ed58fa570e2c318ab0927e2..1002123cd0c6f57cecc4e80f5f21cc6f
public void setFlag(int flag) { public void setFlag(int flag) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 67ff2241aa8869b41abb0a93467b8694618264e2..9953b6b36cbcbfd1756bac478b568ca5700fc898 100644 index f73858663162cb594db382d584b6500bb03e74b1..7f0d87bd43a54885fc521068116888083327f37e 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -61,7 +61,7 @@ public class CraftBlockData implements BlockData { @@ -63,7 +63,7 @@ public class CraftBlockData implements BlockData {
@Override @Override
public Material getMaterial() { public Material getMaterial() {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Villager#resetOffers
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
index 89e14bb2662fe03b4661aaa54fd65af41b1d438b..fcb3b66617150ad503bffe65de4900b1e3af8764 100644 index 3cdd48c35d50fa3107e0f2bf439e75b7f306b3d1..c8231e421e6c3f1cf8a5aaf8cc64741abe868f41 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa

View File

@ -10,10 +10,10 @@ In general, look at making this logic more robust (i.e properly handling
cases where a captured entry is overriden) - but for now this will do. cases where a captured entry is overriden) - but for now this will do.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 60b04a16c6cb0a7109bda5c16e23c1d56ab7afad..144d243e0d6ba3ae3f0b0bf457fa516e2b4f416f 100644 index dc38a23f027b4fe516f3963632d01f66c02b0681..aff89d2e3274b91238989fc1e7d8c119c2a3c097 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -152,7 +152,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -153,7 +153,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean captureBlockStates = false; public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false; public boolean captureTreeGeneration = false;
public Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper public Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper

View File

@ -7,10 +7,10 @@ Fixes #4259 by not flooring the blockposition among other weirdness
Vanilla Issue: MC-267622 Vanilla Issue: MC-267622
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
index 391acc9dadc653e9e1285a71b4f1e7c063e8ca49..80f911692c97585a696a19ebbe616d6aa312b2d9 100644 index 0694b2a041c0012bbb7ab5c4c787c1e08db7757c..30035d534e144bf31f94073c57b0195be7e62772 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
@@ -86,7 +86,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { @@ -85,7 +85,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
result = blockCookEvent.getResult(); result = blockCookEvent.getResult();
itemstack1 = CraftItemStack.asNMSCopy(result); itemstack1 = CraftItemStack.asNMSCopy(result);
// CraftBukkit end // CraftBukkit end
@ -23,6 +23,6 @@ index 391acc9dadc653e9e1285a71b4f1e7c063e8ca49..80f911692c97585a696a19ebbe616d6a
+ world.addFreshEntity(droppedItem); + world.addFreshEntity(droppedItem);
+ } + }
+ // Paper end - Fix item locations dropped from campfires + // Paper end - Fix item locations dropped from campfires
campfire.items.set(i, ItemStack.EMPTY); blockEntity.items.set(i, ItemStack.EMPTY);
world.sendBlockUpdated(pos, state, state, 3); world.sendBlockUpdated(pos, state, state, 3);
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state)); world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));

View File

@ -8,10 +8,10 @@ This can realistically only happen if there's custom loot active on fishing
which can return 0 items. This would disconnect the player who's fishing. which can return 0 items. This would disconnect the player who's fishing.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index 0b4c67b9de6893601f032a8fae103e8a98f2c767..5b7734020b496ade3740d92908ad2d399bfd55e6 100644 index 9d24d4c3802c525546dae92530c9c5b3cf77924e..536196a740f607adda2a5ae7f644981ac26bef98 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -506,9 +506,15 @@ public class FishingHook extends Projectile { @@ -511,9 +511,15 @@ public class FishingHook extends Projectile {
while (iterator.hasNext()) { while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next(); ItemStack itemstack1 = (ItemStack) iterator.next();
@ -29,7 +29,7 @@ index 0b4c67b9de6893601f032a8fae103e8a98f2c767..5b7734020b496ade3740d92908ad2d39
playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1); playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1);
this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent); this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent);
@@ -521,8 +527,12 @@ public class FishingHook extends Projectile { @@ -526,8 +532,12 @@ public class FishingHook extends Projectile {
double d2 = entityhuman.getZ() - this.getZ(); double d2 = entityhuman.getZ() - this.getZ();
double d3 = 0.1D; double d3 = 0.1D;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 42ec4aed187b41729a3c985ae440097db0388d3c..25bfb93568ea0a6c0b827c6d6a736f950981144e 100644 index dfe625f406ac323ede270d3773e71b09a3ba0054..dd3940c2aacfa835b528a882f3ec5dd4d98bd59f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1965,6 +1965,28 @@ public final class CraftServer implements Server { @@ -1969,6 +1969,28 @@ public final class CraftServer implements Server {
return result; return result;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add ignore discounts API
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index e23674dd5db3c429efd3b7c71fe36b420494c03a..9d5a5a7fff7f75871e167f83edb0e9d5348748d7 100644 index 82ed0ce824e84ea09ea963caa61fbb75f6ce6fe7..f51078e4b9e6267fa43795d009f5d149b86acb5a 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -493,6 +493,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -490,6 +490,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
while (iterator.hasNext()) { while (iterator.hasNext()) {
MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); MerchantOffer merchantrecipe = (MerchantOffer) iterator.next();
@ -16,7 +16,7 @@ index e23674dd5db3c429efd3b7c71fe36b420494c03a..9d5a5a7fff7f75871e167f83edb0e9d5
merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier())); merchantrecipe.addToSpecialPriceDiff(-Mth.floor((float) i * merchantrecipe.getPriceMultiplier()));
} }
@@ -505,6 +506,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -502,6 +503,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
while (iterator1.hasNext()) { while (iterator1.hasNext()) {
MerchantOffer merchantrecipe1 = (MerchantOffer) iterator1.next(); MerchantOffer merchantrecipe1 = (MerchantOffer) iterator1.next();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Toggle for removing existing dragon
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index a12299604ea88c268db5065191d641eb7d52c3e3..d6deedb96583c19eeb27e671289c4edc8a9245b4 100644 index 0f34a5ce0352f627099a719b78e530e5e572581a..323fbf684b7062c1b9084f1718538a3b3414d5bf 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -211,7 +211,7 @@ public class EndDragonFight { @@ -212,7 +212,7 @@ public class EndDragonFight {
this.dragonUUID = entityenderdragon.getUUID(); this.dragonUUID = entityenderdragon.getUUID();
EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon); EndDragonFight.LOGGER.info("Found that there's a dragon still alive ({})", entityenderdragon);
this.dragonKilled = false; this.dragonKilled = false;

View File

@ -15,7 +15,7 @@ manually reload the advancement data for all players, which
normally takes place as a part of the datapack reloading. normally takes place as a part of the datapack reloading.
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 d7e8663e21ade1b53d4b936147f57b632f67a156..66249c5caefb0879e13c02d5553b09b4122418b9 100644 index 3448ada171a9fb8c8294b0ba93eb2c846788a679..ea9c9ae832c4044a2eccbf901e20ff042df68bf3 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
@@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -323,7 +323,13 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Beacon API - custom effect ranges
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd83f5a66ca 100644 index 8332296663b845df1d09d403b49a4769b2d54afc..dc3171b1493d7c4c8ddf1c79587c4e27bd819c17 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
@ -81,7 +81,7 @@ index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd8
@@ -395,6 +425,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -395,6 +425,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
this.lockKey = LockCode.fromTag(nbt); this.lockKey = LockCode.fromTag(nbt, registries);
+ this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper - Custom beacon ranges + this.effectRange = nbt.contains(PAPER_RANGE_TAG, 6) ? nbt.getDouble(PAPER_RANGE_TAG) : -1; // Paper - Custom beacon ranges
} }
@ -89,16 +89,16 @@ index fc915797d2a085447747d9ce23a5a354fb3eb6b6..52776ce9b7b4edd1eb474f14705d7fd8
@@ -408,6 +439,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -408,6 +439,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
} }
this.lockKey.addToTag(nbt); this.lockKey.addToTag(nbt, registries);
+ nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper - Custom beacon ranges + nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper - Custom beacon ranges
} }
public void setCustomName(@Nullable Component customName) { public void setCustomName(@Nullable Component customName) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d519119c9f4 100644 index 8021ac39cb9c1ff45123d51e6f13b840d1290bb2..275d4f9e07ff7383b18238071e067b7f44483ece 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
@@ -33,7 +33,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem @@ -42,7 +42,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
if (tileEntity instanceof BeaconBlockEntity) { if (tileEntity instanceof BeaconBlockEntity) {
BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity; BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity;
@ -107,7 +107,7 @@ index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d51
Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size()); Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size());
for (Player human : nms) { for (Player human : nms) {
@@ -120,4 +120,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem @@ -145,4 +145,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
public CraftBeacon copy(Location location) { public CraftBeacon copy(Location location) {
return new CraftBeacon(this, location); return new CraftBeacon(this, location);
} }

View File

@ -28,10 +28,10 @@ index 134810ac91d828d67759cd1ed56f11b71e292917..ba41646a5edb57c4d9766df08bbc5701
Connection.LOGGER.debug("Failed to sent packet", throwable); Connection.LOGGER.debug("Failed to sent packet", throwable);
if (this.getSending() == PacketFlow.CLIENTBOUND) { if (this.getSending() == PacketFlow.CLIENTBOUND) {
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 45181bc9c422507682d479e4d43177ecd3253971..2ea613f818403f8e8ece4b36891738139345cf89 100644 index c468947990cf05e554006e51d87b72fad7c28e55..0ae490bb9b4cd781876054d0824c5392060208eb 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
@@ -295,6 +295,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @@ -323,6 +323,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
public boolean isRealPlayer; // Paper public boolean isRealPlayer; // Paper
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support public @Nullable String clientBrandName = null; // Paper - Brand support
@ -40,10 +40,10 @@ index 45181bc9c422507682d479e4d43177ecd3253971..2ea613f818403f8e8ece4b3689173813
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 48085b2e7197dc44e76b812bdd514af729e21e83..a1124405412cdac673f34a63988e7be957506dba 100644 index 9a8b08d4b70b8890961e4af7ce6e870aa1c7c810..f8ae8c8eff73e4e87eb34d0f2635517f1688a6f1 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -376,6 +376,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -383,6 +383,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private void disconnect0(DisconnectionDetails disconnectiondetails) { private void disconnect0(DisconnectionDetails disconnectiondetails) {
// CraftBukkit end // CraftBukkit end
@ -52,10 +52,10 @@ index 48085b2e7197dc44e76b812bdd514af729e21e83..a1124405412cdac673f34a63988e7be9
this.connection.disconnect(disconnectiondetails); this.connection.disconnect(disconnectiondetails);
})); }));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 6f587c4bb4704d93552ba61335d87b1852fc169c..98eb00a8ee23543714d424d3ff5ca19887d6db19 100644 index c8c27311ade7d4a70d5398b3a4cb50eedd02a2f9..4975b4222d52eddbb42e9c9cd08eef56859080c8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -570,7 +570,7 @@ public abstract class PlayerList { @@ -520,7 +520,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
} }

View File

@ -11,7 +11,7 @@ in IWorldServerData are removed as they were only used in certain places, with h
values used in other places. values used in other places.
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index 4b7e9bc8aa253d0eb12a2195416c618cccdc8690..d5d27b0d352ca3fd57a26605cb35c499e88b57fc 100644 index cfa1787b955fd9b80bf9906b88d423cb59b12ff1..08a3c7140867f339dd99a95094ed0fd8ff344fca 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -40,43 +40,53 @@ public class WanderingTraderSpawner implements CustomSpawner { @@ -40,43 +40,53 @@ public class WanderingTraderSpawner implements CustomSpawner {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API
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/entity/ai/attributes/AttributeInstance.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
index 36c943d709c1c0ae49ec0baf0ccf7b6cb9a2ecf3..d28f9e077a50122e86848cfa9db83f6b0e8eef6c 100644 index a2fe7149a837040cf9f23eb426d398a5f90be394..27a7852a5d3f8c8960f098646ff5587c50556aa5 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
@@ -143,20 +143,20 @@ public class AttributeInstance { @@ -153,20 +153,20 @@ public class AttributeInstance {
double d = this.getBaseValue(); double d = this.getBaseValue();
for (AttributeModifier attributeModifier : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_VALUE)) { for (AttributeModifier attributeModifier : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_VALUE)) {
@ -35,10 +35,10 @@ index 36c943d709c1c0ae49ec0baf0ccf7b6cb9a2ecf3..d28f9e077a50122e86848cfa9db83f6b
private Collection<AttributeModifier> getModifiersOrEmpty(AttributeModifier.Operation operation) { private Collection<AttributeModifier> getModifiersOrEmpty(AttributeModifier.Operation operation) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 9953b6b36cbcbfd1756bac478b568ca5700fc898..33869e725c3b3f2120fa36ca468019a78321e862 100644 index 7f0d87bd43a54885fc521068116888083327f37e..a17c1d1651d4d36c40ef97c1cf0b1e0d61f53418 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -721,4 +721,35 @@ public class CraftBlockData implements BlockData { @@ -725,4 +725,35 @@ public class CraftBlockData implements BlockData {
public BlockState createBlockState() { public BlockState createBlockState() {
return CraftBlockStates.getBlockState(this.state, null); return CraftBlockStates.getBlockState(this.state, null);
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
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 854533854dfba24b59a15265ac759331e3ddfc74..73fde8be0098238582fb3661ae67d4139be417dc 100644 index eb2954c9b51d4fd76cf5aec17899218f4de7076d..786b8c10a647d777b951b760e4c51eef057b2edd 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
@@ -2707,7 +2707,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2720,7 +2720,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
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 8a8189e8f2f201880748eb79805bb0b33688e814..925c842fcf546ad270641b3be7e8a8c432571501 100644 index db15382f35464de43a2fe0a41aca070a8c834777..de41ee2cc1be6ef412ec15c79a65cbca653b35d3 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
@@ -948,6 +948,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -967,6 +967,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().getUseItem().asBukkitMirror(); return this.getHandle().getUseItem().asBukkitMirror();
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerItemCooldownEvent
diff --git a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java diff --git a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java
index 47283d2a49209839002212e663a503a82ea86587..e0c4c0a9bab0bbc32358030a482aa04c2e1d3894 100644 index 3a45a149ec4a28f25ea9e45803ecbb7392b63f86..872813ef19fc08cad93786367e15f59400825c33 100644
--- a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java --- a/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java
+++ b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java +++ b/src/main/java/net/minecraft/world/item/ServerItemCooldowns.java
@@ -10,6 +10,16 @@ public class ServerItemCooldowns extends ItemCooldowns { @@ -11,6 +11,16 @@ public class ServerItemCooldowns extends ItemCooldowns {
this.player = player; this.player = player;
} }
@ -23,5 +23,5 @@ index 47283d2a49209839002212e663a503a82ea86587..e0c4c0a9bab0bbc32358030a482aa04c
+ // Paper end - Add PlayerItemCooldownEvent + // Paper end - Add PlayerItemCooldownEvent
+ +
@Override @Override
protected void onCooldownStarted(Item item, int duration) { protected void onCooldownStarted(ResourceLocation groupId, int duration) {
super.onCooldownStarted(item, duration); super.onCooldownStarted(groupId, duration);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
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 6ab665efcac4c2543bab9d95472026e0ec8580c5..dae7643897b47dba304cbea56112445df2736cff 100644 index 0bd608894ab596c773570f92b4662aee5a6934cc..25f625e28c8c9f63a1b2207d5e8d1a48e2fea039 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
@@ -2079,6 +2079,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2195,6 +2195,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean isPushable() { public boolean isPushable() {
@ -22,10 +22,10 @@ index 6ab665efcac4c2543bab9d95472026e0ec8580c5..dae7643897b47dba304cbea56112445d
} }
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
index eb425fac573881f3aad09ae75a32184fb0e325a6..302decdccd37c5579473c8fc33adda3956be7603 100644 index b8d57e25851dd7da905100dfd4022e4b99fd7f02..721321a19ce056f82de2bef44a8791dc9d5b3418 100644
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java
@@ -46,11 +46,16 @@ public final class EntitySelector { @@ -45,11 +45,16 @@ public final class EntitySelector {
} }
public static Predicate<Entity> pushableBy(Entity entity) { public static Predicate<Entity> pushableBy(Entity entity) {
@ -44,19 +44,19 @@ index eb425fac573881f3aad09ae75a32184fb0e325a6..302decdccd37c5579473c8fc33adda39
} else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision } else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision
return false; return 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 906e8589483b93bcdb55677f7f942f6c7a89caf8..d94c3e86885c5a8ba636988d29f98b496e13b627 100644 index 91a5166e69a03d846a1b396ba964003c12a0dcdb..7ea58478d3cde175a056f41cf945636a04128828 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
@@ -3573,7 +3573,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3712,7 +3712,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
return; return;
} }
// Paper end - don't run getEntities if we're not going to use its result // Paper end - don't run getEntities if we're not going to use its result
- List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); - List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this));
+ List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - Climbing should not bypass cramming gamerule + List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - Climbing should not bypass cramming gamerule
if (!list.isEmpty()) { if (!list.isEmpty()) {
// Paper - don't run getEntities if we're not going to use its result; moved up // Paper - don't run getEntities if we're not going to use its result; moved up
@@ -3765,9 +3765,16 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3917,9 +3917,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
return !this.isRemoved() && this.collides; // CraftBukkit return !this.isRemoved() && this.collides; // CraftBukkit
} }
@ -75,10 +75,10 @@ index 906e8589483b93bcdb55677f7f942f6c7a89caf8..d94c3e86885c5a8ba636988d29f98b49
// CraftBukkit start - collidable API // CraftBukkit start - collidable API
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c7fb6ccaa 100644 index d8a2fbb33f4b77ffb1b3c928a369c2824ad815d7..60c2868f255d372226e0c1389caaa5477bbef41e 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -88,7 +88,7 @@ public class Bat extends AmbientCreature { @@ -91,7 +91,7 @@ public class Bat extends AmbientCreature {
} }
@Override @Override
@ -88,10 +88,10 @@ index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
index 12b2267cba476547d510d9161b25a28f4f5c798e..97931bfd360725945ab9606ff698b518ae101076 100644 index 9a187b9b20e4e5ee4cdb7df31629faee9d3ebb60..8883894da73c7d5975a8826d23ee7f542db98b0b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
@@ -362,8 +362,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot @@ -364,8 +364,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
} }
@Override @Override
@ -103,10 +103,10 @@ index 12b2267cba476547d510d9161b25a28f4f5c798e..97931bfd360725945ab9606ff698b518
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index 45ba002e23258ef734012ae81b2c4c9e92d863fb..affa2e133611b7a045a99bac801398263d114ba7 100644 index 4e0ab5c3feb6350ab6c25db6227879d41ed8a749..709237639ef0ec1cb623f270302a27b0072e8685 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -356,7 +356,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -369,7 +369,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
} }
@Override @Override
@ -116,10 +116,10 @@ index 45ba002e23258ef734012ae81b2c4c9e92d863fb..affa2e133611b7a045a99bac80139826
} }
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index cc1189c2d7dc57ba8f29aad4ba5d2a07362bcd5b..5bcb9a53ebebeef4bd6ec2458df4b63002ebd804 100644 index 59fbfe8de2dc5ec020dd61a5e446b0b6f67d76e4..2bb2b36f793d25b6e49d1a72bb665cfa9f212730 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -349,7 +349,7 @@ public class ArmorStand extends LivingEntity { @@ -354,7 +354,7 @@ public class ArmorStand extends LivingEntity {
} }
@Override @Override
@ -128,24 +128,24 @@ index cc1189c2d7dc57ba8f29aad4ba5d2a07362bcd5b..5bcb9a53ebebeef4bd6ec2458df4b630
return false; return false;
} }
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 4f3f149b79fc2f5cd97e7337b2ae39193b7177cd..a4eab65c280e493889621e62d8fc94158b930c96 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java
@@ -144,7 +144,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
}
@Override
- public boolean isPushable() {
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper - Climbing should not bypass cramming gamerule
return true;
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 351e581c55d38e652fc3397f95a0837a6ee3656c..4d8c14d3a42f3e4b963cf5f8fa764df79813912b 100644 index a8fc89f78181abf9963bd1523f3bbefa911847d8..50c0055d80735313c280821991bd2a76e427f082 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -169,7 +169,7 @@ public abstract class AbstractMinecart extends VehicleEntity { @@ -161,7 +161,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
}
@Override
- public boolean isPushable() {
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper - Climbing should not bypass cramming gamerule
return true;
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index 26dd7c9f48f15f66a326901259ee89f4ab911526..2cb535639bff0e867c1b1e845fee6e34bb237044 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -154,7 +154,7 @@ public class Boat extends VehicleEntity implements Leashable, VariantHolder<Boat
} }
@Override @Override

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerShearBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
index c4b9c574bfb034fc78a596367f0f41dbde5eb93d..8d6736003934c5958f600660bdee58b386c39da4 100644 index 7e2a39a1ee092b46ab46caec0214255d9c333536..a5b84e6844e16cf1fdfb6f45efb8a7a165757d1c 100644
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java --- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
@@ -127,7 +127,7 @@ public class BeehiveBlock extends BaseEntityBlock { @@ -141,7 +141,7 @@ public class BeehiveBlock extends BaseEntityBlock {
} }
public static void dropHoneycomb(Level world, BlockPos pos) { public static void dropHoneycomb(Level world, BlockPos pos) {
@ -17,7 +17,7 @@ index c4b9c574bfb034fc78a596367f0f41dbde5eb93d..8d6736003934c5958f600660bdee58b3
} }
@Override @Override
@@ -139,8 +139,19 @@ public class BeehiveBlock extends BaseEntityBlock { @@ -153,8 +153,19 @@ public class BeehiveBlock extends BaseEntityBlock {
Item item = stack.getItem(); Item item = stack.getItem();
if (stack.is(Items.SHEARS)) { if (stack.is(Items.SHEARS)) {
@ -39,12 +39,12 @@ index c4b9c574bfb034fc78a596367f0f41dbde5eb93d..8d6736003934c5958f600660bdee58b3
flag = true; flag = true;
world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos); world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos);
diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
index aa8667f0b14dc8944dd3457b431162e59bf54ada..5f5b2dd2bb45a0d3ae7de063b3bc611d01af21c0 100644 index dad7a610286b0ab6b916a6169fa8f6f641deb39a..42413723b3c826debb310ef1d5d2c9f80a616e86 100644
--- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java --- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
@@ -40,16 +40,24 @@ public class PumpkinBlock extends Block { @@ -38,16 +38,24 @@ public class PumpkinBlock extends Block {
} else if (world.isClientSide) { } else if (world.isClientSide) {
return ItemInteractionResult.sidedSuccess(world.isClientSide); return InteractionResult.SUCCESS;
} else { } else {
+ // Paper start - Add PlayerShearBlockEvent + // Paper start - Add PlayerShearBlockEvent
+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>()); + io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
@ -68,7 +68,7 @@ index aa8667f0b14dc8944dd3457b431162e59bf54ada..5f5b2dd2bb45a0d3ae7de063b3bc611d
); );
itemEntity.setDeltaMovement( itemEntity.setDeltaMovement(
0.05 * (double)direction2.getStepX() + world.random.nextDouble() * 0.02, 0.05 * (double)direction2.getStepX() + world.random.nextDouble() * 0.02,
@@ -57,6 +65,7 @@ public class PumpkinBlock extends Block { @@ -55,6 +63,7 @@ public class PumpkinBlock extends Block {
0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02 0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02
); );
world.addFreshEntity(itemEntity); world.addFreshEntity(itemEntity);

View File

@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 12 Dec 2020 23:45:28 +0000
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
index e3e43c361d8612dbc79fe88730a3794eb44d85e4..b61cb778196a31df2139deb31dfd924abc6e5d1c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -275,6 +275,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private final TickThrottler chatSpamThrottler = new TickThrottler(20, 200);
private final TickThrottler tabSpamThrottler = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit); // Paper - configurable tab spam limits
private final TickThrottler dropSpamThrottler = new TickThrottler(20, 1480);
+ private final TickThrottler recipeSpamPackets = new TickThrottler(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement, io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit);
private double firstGoodX;
private double firstGoodY;
private double firstGoodZ;
@@ -391,6 +392,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.keepConnectionAlive();
this.chatSpamThrottler.tick();
this.tabSpamThrottler.tick(); // Paper - configurable tab spam limits
+ this.recipeSpamPackets.tick(); // Paper - auto recipe limit
this.dropSpamThrottler.tick();
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
@@ -3083,6 +3085,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
+ // Paper start - auto recipe limit
+ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
+ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"));
+ return;
+ }
+ }
+ // Paper end - auto recipe limit
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
this.player.resetLastActionTime();
if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.containerId()) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Expose LivingEntity hurt direction
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 cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc469793af 100644 index 917ac21794f1aabc6e95ab2fff2ea7547b9778a8..78bb666dbc5ccd84820e1c7b382249510dd5795c 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
@@ -188,7 +188,7 @@ public abstract class Player extends LivingEntity { @@ -188,7 +188,7 @@ public abstract class Player extends LivingEntity {
@ -18,7 +18,7 @@ index cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc
public Vec3 currentImpulseImpactPos; public Vec3 currentImpulseImpactPos;
@Nullable @Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7a382b7c4 100644 index 9022555db0df8c269fc039c895422cf36c08097e..cb56c75be83e839bafdae4356f85d33499d01d8a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -36,10 +36,10 @@ index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7
public int getSleepTicks() { public int getSleepTicks() {
return this.getHandle().sleepCounter; return this.getHandle().sleepCounter;
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 925c842fcf546ad270641b3be7e8a8c432571501..10f3defa8f4b57fb45cf7de06d415b72102e47d5 100644 index de41ee2cc1be6ef412ec15c79a65cbca653b35d3..ff3b53eff8f5fc1e02e7b30d59ff27dfe8f5d431 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
@@ -1005,4 +1005,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -1024,4 +1024,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().take(((CraftItem) item).getHandle(), quantity); this.getHandle().take(((CraftItem) item).getHandle(), quantity);
} }
// Paper end - pickup animation API // Paper end - pickup animation API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult
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 dbe7931dd7eb43f9381463d3a57ba1eb53820985..24fcb0eb139174671ffb7a8e5222ec9833835f87 100644 index c7d78f54694b464696c0f1edd0b135d1d5bcde3e..9e3037ac041da5ec2e15a4cd475ec52fee591aac 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -313,6 +313,10 @@ public class CraftEventFactory { @@ -312,6 +312,10 @@ public class CraftEventFactory {
return BedEnterResult.TOO_FAR_AWAY; return BedEnterResult.TOO_FAR_AWAY;
case NOT_SAFE: case NOT_SAFE:
return BedEnterResult.NOT_SAFE; return BedEnterResult.NOT_SAFE;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Fix crash from invalid ingredient lists in
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
index fcb3b66617150ad503bffe65de4900b1e3af8764..2a155d3611ca2370830ca763d40074df6641958f 100644 index c8231e421e6c3f1cf8a5aaf8cc64741abe868f41..39cb40b077e9c07471437d5bec16ba9a7e6bce52 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -273,7 +273,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -273,7 +273,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa

View File

@ -1,41 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 12 Dec 2020 23:45:28 +0000
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
index d33cf08f7c47111823abbce481505946db249577..57063f01993445a9965976332306c7f2ab20ed1f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -266,6 +266,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits
+ private final java.util.concurrent.atomic.AtomicInteger recipeSpamPackets = new java.util.concurrent.atomic.AtomicInteger(); // Paper - auto recipe limit
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
@@ -384,6 +385,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits
+ if (recipeSpamPackets.get() > 0) recipeSpamPackets.getAndDecrement(); // Paper - auto recipe limit
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -3068,6 +3070,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
+ // Paper start - auto recipe limit
+ if (!org.bukkit.Bukkit.isPrimaryThread()) {
+ if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
+ this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"));
+ return;
+ }
+ }
+ // Paper end - auto recipe limit
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
this.player.resetLastActionTime();
if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) {