Fixed with with Condenser, LevelEmiter, and Network Status Guis.
This commit is contained in:
@@ -15,6 +15,7 @@ import appeng.core.sync.packets.PacketMatterCannon;
|
||||
import appeng.core.sync.packets.PacketMockExplosion;
|
||||
import appeng.core.sync.packets.PacketMultiPart;
|
||||
import appeng.core.sync.packets.PacketPartPlacement;
|
||||
import appeng.core.sync.packets.PacketProgressBar;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
import appeng.core.sync.packets.PacketTransitionEffect;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
@@ -46,6 +47,8 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
PACKET_TRANSITION_EFFECT(PacketTransitionEffect.class),
|
||||
|
||||
PACKET_PROGRESS_VALUE(PacketProgressBar.class),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class);
|
||||
|
||||
final public Class pc;
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
@@ -19,6 +20,8 @@ public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implement
|
||||
ByteBuf stream = packet.payload();
|
||||
int packetType = -1;
|
||||
|
||||
player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
try
|
||||
{
|
||||
packetType = stream.readInt();
|
||||
|
||||
@@ -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