From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jmp 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 bd318c058a0a99472486d1c3eaf1f9fa2879aaf6..0a84f70371dc458ccaa567e917706ecd8b6bbefa 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -613,6 +613,15 @@ public abstract class PlayerList { for (Iterator iterator = entity.getAllPassengers().iterator(); iterator.hasNext(); entity1.dead = true) { entity1 = (Entity) iterator.next(); + // Paper start + if (entity1 instanceof EntityVillagerAbstract) { + final EntityVillagerAbstract villager = (EntityVillagerAbstract) entity1; + final EntityHuman human = villager.getTrader(); + if (human != null) { + villager.setTradingPlayer(null); + } + } + // Paper end worldserver.removeEntity(entity1); }