From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -0,0 +0,0 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityTypes; +import net.minecraft.world.entity.npc.EntityVillagerAbstract; import net.minecraft.world.entity.player.EntityHuman; import net.minecraft.world.level.ChunkCoordIntPair; import net.minecraft.world.level.EnumGamemode; @@ -0,0 +0,0 @@ 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); }