Fix some null warnings

This commit is contained in:
mezz committed 2016-10-20 23:51:14 -07:00
1 parent c6783e573c
commit 3178aa890d
22 files changed
+114 -95

No files matched your search

@@ -160,10 +160,13 @@ public class ContainerCraftGUI extends Container {
if (slotnumber < 0) {
return null;
}
final Slot shiftClickedSlot = (Slot) this.inventorySlots.get(slotnumber);
final Slot shiftClickedSlot = this.inventorySlots.get(slotnumber);
ItemStack itemstack = null;
if (shiftClickedSlot.getHasStack()) {
itemstack = shiftClickedSlot.getStack().copy();
ItemStack shiftClickedStack = shiftClickedSlot.getStack();
if (shiftClickedStack != null) {
itemstack = shiftClickedStack.copy();
}
}
final IInventory playerInventory = player.inventory;
final IInventory containerInventory = this.window.getInventory();
@@ -265,7 +268,7 @@ public class ContainerCraftGUI extends Container {
}
if (shouldSend) {
//TODO INVENTORY
this.crafters.stream().filter(entityPlayer -> entityPlayer instanceof EntityPlayerMP).forEach(entityPlayer -> {
this.crafters.stream().filter(Objects::nonNull).forEach(entityPlayer -> {
System.out.println("send to:" + entityPlayer.getDisplayName().getUnformattedText());
BinnieCore.proxy.sendToPlayer(new MessageContainerUpdate(nbt.getValue()), (EntityPlayerMP) entityPlayer);
});