|
|
|
|
@@ -19,7 +19,7 @@ index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f6
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
|
|
|
|
index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..29fc2e5af0b6ec81c3f0c1c89f76166e7f4ac19c 100644
|
|
|
|
|
index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..c742695ea24588826f50740ad442f3234953ba81 100644
|
|
|
|
|
--- a/net/minecraft/world/entity/Entity.java
|
|
|
|
|
+++ b/net/minecraft/world/entity/Entity.java
|
|
|
|
|
@@ -4164,6 +4164,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
|
|
|
@@ -120,7 +120,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..29fc2e5af0b6ec81c3f0c1c89f76166e
|
|
|
|
|
// Kaiiju start - sync end platform spawning & entity teleportation
|
|
|
|
|
final java.util.function.Consumer<Entity> tpComplete = type == PortalType.END && destination.getTypeKey() == LevelStem.END ?
|
|
|
|
|
- e -> net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, ServerLevel.END_SPAWN_POINT.below(), true, null) : teleportComplete;
|
|
|
|
|
+ e -> { if (new me.earthme.luminol.api.portal.EndPlatformCreateEvent().callEvent()) net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, ServerLevel.END_SPAWN_POINT.below(), true, null); } : teleportComplete; // Luminol - Add missing teleportation events
|
|
|
|
|
+ e -> { if (new me.earthme.luminol.api.portal.EndPlatformCreateEvent().callEvent() && ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(e.level, ServerLevel.END_SPAWN_POINT.below())) net.minecraft.world.level.levelgen.feature.EndPlatformFeature.createEndPlatform(destination, ServerLevel.END_SPAWN_POINT.below(), true, null); } : teleportComplete; // Luminol - Add missing teleportation events & Fix teleportation api threading issue
|
|
|
|
|
// Kaiiju end
|
|
|
|
|
|
|
|
|
|
Vec3 initialPosition = this.position();
|
|
|
|
|
@@ -134,3 +134,37 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..29fc2e5af0b6ec81c3f0c1c89f76166e
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
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(
|
|
|
|
|
|