This commit is contained in:
Vincent Lee committed 2016-06-10 19:31:11 -05:00
1 parent 27410530d6
commit 873aedf4e5
2 files changed
+12 -9

No files matched your search

@@ -123,9 +123,10 @@ public class BlockOpenCrate extends BlockMod implements ILexiconable, IWandable,
@Override
public void breakBlock(@Nonnull World par1World, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
InventoryHelper.dropInventory(inv, par1World, state, pos);
if (!par1World.isRemote) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(pos);
InventoryHelper.dropInventory(inv, par1World, state, pos);
}
super.breakBlock(par1World, pos, state);
}
@@ -70,7 +70,7 @@ public class TileCraftCrate extends TileOpenCrate {
private static final String TAG_PATTERN = "pattern";
public int pattern = -1;
int signal = 0;
private int signal = 0;
@Override
public int getSizeInventory() {
@@ -117,7 +117,7 @@ public class TileCraftCrate extends TileOpenCrate {
}
}
boolean craft(boolean fullCheck) {
private boolean craft(boolean fullCheck) {
if(fullCheck && !isFull())
return false;
@@ -163,14 +163,14 @@ public class TileCraftCrate extends TileOpenCrate {
return true;
}
void ejectAll() {
private void ejectAll() {
for(int i = 0; i < getSizeInventory(); ++i) {
ItemStack stack = itemHandler.getStackInSlot(i);
if(stack != null)
eject(stack, false);
itemHandler.setStackInSlot(i, null);
markDirty();
}
markDirty();
}
@Override
@@ -187,8 +187,10 @@ public class TileCraftCrate extends TileOpenCrate {
@Override
public boolean onWanded(EntityPlayer player, ItemStack stack) {
craft(false);
ejectAll();
if(!player.worldObj.isRemote) {
craft(false);
ejectAll();
}
return true;
}