From ee11d9aa4533268dbb4d22be0e2d1b81682c7754 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Thu, 27 Mar 2014 23:31:37 -0500 Subject: [PATCH] Added Waila details for WAP. --- tile/networking/TileWireless.java | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tile/networking/TileWireless.java b/tile/networking/TileWireless.java index cabbd42a..b2a91d00 100644 --- a/tile/networking/TileWireless.java +++ b/tile/networking/TileWireless.java @@ -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); + } + }