3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0124-Don-t-let-fishinghooks-use-portals.patch

37 Zeilen
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 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 3f1dbca881ce19a633fc7c20d26d1a25b550edf7..8a2093ac5a6d47c795523a1aab87e46f10b1699e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
2019-12-12 00:43:22 +01:00
@@ -161,7 +161,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean ac;
public boolean impulse;
public int portalCooldown;
2019-12-12 00:43:22 +01:00
- protected boolean af;
+ protected boolean af; public final boolean inPortal() { return this.af; } // Paper - OBFHELPER
protected int ag;
public DimensionManager dimension;
2019-12-12 00:43:22 +01: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 40bdcf4e75bb36385e82ba8b8f2471760072705a..39e3bd37956d7e0a4d5f784a581e17a77b71f78b 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
2019-12-12 00:43:22 +01:00
@@ -160,6 +160,12 @@ public class EntityFishingHook extends Entity {
2019-04-27 08:26:04 +02:00
this.setMot(this.getMot().a(0.92D));
2019-12-12 00:43:22 +01:00
this.Z();
+
+ // Paper start - These shouldn't be going through portals
+ if (this.inPortal()) {
+ this.die();
+ }
+ // Paper end
}
}