mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
d8c3fb7e47
Needs updating to hook into new entity storage system
26 lines
1.4 KiB
Diff
26 lines
1.4 KiB
Diff
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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index d8278190323d00c186d81f578f77fa335529baad..eed8b1055c4c5026ebe3ebf1541ac94beda3112e 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -612,6 +612,15 @@ 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) {
|
|
+ final net.minecraft.world.entity.npc.AbstractVillager villager = (net.minecraft.world.entity.npc.AbstractVillager) entity1;
|
|
+ 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);
|
|
});
|
|
}
|