fixed punish error

This commit is contained in:
Chiss 2014-11-10 19:15:56 +11:00
parent 0252db5a05
commit d362fb3b1c
2 changed files with 29 additions and 26 deletions

View File

@ -74,10 +74,7 @@ public class PunishPage extends CraftInventoryCustom implements Listener
PunishClient client = _plugin.GetClient(_target);
HashMap<Category, HashMap<Integer, Integer>> offenseMap = new HashMap<Category, HashMap<Integer, Integer>>();
List<Entry<Category, Punishment>> punishments = new ArrayList<Entry<Category, Punishment>>();
for (Category category : client.GetPunishments().keySet())
for (Category category : Category.values())
{
//Initialise Offences
offenseMap.put(category, new HashMap<Integer, Integer>());
@ -85,8 +82,12 @@ public class PunishPage extends CraftInventoryCustom implements Listener
offenseMap.get(category).put(1, 0);
offenseMap.get(category).put(2, 0);
offenseMap.get(category).put(3, 0);
}
List<Entry<Category, Punishment>> punishments = new ArrayList<Entry<Category, Punishment>>();
for (Category category : client.GetPunishments().keySet())
{
for (Punishment punishment : client.GetPunishments().get(category))
{
punishments.add(new AbstractMap.SimpleEntry<Category, Punishment>(category, punishment));
@ -184,26 +185,26 @@ public class PunishPage extends CraftInventoryCustom implements Listener
examplePrefixEx + " Abusing an exploit to gain an advantage",
}, 1, false, true), new PunishButton(this, Category.Exploiting, 1, true, getDuration(Category.Exploiting, 1, offenseMap)));
if (_plugin.GetClients().Get(_player).GetRank().Has(Rank.MODERATOR))
{
AddButton(30, new ShopItem(Material.INK_SACK, (byte)11, "Severity 2", new String[] {
ChatColor.RESET + "Past Offences: " + ChatColor.YELLOW + offenseMap.get(Category.Exploiting).get(2),
ChatColor.RESET + "Ban Duration: " + ChatColor.YELLOW + getDurationString(Category.Exploiting, 2, offenseMap),
" ",
examplePrefix + "Empty",
examplePrefixEx + " Currently no reason to use this :)",
}, 1, false, true), new PunishButton(this, Category.Exploiting, 2, true, getDuration(Category.Exploiting, 2, offenseMap)));
AddButton(39, new ShopItem(Material.INK_SACK, (byte)1, "Severity 3", new String[] {
ChatColor.RESET + "Past Offences: " + ChatColor.YELLOW + offenseMap.get(Category.Exploiting).get(3),
ChatColor.RESET + "Ban Duration: " + ChatColor.YELLOW + getDurationString(Category.Exploiting, 3, offenseMap),
" ",
examplePrefix + "Server Lag/Crash",
examplePrefixEx + " Abusing a bug to lag or crash a server",
" ",
}, 1, false, true), new PunishButton(this, Category.Exploiting, 3, true, getDuration(Category.Exploiting, 3, offenseMap)));
}
// if (_plugin.GetClients().Get(_player).GetRank().Has(Rank.MODERATOR))
// {
//
// AddButton(30, new ShopItem(Material.INK_SACK, (byte)11, "Severity 2", new String[] {
// ChatColor.RESET + "Past Offences: " + ChatColor.YELLOW + offenseMap.get(Category.Exploiting).get(2),
// ChatColor.RESET + "Ban Duration: " + ChatColor.YELLOW + getDurationString(Category.Exploiting, 2, offenseMap),
// " ",
// examplePrefix + "Empty",
// examplePrefixEx + " Currently no reason to use this :)",
// }, 1, false, true), new PunishButton(this, Category.Exploiting, 2, true, getDuration(Category.Exploiting, 2, offenseMap)));
//
// AddButton(39, new ShopItem(Material.INK_SACK, (byte)1, "Severity 3", new String[] {
// ChatColor.RESET + "Past Offences: " + ChatColor.YELLOW + offenseMap.get(Category.Exploiting).get(3),
// ChatColor.RESET + "Ban Duration: " + ChatColor.YELLOW + getDurationString(Category.Exploiting, 3, offenseMap),
// " ",
// examplePrefix + "Server Lag/Crash",
// examplePrefixEx + " Abusing a bug to lag or crash a server",
// " ",
// }, 1, false, true), new PunishButton(this, Category.Exploiting, 3, true, getDuration(Category.Exploiting, 3, offenseMap)));
// }
}
//XXX Hacks

View File

@ -397,6 +397,8 @@ public class SheepGame extends TeamGame
public void DeathDrop(PlayerDeathEvent event)
{
DropSheep(event.getEntity(), 0);
event.getEntity().eject();
}
@EventHandler