Fixed with with Condenser, LevelEmiter, and Network Status Guis.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
public class PacketProgressBar extends AppEngPacket
|
||||
{
|
||||
|
||||
short id;
|
||||
int value;
|
||||
|
||||
// automatic.
|
||||
public PacketProgressBar(ByteBuf stream) throws IOException {
|
||||
id = stream.readShort();
|
||||
value = stream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
Container c = player.openContainer;
|
||||
if ( c instanceof AEBaseContainer )
|
||||
c.updateProgressBar( id, value );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
Container c = player.openContainer;
|
||||
if ( c instanceof AEBaseContainer )
|
||||
c.updateProgressBar( id, value );
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketProgressBar(int short_id, int value) throws IOException {
|
||||
|
||||
this.id = (short) short_id;
|
||||
this.value = value;
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( getPacketID() );
|
||||
data.writeShort( short_id );
|
||||
data.writeInt( value );
|
||||
|
||||
configureWrite( data );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user