mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-25 01:21:21 +01:00
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.
|
||||
if (!Bukkit.getAllowNether() && type.equals(Material.NETHER_PORTAL))
|
||||
{
|
||||
if (fromWorld == overWorld)
|
||||
{
|
||||
this.portalProcess(
|
||||
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);
|
||||
}
|
||||
this.portalProcess(
|
||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
||||
World.Environment.NETHER);
|
||||
|
||||
// Do not process anything else.
|
||||
return;
|
||||
@ -170,18 +161,9 @@ public class EntityTeleportListener extends AbstractTeleportListener implements
|
||||
// Entities are teleported instantly.
|
||||
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),
|
||||
World.Environment.NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.portalProcess(
|
||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
||||
World.Environment.THE_END);
|
||||
}
|
||||
this.portalProcess(
|
||||
new EntityPortalEvent(entity, event.getLocation(), event.getLocation(), 0),
|
||||
World.Environment.THE_END);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user