Skip to content

Commit

Permalink
Fix locking behavior again (this time thru controller)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed May 31, 2015
1 parent a6d2973 commit bdd3759
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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;
Expand Down Expand Up @@ -63,6 +65,9 @@ public boolean canInsertItem (int slot, ItemStack stack) {
if (drawer == null)
return false;

if (drawer.isEmpty() && drawer instanceof ILockable && ((ILockable) drawer).isLocked(LockAttribute.LOCK_EMPTY))
return false;

return drawer.canItemBeStored(stack);
}

Expand Down

0 comments on commit bdd3759

Please sign in to comment.