From c4c8fd3d62485bb0ab5ed39657aa6e4ba45e3926 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Fri, 31 Jan 2025 22:10:45 +0800 Subject: [PATCH] Patched end gateway --- ...missing-teleportation-apis-for-folia.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/luminol-server/minecraft-patches/features/0041-Add-missing-teleportation-apis-for-folia.patch b/luminol-server/minecraft-patches/features/0041-Add-missing-teleportation-apis-for-folia.patch index 0011520..afcafcd 100644 --- a/luminol-server/minecraft-patches/features/0041-Add-missing-teleportation-apis-for-folia.patch +++ b/luminol-server/minecraft-patches/features/0041-Add-missing-teleportation-apis-for-folia.patch @@ -134,3 +134,37 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..c742695ea24588826f50740ad442f323 } ); }); +diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +index 61887e6b052bca715c90dff5d9cd657e0b3f6a78..d56cfb7357a88844428c1f84efdb72d0b2e63b3f 100644 +--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java ++++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +@@ -186,13 +186,27 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { + } + + // First, find the position we are trying to teleport to +- BlockPos teleportPos = portalTile.exitPortal; ++ BlockPos teleportPos2 = portalTile.exitPortal; + boolean isExactTeleport = portalTile.exactTeleport; + +- if (teleportPos == null) { ++ if (teleportPos2 == null) { + portalTile.trySearchForExit(portalWorld, portalPos); + return false; + } ++ // Luminol start - Add missing teleportation apis ++ final org.bukkit.Location orginalPortalLocation = io.papermc.paper.util.MCUtil.toLocation(toTeleport.level(), portalPos); ++ final org.bukkit.Location targetPortalLocation = io.papermc.paper.util.MCUtil.toLocation(portalWorld, teleportPos2); ++ ++ final me.earthme.luminol.api.portal.PortalLocateEvent portalLocateEvent = new me.earthme.luminol.api.portal.PortalLocateEvent( ++ orginalPortalLocation, ++ targetPortalLocation ++ ); ++ ++ portalLocateEvent.callEvent(); ++ ++ final BlockPos teleportPos = io.papermc.paper.util.MCUtil.toBlockPosition(portalLocateEvent.getDestination()); // Swap value ++ // Luminol end ++ + + // note: we handle the position from the TeleportTransition + net.minecraft.world.level.portal.TeleportTransition teleport = net.minecraft.world.level.block.EndGatewayBlock.getTeleportTransition(