aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0472-Fix-villager-boat-exploit.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0472-Fix-villager-boat-exploit.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0472-Fix-villager-boat-exploit.patch')
-rw-r--r--patches/server/0472-Fix-villager-boat-exploit.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0472-Fix-villager-boat-exploit.patch b/patches/server/0472-Fix-villager-boat-exploit.patch
new file mode 100644
index 0000000000..8f9249892b
--- /dev/null
+++ b/patches/server/0472-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 ec080eb8e3930b6c5cc08c3061535b379a99a7d1..846132dad557b04a3d52184cfb1c0dd35673f8c6 100644
+--- a/src/main/java/net/minecraft/server/players/PlayerList.java
++++ b/src/main/java/net/minecraft/server/players/PlayerList.java
+@@ -595,6 +595,14 @@ public abstract class PlayerList {
+ PlayerList.LOGGER.debug("Removing player mount");
+ entityplayer.stopRiding();
+ entity.getPassengersAndSelf().forEach((entity1) -> {
++ // Paper start - Fix villager boat exploit
++ 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 - Fix villager boat exploit
+ entity1.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER, EntityRemoveEvent.Cause.PLAYER_QUIT); // CraftBukkit - add Bukkit remove cause
+ });
+ }