testserver/Spigot-Server-Patches/0126-Don-t-let-fishinghooks...

40 lines
1.5 KiB
Diff
Raw Normal View History

From d72d69736365f04a5b40642fc3262d44e449b37e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Fri, 16 Dec 2016 16:03:19 -0600
Subject: [PATCH] Don't let fishinghooks use portals
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 7e552f985a..2ab877c87b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2019-12-11 23:43:22 +00:00
@@ -161,7 +161,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean ac;
public boolean impulse;
public int portalCooldown;
2019-12-11 23:43:22 +00:00
- protected boolean af;
+ protected boolean af; public final boolean inPortal() { return this.af; } // Paper - OBFHELPER
protected int ag;
public DimensionManager dimension;
2019-12-11 23:43:22 +00:00
protected BlockPosition ai;
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index 40bdcf4e75..39e3bd3795 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
2019-12-11 23:43:22 +00:00
@@ -160,6 +160,12 @@ public class EntityFishingHook extends Entity {
2019-04-27 06:26:04 +00:00
this.setMot(this.getMot().a(0.92D));
2019-12-11 23:43:22 +00:00
this.Z();
+
+ // Paper start - These shouldn't be going through portals
+ if (this.inPortal()) {
+ this.die();
+ }
+ // Paper end
}
}
--
2.25.1