Only with WE-Axe in Hand, free togglecommand for everyone
Dieser Commit ist enthalten in:
Ursprung
7415455019
Commit
d9c655a91c
@ -44,6 +44,7 @@ import eu.kennytv.worldeditsui.util.ParticleHelper;
|
||||
import eu.kennytv.worldeditsui.util.SelectionType;
|
||||
import eu.kennytv.worldeditsui.util.Version;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -184,6 +185,7 @@ public final class WorldEditSUIPlugin extends JavaPlugin {
|
||||
final User user = userManager.getUser(player);
|
||||
if (user == null) continue;
|
||||
if (!user.isSelectionShown() && !user.isClipboardShown()) continue;
|
||||
if (player.getItemInHand().getType() != WESelectionListener.getWand()) continue;
|
||||
if (settings.isExpiryEnabled() && !userManager.getExpireTimestamps().containsKey(player.getUniqueId()))
|
||||
continue;
|
||||
if (settings.getPermission() != null && !player.hasPermission(settings.getPermission())) continue;
|
||||
|
@ -44,7 +44,6 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(final CommandSender sender, final Command cmd, final String s, final String[] args) {
|
||||
if (checkPermission(sender, "command")) return true;
|
||||
if (args.length == 1) {
|
||||
if (args[0].equalsIgnoreCase("toggle")) {
|
||||
if (!(sender instanceof Player)) return true;
|
||||
@ -71,7 +70,6 @@ public final class WESUICommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("toggleclipboard")) {
|
||||
if (!(sender instanceof Player)) return true;
|
||||
if (checkPermission(sender, "command.toggleclipboard")) return true;
|
||||
|
||||
final Player player = (Player) sender;
|
||||
final User user = plugin.getUserManager().getUser(player);
|
||||
|
@ -36,7 +36,7 @@ public final class WESelectionListener implements Listener {
|
||||
|
||||
private final WorldEditSUIPlugin plugin;
|
||||
private final Set<String> weCommands;
|
||||
private Material wand;
|
||||
private static Material wand;
|
||||
|
||||
public WESelectionListener(final WorldEditSUIPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
@ -64,6 +64,10 @@ public final class WESelectionListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
public static Material getWand(){
|
||||
return wand;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void playerInteract(final PlayerInteractEvent event) {
|
||||
if (!plugin.getSettings().isExpiryEnabled()) return;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren