aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0530-Fix-villager-boat-exploit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0530-Fix-villager-boat-exploit.patch')
-rw-r--r--patches/server/0530-Fix-villager-boat-exploit.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0530-Fix-villager-boat-exploit.patch b/patches/server/0530-Fix-villager-boat-exploit.patch
new file mode 100644
index 0000000000..0663c12d9c
--- /dev/null
+++ b/patches/server/0530-Fix-villager-boat-exploit.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Mon, 11 Jan 2021 12:43:51 -0800
+Subject: [PATCH] Fix villager boat exploit
+
+
+diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
+index 3f6e0319c1580dface0a175ebb93321ae4f45a35..9b56415f1a03423f29822839ce27bbdf33bb91d5 100644
+--- a/src/main/java/net/minecraft/server/players/PlayerList.java
++++ b/src/main/java/net/minecraft/server/players/PlayerList.java
+@@ -585,6 +585,14 @@ public abstract class PlayerList {
+ PlayerList.LOGGER.debug("Removing player mount");
+ entityplayer.stopRiding();
+ entity.getPassengersAndSelf().forEach((entity1) -> {
++ // Paper start
++ if (entity1 instanceof net.minecraft.world.entity.npc.AbstractVillager villager) {
++ final net.minecraft.world.entity.player.Player human = villager.getTradingPlayer();
++ if (human != null) {
++ villager.setTradingPlayer(null);
++ }
++ }
++ // Paper end
+ entity1.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER);
+ });
+ }