Skip to content

Commit

Permalink
Permission fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksilassila committed Oct 1, 2020
1 parent 4f3f731 commit 95e3b42
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ generation:

disableMobsOnIslands: true
tpCooldownTime: 10 # /home and /visit cooldown after damage.
blockOverworldPortalCreation: true # Don't create new portals when teleporting FROM nether.
# Blocked island names.
illegalIslandNames:
# - spawn
2 changes: 1 addition & 1 deletion src/me/aleksilassila/islands/commands/IslandCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import me.aleksilassila.islands.Islands;
import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.ChatUtils;
import org.bukkit.ChatColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import com.sun.istack.internal.Nullable;
import me.aleksilassila.islands.Islands;
import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.subcommands.*;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.ChatUtils;
import me.aleksilassila.islands.utils.ConfirmItem;
import me.aleksilassila.islands.utils.Messages;
import org.bukkit.Bukkit;
import org.bukkit.block.Biome;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
Expand Down
2 changes: 1 addition & 1 deletion src/me/aleksilassila/islands/commands/TrustCommands.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.commands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.utils.Messages;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import me.aleksilassila.islands.Islands;
import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.IslandManagmentCommands;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.commands.subcommands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.Messages;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.commands.subcommands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.Messages;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.commands.subcommands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.Messages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import me.aleksilassila.islands.Islands;
import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.IslandManagmentCommands;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package me.aleksilassila.islands.commands.subcommands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.Messages;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class setSpawnSubcommand extends Subcommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.commands.subcommands;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.commands.Subcommand;
import me.aleksilassila.islands.generation.IslandGrid;
import me.aleksilassila.islands.utils.Messages;
Expand Down
4 changes: 1 addition & 3 deletions src/me/aleksilassila/islands/listeners/IslandsListener.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.aleksilassila.islands.listeners;

import me.aleksilassila.islands.Main;
import me.aleksilassila.islands.Permissions;
import me.aleksilassila.islands.utils.Permissions;
import me.aleksilassila.islands.utils.ChatUtils;
import org.bukkit.ChatColor;
import org.bukkit.Location;
Expand All @@ -26,13 +26,11 @@ public class IslandsListener extends ChatUtils implements Listener {
private final Main plugin;

private final boolean disableMobs;
private final boolean blockPortals;

public IslandsListener(Main plugin) {
this.plugin = plugin;

this.disableMobs = plugin.getConfig().getBoolean("disableMobsOnIslands");
this.blockPortals = plugin.getConfig().getBoolean("blockOverworldPortalCreation");

plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.aleksilassila.islands;
package me.aleksilassila.islands.utils;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand All @@ -8,6 +8,7 @@
public class Permissions {
public static boolean checkPermission(Player player, String permission) {
if (player.hasPermission(permission)) return true;
if (player.hasPermission("*")) return true;

String[] parts = permission.split("\\.");

Expand Down

0 comments on commit 95e3b42

Please sign in to comment.