Skip to content

Commit

Permalink
Use safe teleport
Browse files Browse the repository at this point in the history
  • Loading branch information
EXtremeExploit committed Aug 17, 2024
1 parent c630319 commit f1c31b8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.onarandombox.MultiverseCore.api.MVWorldManager;
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
import com.onarandombox.MultiverseCore.event.MVPlayerTouchedPortalEvent;
import com.onarandombox.MultiverseCore.utils.PermissionTools;
import com.onarandombox.MultiverseNetherPortals.MultiverseNetherPortals;
Expand Down Expand Up @@ -171,7 +172,9 @@ private Location getLocation(Entity e, Location currentLocation, PortalType type

if (shouldAppearAtSpawn) {
MultiverseWorld tpTo = this.worldManager.getMVWorld(destinationWorld);
newTo = this.linkChecker.findNewTeleportLocation(tpTo.getSpawnLocation(), destinationWorld, e);
SafeTTeleporter teleporter = this.plugin.getCore().getSafeTTeleporter();
Location safeSpawn = teleporter.getSafeLocation(tpTo.getSpawnLocation());
newTo = this.linkChecker.findNewTeleportLocation(safeSpawn, destinationWorld, e);
} else {
newTo = this.linkChecker.findNewTeleportLocation(currentLocation, destinationWorld, e);
}
Expand Down

0 comments on commit f1c31b8

Please sign in to comment.