Fix locking behavior again (this time thru controller)

This commit is contained in:
Justin Aquadro committed 2015-05-31 02:14:19 -04:00
1 parent a6d2973a88
commit bdd3759af6
2 files changed
+6 -1

No files matched your search

@@ -16,7 +16,7 @@ public interface IFractionalDrawer extends IDrawer
/**
* Gets the number of items left in the drawer if the maximum number of equivalent compressed items had been removed.
* The equivalency is determined by the conversion rate.
* The equivalency is determined by the next compression tier, and not necessarily the conversion rate.
*/
int getStoredItemRemainder ();
}
@@ -6,6 +6,8 @@ import com.jaquadro.minecraft.storagedrawers.api.inventory.SlotType;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
import com.jaquadro.minecraft.storagedrawers.api.inventory.IDrawerInventory;
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.ILockable;
import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.LockAttribute;
import com.jaquadro.minecraft.storagedrawers.storage.IUpgradeProvider;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -63,6 +65,9 @@ public class StorageInventory implements IDrawerInventory
if (drawer == null)
return false;
if (drawer.isEmpty() && drawer instanceof ILockable && ((ILockable) drawer).isLocked(LockAttribute.LOCK_EMPTY))
return false;
return drawer.canItemBeStored(stack);
}