mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
New command to reset players permission cache
This commit is contained in:
parent
748d4fae86
commit
dc82211192
@ -6,9 +6,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
@ -18,7 +16,6 @@ import org.bukkit.configuration.ConfigurationSection;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.commands.list.gtop;
|
|
||||||
import com.gamingmesh.jobs.container.Job;
|
import com.gamingmesh.jobs.container.Job;
|
||||||
import com.gamingmesh.jobs.container.TopList;
|
import com.gamingmesh.jobs.container.TopList;
|
||||||
|
|
||||||
@ -50,7 +47,7 @@ public class SignUtil {
|
|||||||
Map<String, jobsSign> sub = signsByType.get(jSign.getIdentifier().toLowerCase());
|
Map<String, jobsSign> sub = signsByType.get(jSign.getIdentifier().toLowerCase());
|
||||||
if (sub != null) {
|
if (sub != null) {
|
||||||
sub.remove(jSign.locToBlockString());
|
sub.remove(jSign.locToBlockString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.gamingmesh.jobs.commands.list;
|
||||||
|
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gamingmesh.jobs.Jobs;
|
||||||
|
import com.gamingmesh.jobs.commands.Cmd;
|
||||||
|
import com.gamingmesh.jobs.container.ActionType;
|
||||||
|
import com.gamingmesh.jobs.container.Job;
|
||||||
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
|
import com.gamingmesh.jobs.i18n.Language;
|
||||||
|
|
||||||
|
import net.Zrips.CMILib.Locale.LC;
|
||||||
|
import net.Zrips.CMILib.Messages.CMIMessages;
|
||||||
|
|
||||||
|
public class recalculatepermissions implements Cmd {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
||||||
|
|
||||||
|
JobsPlayer jPlayer = null;
|
||||||
|
if (args.length >= 1) {
|
||||||
|
jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]);
|
||||||
|
} else if (sender instanceof Player)
|
||||||
|
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
|
||||||
|
|
||||||
|
if (jPlayer == null) {
|
||||||
|
LC.info_NoPlayer.sendMessage(sender, "[name]", args.length >= 1 ? args[0] : sender.getName());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
jPlayer.getPermissionsCache().clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -292,6 +292,9 @@ public class LanguageManager {
|
|||||||
c.get("command.entitylist.help.info", "Shows all possible entities that can be used with the plugin.");
|
c.get("command.entitylist.help.info", "Shows all possible entities that can be used with the plugin.");
|
||||||
c.get("command.entitylist.help.args", "");
|
c.get("command.entitylist.help.args", "");
|
||||||
|
|
||||||
|
c.get("command.recalculatepermissions.help.info", "Reset players permission cache");
|
||||||
|
c.get("command.recalculatepermissions.help.args", "(playername)");
|
||||||
|
|
||||||
c.get("command.stats.help.info", "Show the level you are in each job you are part of.");
|
c.get("command.stats.help.info", "Show the level you are in each job you are part of.");
|
||||||
c.get("command.stats.help.args", "[playername]");
|
c.get("command.stats.help.args", "[playername]");
|
||||||
Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]"));
|
Jobs.getGCManager().getCommandArgs().put("stats", Arrays.asList("[playername]"));
|
||||||
|
Loading…
Reference in New Issue
Block a user