Skip to content

Commit

Permalink
Make entities appear at world spawn when they go trough exit end portal
Browse files Browse the repository at this point in the history
  • Loading branch information
EXtremeExploit committed Apr 8, 2024
1 parent 7a46c67 commit fb2cfbb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ private Location getLocation(Entity e, Location currentLocation, PortalType type
} else {
String destinationWorld = "";

boolean shouldAppearAtSpawn = false;

if (this.nameChecker.isValidEndName(currentWorld)) {
if (type == PortalType.ENDER) {
destinationWorld = this.nameChecker.getNormalName(currentWorld, type);
shouldAppearAtSpawn = true;
} else if (type == PortalType.NETHER) {
destinationWorld = this.nameChecker.getNetherName(this.nameChecker.getNormalName(currentWorld, type));
}
Expand All @@ -166,7 +169,14 @@ private Location getLocation(Entity e, Location currentLocation, PortalType type
}
}

newTo = this.linkChecker.findNewTeleportLocation(currentLocation, destinationWorld, e);
if (shouldAppearAtSpawn) {
MultiverseWorld tpTo = this.worldManager.getMVWorld(destinationWorld);
newTo = this.linkChecker.findNewTeleportLocation(tpTo.getSpawnLocation(), destinationWorld, e);

} else {
newTo = this.linkChecker.findNewTeleportLocation(currentLocation, destinationWorld, e);
}

}
}

Expand Down

0 comments on commit fb2cfbb

Please sign in to comment.