File tree Expand file tree Collapse file tree
src/main/java/com/laytonsmith/abstraction/bukkit/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ public MCItemStack getItemAt(Integer slot) {
141141 ItemStack is = null ;
142142 if (slot == null ) {
143143 is = p .getInventory ().getItemInMainHand ();
144- // Empty slots should return null, but unlike other PlayerInventory methods,
145- // getItemInMainHand() never returns null.
146- if (is .getType () == Material .AIR ) {
147- return null ;
148- }
149144 } else if (slot == 100 ) {
150145 is = p .getInventory ().getBoots ();
151146 } else if (slot == 101 ) {
@@ -159,7 +154,7 @@ public MCItemStack getItemAt(Integer slot) {
159154 } else if (slot >= 0 && slot <= 35 ) {
160155 is = p .getInventory ().getItem (slot );
161156 }
162- if (is == null ) {
157+ if (is == null || is . getAmount () <= 0 || is . getType () == Material . AIR ) {
163158 return null ;
164159 }
165160 return new BukkitMCItemStack (is );
You can’t perform that action at this time.
0 commit comments