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