use of gregtech.api.net.PacketUIClientAction in project GregTech by GregTechCE.
the class ModularUIContainer method writeClientAction.
@Override
public void writeClientAction(Widget widget, int updateId, Consumer<PacketBuffer> payloadWriter) {
int widgetId = modularUI.guiWidgets.inverse().get(widget);
PacketBuffer packetBuffer = new PacketBuffer(Unpooled.buffer());
packetBuffer.writeVarInt(updateId);
payloadWriter.accept(packetBuffer);
if (modularUI.entityPlayer instanceof EntityPlayerSP) {
PacketUIClientAction widgetUpdate = new PacketUIClientAction(windowId, widgetId, packetBuffer);
NetworkHandler.channel.sendToServer(NetworkHandler.packet2proxy(widgetUpdate));
}
}
Aggregations