Fix default Jail Stick not loading correctly, closes #21
This commit is contained in:
parent
1399f8d260
commit
11d6995cc3
@ -4,6 +4,11 @@ This plugins adds Jail to your Minecraft server. Admins can define several jails
|
||||
|
||||
[![Build Status](http://ci.graywolf336.com/job/Jail/badge/icon)](http://ci.graywolf336.com/job/Jail/)
|
||||
|
||||
Beta 2 Changes
|
||||
===
|
||||
*Changes since Beta 1*
|
||||
* Fix the default Jail Stick not being loaded correctly, [#21](https://github.com/graywolf336/Jail/issues/21)
|
||||
|
||||
Beta 1 Changes
|
||||
===
|
||||
*Changes since alpha*
|
||||
|
@ -38,17 +38,24 @@ public class JailStickManager {
|
||||
//Check if the jail given, if any, exists
|
||||
if(!a[2].isEmpty()) {
|
||||
if(!pl.getJailManager().isValidJail(a[2])) {
|
||||
pl.getLogger().warning(s);
|
||||
pl.getLogger().warning("The above jail stick configuration is invalid and references a jail that doesn't exist.");
|
||||
pl.getLogger().severe(s);
|
||||
pl.getLogger().severe("The above jail stick configuration is invalid and references a jail that doesn't exist.");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Material m = Material.getMaterial(a[0]);
|
||||
if(this.sticks.containsKey(m)) {
|
||||
pl.getLogger().severe(s);
|
||||
pl.getLogger().severe("You can not use the same item for two different Jail Sticks. This already exists as a Jail Stick: " + a[0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
this.sticks.put(Material.getMaterial(a[0]), new Stick(a[2], a[1], Long.valueOf(a[3])));
|
||||
this.sticks.put(m, new Stick(a[2], a[3], Long.valueOf(a[1])));
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
pl.getLogger().info(s);
|
||||
pl.getLogger().severe(s);
|
||||
pl.getLogger().severe("Unable to create a new stick for " + a[0] + ", see the exception above for details.");
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user