mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
[trunk] empty fields in Inventory now return null instead of Material.AIR
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1156 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
51ec3434f5
commit
22f9b76d77
@ -430,7 +430,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
}
|
||||
User user = User.get(event.getPlayer());
|
||||
ItemStack is = user.getItemInHand();
|
||||
if (is.getType() == Material.AIR) {
|
||||
if (is == null || is.getType() == Material.AIR) {
|
||||
return;
|
||||
}
|
||||
String command = user.getPowertool(is);
|
||||
|
@ -287,7 +287,7 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
savedInventory = is;
|
||||
config.setProperty("inventory.size", is.length);
|
||||
for (int i = 0; i < is.length; i++) {
|
||||
if (is[i].getType() == Material.AIR) {
|
||||
if (is[i] == null || is[i].getType() == Material.AIR) {
|
||||
continue;
|
||||
}
|
||||
config.setProperty("inventory."+i, is[i]);
|
||||
|
@ -16,7 +16,7 @@ public class Commandpowertool extends EssentialsCommand {
|
||||
protected void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception {
|
||||
|
||||
ItemStack is = user.getItemInHand();
|
||||
if (is.getType() == Material.AIR) {
|
||||
if (is == null || is.getType() == Material.AIR) {
|
||||
user.sendMessage("Command can't be attached to air.");
|
||||
}
|
||||
String command = getFinalArg(args, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user