Skip to content

Commit

Permalink
Update EntityPortalListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev7ex committed Aug 20, 2024
1 parent 3aaeed0 commit ef2d20f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ public void handleEntityEnterPortal(final EntityPortalEvent event) {
if (event.getFrom().getWorld() == null) {
return;
}
final BukkitWorldHolder fromWorldHolder = super.getWorldProvider().getWorldHolder(event.getFrom().getWorld().getName()).orElseThrow();

if (super.getWorldProvider().getWorldHolder(event.getFrom().getWorld().getName()).isEmpty()) {
return;
}
final BukkitWorldHolder fromWorldHolder = super.getWorldProvider()
.getWorldHolder(event.getFrom().getWorld().getName())
.get();

if ((event.getTo() == null) || (event.getTo().getWorld() == null)) {
return;
Expand Down

0 comments on commit ef2d20f

Please sign in to comment.