Don't fill locked drawers if they are blank.

This commit is contained in:
Justin Aquadro committed 2015-05-27 01:24:08 -04:00
1 parent bfd778c0f5
commit 146c0a9d22
2 files changed
+17 -1

No files matched your search

+11 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-1.5.1"
version = "1.7.10-1.5.2"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -59,6 +59,16 @@ repositories {
url "http://dl.tsr.me/artifactory/libs-release-local"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name "RX14"
url "http://mvn.rx14.co.uk/repo/"
}
ivy {
name "MineTweaker3"
artifactPattern "http://minetweaker3.powerofbytes.com/download/[module]-[revision].[ext]"
@@ -543,6 +543,12 @@ public abstract class TileEntityDrawers extends TileEntity implements IDrawerGro
@Override
public boolean canInsertItem (int slot, ItemStack stack, int side) {
if (isLocked() && inventory instanceof StorageInventory) {
IDrawer drawer = getDrawer(inventory.getDrawerSlot(slot));
if (drawer != null && drawer.isEmpty())
return false;
}
return inventory.canInsertItem(slot, stack, side);
}