Paper/Spigot-Server-Patches/0483-Ensure-safe-gateway-teleport.patch
Daniel Ennis e792da723a
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#4728)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
30885166 Update to Minecraft 1.16.4

CraftBukkit Changes:
3af81c71 Update to Minecraft 1.16.4

Spigot Changes:
f011ca24 Update to Minecraft 1.16.4

Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
2020-11-02 20:22:15 -06:00

28 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Fri, 15 May 2020 01:10:03 -0400
Subject: [PATCH] Ensure safe gateway teleport
diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
index 5550fd9ea6bcae07dcdf431322cb0da0b26a6d71..e0118a971e1ea3c52a1380f519146b8f46a425ea 100644
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
@@ -63,9 +63,14 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
} else if (!this.world.isClientSide) {
List<Entity> list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition()), TileEntityEndGateway::a);
- if (!list.isEmpty()) {
- this.b((Entity) list.get(this.world.random.nextInt(list.size())));
+ // Paper start
+ for (Entity entity : list) {
+ if (entity.canPortal()) {
+ this.b(entity);
+ break;
+ }
}
+ // Paper end
if (this.age % 2400L == 0L) {
this.h();