Fixes an issue with entity teleportation if nether/end worlds are disabled (#2227)
There was a bug that used old code (environment switching) for teleportation out of dimension. The issue should be fixed with calling just calling teleportation with portal environment.
This commit is contained in:
parent
63d092db93
commit
a35353a802
|
@ -150,18 +150,9 @@ public class EntityTeleportListener extends AbstractTeleportListener implements
|
||||||
// Entities are teleported instantly.
|
// Entities are teleported instantly.
|
||||||
if (!Bukkit.getAllowNether() && type.equals(Material.NETHER_PORTAL))
|
if (!Bukkit.getAllowNether() && type.equals(Material.NETHER_PORTAL))
|
||||||
{
|
{
|
||||||
if (fromWorld == overWorld)
|
this.portalProcess(
|
||||||
{
|
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
||||||
this.portalProcess(
|
World.Environment.NETHER);
|
||||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
|
||||||
World.Environment.NETHER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.portalProcess(
|
|
||||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
|
||||||
World.Environment.NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do not process anything else.
|
// Do not process anything else.
|
||||||
return;
|
return;
|
||||||
|
@ -170,18 +161,9 @@ public class EntityTeleportListener extends AbstractTeleportListener implements
|
||||||
// Entities are teleported instantly.
|
// Entities are teleported instantly.
|
||||||
if (!Bukkit.getAllowEnd() && (type.equals(Material.END_PORTAL) || type.equals(Material.END_GATEWAY)))
|
if (!Bukkit.getAllowEnd() && (type.equals(Material.END_PORTAL) || type.equals(Material.END_GATEWAY)))
|
||||||
{
|
{
|
||||||
if (fromWorld == this.getNetherEndWorld(overWorld, World.Environment.THE_END))
|
this.portalProcess(
|
||||||
{
|
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
||||||
this.portalProcess(
|
World.Environment.THE_END);
|
||||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
|
||||||
World.Environment.NORMAL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.portalProcess(
|
|
||||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
|
||||||
World.Environment.THE_END);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue