diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 534fe8641..569cf4481 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -6,6 +6,7 @@ import com.earth2me.essentials.Essentials; import com.earth2me.essentials.ItemDb; import com.earth2me.essentials.User; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -40,6 +41,11 @@ public class Commandgive extends EssentialsCommand if (args.length > 2 && Integer.parseInt(args[2]) > 0) { stack.setAmount(Integer.parseInt(args[2])); } + + if (stack.getType() == Material.AIR) { + sender.sendMessage(ChatColor.RED + "You can't give air."); + return; + } User giveTo = getPlayer(server, args, 0); String itemName = stack.getType().name().toLowerCase().replace('_', ' '); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index 3331a8985..0a577892d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -5,6 +5,7 @@ import com.earth2me.essentials.Essentials; import com.earth2me.essentials.ItemDb; import com.earth2me.essentials.User; import org.bukkit.ChatColor; +import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -38,6 +39,11 @@ public class Commanditem extends EssentialsCommand if (args.length > 1 && Integer.parseInt(args[1]) > 0) { stack.setAmount(Integer.parseInt(args[1])); } + + if (stack.getType() == Material.AIR) { + user.sendMessage(ChatColor.RED + "You can't get air."); + return; + } String itemName = stack.getType().name().toLowerCase().replace('_', ' '); user.charge(this);