mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
I've either fixed going to The End, or made it worse. I'm sure we'll find out soon!
This commit is contained in:
@@ -305,7 +305,7 @@ public class ServerConfigurationManager {
|
||||
|
||||
public void a(EntityPlayer entityplayer, int i) {
|
||||
// CraftBukkit start -- Replaced the standard handling of portals with a more customised method.
|
||||
int dimension = entityplayer.dimension;
|
||||
int dimension = i;
|
||||
WorldServer fromWorld = this.server.getWorldServer(dimension);
|
||||
WorldServer toWorld = null;
|
||||
if (dimension < 10) {
|
||||
@@ -315,13 +315,28 @@ public class ServerConfigurationManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
double blockRatio = dimension == -1 ? 8 : 0.125;
|
||||
|
||||
Location fromLocation = new Location(fromWorld.getWorld(), entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
||||
Location toLocation = toWorld == null ? null : new Location(toWorld.getWorld(), (entityplayer.locX * blockRatio), entityplayer.locY, (entityplayer.locZ * blockRatio), entityplayer.yaw, entityplayer.pitch);
|
||||
Location toLocation = null;
|
||||
|
||||
if (toWorld != null) {
|
||||
if ((dimension == -1) || (dimension == 0)) {
|
||||
double blockRatio = dimension == 0 ? 8 : 0.125;
|
||||
|
||||
toLocation = toWorld == null ? null : new Location(toWorld.getWorld(), (entityplayer.locX * blockRatio), entityplayer.locY, (entityplayer.locZ * blockRatio), entityplayer.yaw, entityplayer.pitch);
|
||||
} else {
|
||||
ChunkCoordinates coords = toWorld.d();
|
||||
toLocation = new Location(toWorld.getWorld(), coords.x, coords.y, coords.z, 90, 0);
|
||||
}
|
||||
}
|
||||
|
||||
org.bukkit.craftbukkit.PortalTravelAgent pta = new org.bukkit.craftbukkit.PortalTravelAgent();
|
||||
PlayerPortalEvent event = new PlayerPortalEvent((Player) entityplayer.getBukkitEntity(), fromLocation, toLocation, pta);
|
||||
|
||||
if (entityplayer.dimension == 1) {
|
||||
event.useTravelAgent(false);
|
||||
}
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled() || event.getTo() == null) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user