Changes the API to reject items inserted into empty drawers that are
locked to nothing.  (not locked to a specific item)
This commit is contained in:
1n5aN1aC committed 2015-11-19 11:37:03 -08:00
1 parent c4a3e46b67
commit 630e4f7d14
3 files changed
+4 -3

No files matched your search

@@ -67,6 +67,7 @@ public interface IDrawer
* Stack size and available capacity are not considered. For drawers that are not empty, this
* method can allow ore-dictionary compatible items to be accepted into the drawer, as defined by what
* the drawer considers to be an equivalent item.
* For drawers that are empty, locking status is considered.
*
* @param itemPrototype An ItemStack representing the type, metadata, and tags of an item.
*/
@@ -71,8 +71,8 @@ public class CompDrawerData extends BaseDrawerData implements IFractionalDrawer,
@Override
public boolean canItemBeStored (ItemStack itemPrototype) {
if (getStoredItemPrototype() == null)
return true;
if (getStoredItemPrototype() == null && !isLocked(LockAttribute.LOCK_POPULATED))
return true;
return areItemsEqual(itemPrototype);
}
@@ -135,7 +135,7 @@ public class DrawerData extends BaseDrawerData implements IVoidable, IShroudable
@Override
public boolean canItemBeStored (ItemStack itemPrototype) {
if (protoStack == nullStack)
if (protoStack == nullStack && !isLocked(LockAttribute.LOCK_POPULATED))
return true;
return areItemsEqual(itemPrototype);