PaperMC/Spigot-Server-Patches/0648-Fix-villager-boat-exploit.patch

27 lines
1.3 KiB
Diff
Raw Normal View History

2021-01-11 22:23:11 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.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/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
2021-02-22 09:03:03 +01:00
index 643694ff776986fdbecadff57b9a9b49763dc50c..ae2af6bbd62ba3487b82afe4948cb3b2aa16bf2d 100644
2021-01-11 22:23:11 +01:00
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
2021-02-22 09:03:03 +01:00
@@ -543,6 +543,15 @@ public abstract class PlayerList {
2021-01-11 22:23:11 +01:00
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);
}