Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Sep 1, 2024
1 parent 57e4770 commit e667c6b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FlyListener implements Listener {
/**
* Addon instance object.
*/
private final IslandFlyAddon islandFlyAddon;
private final IslandFlyAddon addon;


/**
Expand Down Expand Up @@ -61,7 +61,7 @@ public void onToggleFlight(final PlayerToggleFlightEvent event) {
* @return true if fly was blocked
*/
private boolean checkUser(User user) {
String permPrefix = islandFlyAddon.getPlugin().getIWM().getPermissionPrefix(user.getWorld());
String permPrefix = addon.getPlugin().getIWM().getPermissionPrefix(user.getWorld());
// Ignore ops
if (user.isOp() || user.getPlayer().getGameMode().equals(GameMode.CREATIVE)
|| user.getPlayer().getGameMode().equals(GameMode.SPECTATOR)
Expand All @@ -78,7 +78,7 @@ public void onEnterIsland(final IslandEnterEvent event) {
user.getPlayer().setFlying(mdv.asBoolean());
});
// Wait until after arriving at the island
Bukkit.getScheduler().runTask(this.islandFlyAddon.getPlugin(), () -> checkUser(user));
Bukkit.getScheduler().runTask(this.addon.getPlugin(), () -> checkUser(user));
}

/**
Expand All @@ -88,15 +88,15 @@ public void onEnterIsland(final IslandEnterEvent event) {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onExitIsland(final IslandExitEvent event) {
final User user = User.getInstance(event.getPlayerUUID());
String permPrefix = islandFlyAddon.getPlugin().getIWM().getPermissionPrefix(user.getWorld());
String permPrefix = addon.getPlugin().getIWM().getPermissionPrefix(user.getWorld());
// Ignore ops
if (user.isOp() || user.getPlayer().getGameMode().equals(GameMode.CREATIVE)
|| user.getPlayer().getGameMode().equals(GameMode.SPECTATOR)
|| user.hasPermission(permPrefix + "island.flybypass")
|| (!user.hasPermission(permPrefix + "island.fly")
&& !user.hasPermission(permPrefix + "island.flyspawn"))) return;
// Alert player fly will be disabled
final int flyTimeout = this.islandFlyAddon.getSettings().getFlyTimeout();
final int flyTimeout = this.addon.getSettings().getFlyTimeout();

// If timeout is 0 or less disable fly immediately
if (flyTimeout <= 0) {
Expand Down

0 comments on commit e667c6b

Please sign in to comment.