Fix crash when right-clicking controller with empty hand.

This commit is contained in:
Justin Aquadro committed 2016-02-08 18:17:03 -05:00
1 parent baff671b9e
commit 280719a1ef
2 files changed
+6 -5

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-1.7.8"
version = "1.7.10-1.7.9"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -157,10 +157,11 @@ public class TileEntityController extends TileEntity implements IDrawerGroup, IP
if (!dumpInventory) {
ItemStack currentStack = player.inventory.getCurrentItem();
count = insertItems(currentStack);
if (currentStack.stackSize == 0)
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
if (currentStack != null) {
count = insertItems(currentStack);
if (currentStack.stackSize == 0)
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
}
else {
for (int i = 0, n = player.inventory.getSizeInventory(); i < n; i++) {