Added Waila Integration.
This commit is contained in:
@@ -8,6 +8,7 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
@@ -18,7 +19,7 @@ import appeng.me.GridAccessException;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PartBasicState extends AEBasePart
|
||||
public class PartBasicState extends AEBasePart implements IPowerChannelState
|
||||
{
|
||||
|
||||
protected final int POWERED_FLAG = 1;
|
||||
@@ -116,4 +117,16 @@ public class PartBasicState extends AEBasePart
|
||||
proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPowered()
|
||||
{
|
||||
return (clientFlags & POWERED_FLAG) == POWERED_FLAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
return (clientFlags & CHANNEL_FLAG) == CHANNEL_FLAG;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
|
||||
super.writeToStream( data );
|
||||
|
||||
data.writeByte( spin );
|
||||
data.writeBoolean( isLocked );
|
||||
data.writeBoolean( configuredItem != null ? true : false );
|
||||
if ( configuredItem != null )
|
||||
configuredItem.writeToPacket( data );
|
||||
@@ -112,6 +113,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
|
||||
boolean stuff = super.readFromStream( data );
|
||||
|
||||
spin = data.readByte();
|
||||
isLocked = data.readBoolean();
|
||||
boolean val = data.readBoolean();
|
||||
if ( val )
|
||||
configuredItem = AEItemStack.loadItemStackFromPacket( data );
|
||||
@@ -136,6 +138,7 @@ public class PartStorageMonitor extends PartMonitor implements IPartStorageMonit
|
||||
{
|
||||
isLocked = !isLocked;
|
||||
player.addChatMessage( (isLocked ? PlayerMessages.isNowLocked : PlayerMessages.isNowUnlocked).get() );
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
else if ( !isLocked )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user