More Expendable.

This commit is contained in:
AlgorithmX2 2013-12-29 23:58:08 -06:00
parent 422c91d03a
commit 5a89b97099
1 changed files with 10 additions and 5 deletions

View File

@ -15,8 +15,8 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
{
protected IAEAppEngInventory te;
int size;
int maxStack;
protected int size;
protected int maxStack;
protected ItemStack inv[];
@ -40,6 +40,11 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
inv = new ItemStack[s];
}
protected boolean eventsEnabled()
{
return Platform.isServer();
}
public void setMaxStackSize(int s)
{
maxStack = s;
@ -67,7 +72,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
else
ns = split.splitStack( qty );
if ( te != null && Platform.isServer() )
if ( te != null && eventsEnabled() )
{
te.onChangeInventory( this, slot, InvOperation.decrStackSize, ns, null );
}
@ -90,7 +95,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
ItemStack oldStack = inv[slot];
inv[slot] = newItemStack;
if ( te != null && Platform.isServer() )
if ( te != null && eventsEnabled() )
{
ItemStack removed = oldStack;
ItemStack added = newItemStack;
@ -122,7 +127,7 @@ public class AppEngInternalInventory implements IInventory, Iterable<ItemStack>
@Override
public void onInventoryChanged()
{
if ( te != null && Platform.isServer() )
if ( te != null && eventsEnabled() )
{
te.onChangeInventory( this, -1, InvOperation.onInventoryChanged, null, null );
}