Paper/patches/server/0474-Fix-villager-boat-exploit.patch

26 Zeilen
1.5 KiB
Diff

2021-06-14 21:58:32 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2021-06-17 11:37:24 +02:00
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2021-06-14 21:58:32 +02:00
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
2024-06-14 01:32:45 +02:00
index 60845fe39f6e24474c1fa39c06a8b164348cb326..5a709e301b336ee2fc62b422a2f3d878b81f9743 100644
2021-06-14 21:58:32 +02:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
2024-06-13 22:57:13 +02:00
@@ -595,6 +595,14 @@ public abstract class PlayerList {
2021-06-14 21:58:32 +02:00
PlayerList.LOGGER.debug("Removing player mount");
entityplayer.stopRiding();
entity.getPassengersAndSelf().forEach((entity1) -> {
+ // Paper start - Fix villager boat exploit
2021-11-24 19:27:25 +01:00
+ if (entity1 instanceof net.minecraft.world.entity.npc.AbstractVillager villager) {
2021-06-14 21:58:32 +02:00
+ 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
2021-06-14 21:58:32 +02:00
});
}