Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ public void onEntityPortalEnter(EntityPortalEnterEvent event) {

Location currentLocation = this.locationManipulation.getBlockLocation(event.getLocation());

if (customPortalsHandler.isHandledByCustomPortals(event.getEntity(), currentLocation)) {
return;
}

// determine what kind of portal the player is using
PortalType type = switch (currentLocation.getBlock().getType()) {
case END_PORTAL -> PortalType.ENDER;
Expand All @@ -213,9 +209,17 @@ public void onEntityPortalEnter(EntityPortalEnterEvent event) {
// in a portal. they'll automatically be removed when they leave
eventRecord.addToRecord(type, player.getUniqueId());

if (customPortalsHandler.isHandledByCustomPortals(player, event.getLocation().clone())) {
return;
}

MVPlayerTouchedPortalEvent playerTouchedPortalEvent = new MVPlayerTouchedPortalEvent(player, event.getLocation());
Bukkit.getPluginManager().callEvent(playerTouchedPortalEvent);
Location eventLocation = event.getLocation().clone();
if (playerTouchedPortalEvent.isCancelled()) {
Logging.finest("Another plugin cancelled the enter Event for NetherPortals!");
return;
}
if (!playerTouchedPortalEvent.canUseThisPortal()) {
// Someone else said the player is not allowed to go here.
if (this.shootPlayer(player, eventLocation.getBlock(), type)) {
Expand All @@ -224,10 +228,6 @@ public void onEntityPortalEnter(EntityPortalEnterEvent event) {

Logging.finest("Someone requested that this player be bounced back!");
}
if (playerTouchedPortalEvent.isCancelled()) {
Logging.finest("Someone cancelled the enter Event for NetherPortals!");
return;
}

if (this.playerErrors.containsKey(player.getName())) {
Date lastTry = this.playerErrors.get(player.getName());
Expand Down
Loading