Try to lower the amount of time spent on each move event as mentioned in

issue #26
This commit is contained in:
graywolf336
2014-05-08 19:30:20 -05:00
parent 0bb679329d
commit 3e54d79dd3
10 changed files with 38 additions and 40 deletions

View File

@ -1,6 +1,6 @@
package com.graywolf336.jail.command.subcommands;
import java.util.HashSet;
import java.util.Collection;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
@ -41,13 +41,13 @@ public class JailListCommand implements Command {
//No jail was found
sender.sendMessage(" " + jm.getPlugin().getJailIO().getLanguageString(LangString.NOJAIL, args[1]));
}else {
HashSet<Prisoner> pris = j.getAllPrisoners();
Collection<Prisoner> pris = j.getAllPrisoners().values();
if(pris.isEmpty()) {
//If there are no prisoners, then send that message
sender.sendMessage(" " + jm.getPlugin().getJailIO().getLanguageString(LangString.NOPRISONERS, j.getName()));
}else {
for(Prisoner p : j.getAllPrisoners()) {
for(Prisoner p : pris) {
//graywolf663: Being gray's evil twin; CONSOLE (10)
//prisoner: reason; jailer (time in minutes)
sender.sendMessage(ChatColor.BLUE + " " + p.getLastKnownName() + ": " + p.getReason() + "; " + p.getJailer() + " (" + p.getRemainingTimeInMinutes() + " mins)");

View File

@ -41,7 +41,7 @@ public class JailTransferAllCommand implements Command {
jm.getPlugin().debug("Sending the transferring off, jail checks all came clean.");
Jail old = jm.getJail(args[1]);
HashSet<Prisoner> oldPrisoners = new HashSet<Prisoner>(old.getAllPrisoners());
HashSet<Prisoner> oldPrisoners = new HashSet<Prisoner>(old.getAllPrisoners().values());
//Transfer all the prisoners
for(Prisoner p : oldPrisoners) {