Patched end gateway

This commit is contained in:
MrHua269
2025-01-31 22:10:45 +08:00
parent a92a95b296
commit c4c8fd3d62

View File

@@ -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(