Skip to content

Commit

Permalink
only start teleporting if the entity is still in the portal
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Aug 23, 2024
1 parent 16d8aa7 commit 34f33c9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ public void onEntityInsidePortal(final EntityInsideBlockEvent event) {
event.setCancelled(true);

entity.getScheduler().execute(plugin, () -> {
Block currentBlock = entity.getLocation().getBlock();
if (currentBlock.getType() != blockTypeInside) {
debug.debug("The entity is not in the portal");
portalTeleportCache.remove(entity.getUniqueId());
return;
}

World.Environment fromEnvironment = from.getWorld().getEnvironment();
World.Environment toEnvironment = toWorld.getEnvironment();
Location to;
Expand Down

0 comments on commit 34f33c9

Please sign in to comment.