Added Waila details for WAP.

This commit is contained in:
AlgorithmX2 2014-03-27 23:31:37 -05:00
parent c40c81070c
commit ee11d9aa45

View file

@ -8,6 +8,7 @@ import java.util.EnumSet;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.implementations.tiles.IWirelessAccessPoint;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGrid;
@ -23,8 +24,9 @@ import appeng.tile.events.TileEventType;
import appeng.tile.grid.AENetworkInvTile;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.Platform;
public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoint
public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoint, IPowerChannelState
{
public static final int POWERED_FLAG = 1;
@ -148,23 +150,29 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
{
return AEConfig.instance.wireless_getMaxRange( getBoosters() );
}
@Override
public boolean isActive()
{
if ( Platform.isClient() )
return isPowered() && (CHANNEL_FLAG == (clientFlags & CHANNEL_FLAG));
return gridProxy.isActive();
}
@Override
public IGrid getGrid()
{
try {
try
{
return gridProxy.getGrid();
} catch (GridAccessException e) {
}
catch (GridAccessException e)
{
return null;
}
}
private int getBoosters()
{
ItemStack boosters = inv.getStackInSlot( 0 );
@ -177,4 +185,10 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
// :P
}
@Override
public boolean isPowered()
{
return POWERED_FLAG == (clientFlags & POWERED_FLAG);
}
}