mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Stats command fix
This commit is contained in:
parent
8bd4ecaa04
commit
c6438684fa
@ -18,7 +18,12 @@
|
||||
|
||||
package com.gamingmesh.jobs;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
@ -59,7 +64,6 @@ import com.gamingmesh.jobs.stuff.Util;
|
||||
|
||||
import net.Zrips.CMILib.ActionBar.CMIActionBar;
|
||||
import net.Zrips.CMILib.Items.CMIItemStack;
|
||||
import net.Zrips.CMILib.Logs.CMIDebug;
|
||||
import net.Zrips.CMILib.Messages.CMIMessages;
|
||||
import net.Zrips.CMILib.NBT.CMINBT;
|
||||
import net.Zrips.CMILib.Version.Version;
|
||||
|
@ -9,13 +9,13 @@ import com.gamingmesh.jobs.commands.JobsCommands;
|
||||
import com.gamingmesh.jobs.container.JobProgression;
|
||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||
|
||||
import net.Zrips.CMILib.Logs.CMIDebug;
|
||||
import net.Zrips.CMILib.RawMessages.RawMessage;
|
||||
|
||||
public class stats implements Cmd {
|
||||
|
||||
@Override
|
||||
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
|
||||
|
||||
JobsPlayer jPlayer = null;
|
||||
if (args.length >= 1) {
|
||||
if (!Jobs.hasPermission(sender, "jobs.command.admin.stats", true))
|
||||
@ -44,13 +44,11 @@ public class stats implements Cmd {
|
||||
|
||||
String pref = JobsCommands.LABEL + " " + info.class.getSimpleName() + " ";
|
||||
|
||||
RawMessage rm = new RawMessage();
|
||||
for (JobProgression jobProg : jPlayer.progression) {
|
||||
for (String msg : Jobs.getCommandManager().jobStatsMessage(jobProg).split("\n")) {
|
||||
rm.addText(msg).addHover(leftClick).addCommand(pref + jobProg.getJob().getName());
|
||||
new RawMessage().addText(msg).addHover(leftClick).addCommand(pref + jobProg.getJob().getName()).show(sender);
|
||||
}
|
||||
}
|
||||
rm.show(sender);
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
|
||||
return true;
|
||||
|
@ -89,7 +89,7 @@ public class BlockOwnerShip {
|
||||
blockLoc old = records.get(CMILocation.toString(loc, ":", true, true));
|
||||
if (old == null)
|
||||
return false;
|
||||
|
||||
|
||||
return old.isDisabled();
|
||||
}
|
||||
|
||||
@ -202,13 +202,13 @@ public class BlockOwnerShip {
|
||||
}
|
||||
HashMap<String, blockLoc> ls = blockOwnerShips.getOrDefault(uuid, new HashMap<String, blockLoc>());
|
||||
String blockLoc = CMILocation.toString(block.getLocation(), ":", true, true);
|
||||
com.gamingmesh.jobs.stuff.blockLoc record = ls.get(blockLoc);
|
||||
if (record != null) {
|
||||
|
||||
if (record.isDisabled())
|
||||
blockLoc rec = ls.get(blockLoc);
|
||||
if (rec != null) {
|
||||
|
||||
if (rec.isDisabled())
|
||||
return false;
|
||||
|
||||
record.setDisabled(true);
|
||||
|
||||
rec.setDisabled(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user