mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 12:11:47 +01:00
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
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 ceb8e91ba1f14a6d6ab516753f87bbd5b681a18a..62f2a93fe4c9761251ce63bdb95757c72733da7b 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -585,6 +585,14 @@ public abstract class PlayerList {
|
|
PlayerList.LOGGER.debug("Removing player mount");
|
|
entityplayer.stopRiding();
|
|
entity.getPassengersAndSelf().forEach((entity1) -> {
|
|
+ // Paper start
|
|
+ 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
|
|
entity1.setRemoved(Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
|
});
|
|
}
|