Changed AE Tile Event Stuff.
This commit is contained in:
@@ -5,7 +5,6 @@ import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -45,6 +44,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.helpers.AENoHandler;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
import appeng.tile.events.AETileEventHandler;
|
||||
@@ -55,7 +55,7 @@ import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHandler, IStorageMonitorable
|
||||
public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHandler, IStorageMonitorable, IPriorityHost
|
||||
{
|
||||
|
||||
static final AENoHandler noHandler = new AENoHandler();
|
||||
@@ -109,7 +109,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
{
|
||||
|
||||
public invManger() {
|
||||
super( EnumSet.of( TileEventType.TICK, TileEventType.NETWORK, TileEventType.WORLD_NBT ) );
|
||||
super( TileEventType.TICK, TileEventType.NETWORK, TileEventType.WORLD_NBT );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -664,4 +664,23 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority(int newValue)
|
||||
{
|
||||
priority = newValue;
|
||||
|
||||
icell = null;
|
||||
fcell = null;
|
||||
isCached = false; // recalculate the storage cell.
|
||||
|
||||
try
|
||||
{
|
||||
gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package appeng.tile.storage;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,6 +26,7 @@ import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.storage.DriveWatcher;
|
||||
import appeng.me.storage.MEInventoryHandler;
|
||||
@@ -37,7 +37,7 @@ import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class TileDrive extends AENetworkInvTile implements IChestOrDrive
|
||||
public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPriorityHost
|
||||
{
|
||||
|
||||
final int sides[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
@@ -74,7 +74,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive
|
||||
{
|
||||
|
||||
public invManger() {
|
||||
super( EnumSet.of( TileEventType.WORLD_NBT, TileEventType.NETWORK ) );
|
||||
super( TileEventType.WORLD_NBT, TileEventType.NETWORK );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -316,4 +316,22 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive
|
||||
return gridProxy.isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPriority(int newValue)
|
||||
{
|
||||
priority = newValue;
|
||||
onInventoryChanged();
|
||||
|
||||
isCached = false; // recalculate the storage cell.
|
||||
updateState();
|
||||
|
||||
try
|
||||
{
|
||||
gridProxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch (GridAccessException e)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package appeng.tile.storage;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -64,7 +62,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
{
|
||||
|
||||
public TileIOPortHandler() {
|
||||
super( EnumSet.of( TileEventType.WORLD_NBT ) );
|
||||
super( TileEventType.WORLD_NBT );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user