Paper/Spigot-Server-Patches/0126-Don-t-let-fishinghooks-use-portals.patch
Spottedleaf 19de9af63c 1.15.2 update (#2887)
Functional GUI fix added by billygalbreath
2020-01-21 20:02:07 -06:00

40 Zeilen
1.5 KiB
Diff

From a5768da83c6aba10ce497130a14e158cfcbccd57 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 3dff47bc3..aad703d68 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -161,7 +161,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean ac;
public boolean impulse;
public int portalCooldown;
- protected boolean af;
+ protected boolean af; public final boolean inPortal() { return this.af; } // Paper - OBFHELPER
protected int ag;
public DimensionManager dimension;
protected BlockPosition ai;
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index b10de807e..7a8b8b0d6 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -160,6 +160,12 @@ public class EntityFishingHook extends Entity {
this.setMot(this.getMot().a(0.92D));
this.Z();
+
+ // Paper start - These shouldn't be going through portals
+ if (this.inPortal()) {
+ this.die();
+ }
+ // Paper end
}
}
--
2.25.0.windows.1