This commit is contained in:
Leijurv 2018-08-01 14:32:21 -04:00
parent 63c2b682ad
commit 2f806823a4
No known key found for this signature in database
GPG Key ID: 0936202430AE187C

View File

@ -12,6 +12,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAir;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.util.NonNullList;
@ -40,10 +41,10 @@ public class ToolSet {
//Out.log("inv: " + Arrays.toString(inv));
boolean fnull = false;
for (byte i = 0; i < 9; i++) {
if (!fnull || (inv.get(i) != null && inv.get(i).getItem() instanceof ItemTool)) {
tools.add(inv.get(i) != null ? (ItemTool) inv.get(i).getItem() : null);
if (!fnull || ((!(inv.get(i).getItem() instanceof ItemAir)) && inv.get(i).getItem() instanceof ItemTool)) {
tools.add((!(inv.get(i).getItem() instanceof ItemAir)) ? (ItemTool) inv.get(i).getItem() : null);
slots.add(i);
fnull |= inv.get(i) == null || (!inv.get(i).getItem().isDamageable());
fnull |= (inv.get(i).getItem() instanceof ItemAir) || (!inv.get(i).getItem().isDamageable());
}
}
}