Paper/Spigot-Server-Patches/0130-Don-t-let-fishinghooks-use-portals.patch

40 lines
1.5 KiB
Diff
Raw Normal View History

2019-05-06 04:58:04 +02:00
From 5f0ebb18b40884e04d4ec3cc143b75a76dbc3035 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
2019-05-06 04:58:04 +02:00
index 2f1cd47619..e74baac5bc 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2019-05-06 04:58:04 +02:00
@@ -156,7 +156,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
2019-04-27 08:26:04 +02:00
public boolean af;
public boolean impulse;
public int portalCooldown;
2019-04-27 08:26:04 +02:00
- protected boolean ai;
+ protected boolean ai; public final boolean inPortal() { return this.ai; } // Paper - OBFHELPER
protected int aj;
public DimensionManager dimension;
2019-04-27 08:26:04 +02:00
protected BlockPosition al;
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
2019-05-06 04:58:04 +02:00
index b082d0a820..15a686cb29 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
2019-04-27 08:26:04 +02:00
@@ -163,6 +163,12 @@ public class EntityFishingHook extends Entity {
this.setMot(this.getMot().a(0.92D));
this.setPosition(this.locX, this.locY, this.locZ);
+
+ // Paper start - These shouldn't be going through portals
+ if (this.inPortal()) {
+ this.die();
+ }
+ // Paper end
}
}
--
2.21.0