From 220b920e46362c5d3a4ff6213594ffcba13d45a4 Mon Sep 17 00:00:00 2001 From: Thorinwasher Date: Sat, 1 Jun 2024 16:35:16 +0200 Subject: [PATCH] Fix edgecase scenario for portal builder --- pom.xml | 2 +- .../org/sgrewritten/stargate/api/network/PortalBuilder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fdb14897..ee9b7815 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.sgrewritten stargate - 1.0.0.16-NIGHTLY-1 + 1.0.0.16-NIGHTLY-2 StarGate The original, and still the best, transportation plugin for the Bukkit Ecosystem. https://sgrewitten.org diff --git a/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java b/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java index 0803393a..04aa9464 100644 --- a/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java +++ b/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java @@ -408,7 +408,7 @@ private void permissionAndEventHandling(RealPortal portal, Network network) thro throw new LocalisedMessageException(permissionManager.getDenyMessage(), portal, MessageType.DENY); } String[] lines = new String[]{this.portalName, destinationName == null ? "" : destinationName, network.getName(), flagsString}; - StargateCreatePortalEvent portalCreateEvent = new StargateCreatePortalEvent(eventTarget, portal, lines, !hasPermission, permissionManager == null ? "" : permissionManager.getDenyMessage(), cost); + StargateCreatePortalEvent portalCreateEvent = new StargateCreatePortalEvent(eventTarget, portal, lines, !hasPermission, hasPermission ? "" : permissionManager.getDenyMessage(), cost); Bukkit.getPluginManager().callEvent(portalCreateEvent); Stargate.log(Level.CONFIG, " player has permission = " + hasPermission);