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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-05-16 01:42:36 +02:00
|
|
|
index 66fbbc4c91e16a3dfb4bb756972e667121693501..cf457f6b6ee2968f68f4eede30bb703a6a4f990b 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
2021-03-16 14:04:28 +01:00
|
|
|
@@ -77,6 +77,7 @@ 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;
|
|
|
|
@@ -621,6 +622,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);
|
|
|
|
}
|
|
|
|
|