use of com.bluepowermod.client.gui.IGuiButtonSensitive in project BluePower by Qmunity.
the class MessageGuiUpdate method handle.
public static void handle(MessageGuiUpdate msg, Supplier<NetworkEvent.Context> contextSupplier) {
NetworkEvent.Context context = contextSupplier.get();
context.enqueueWork(() -> {
ServerPlayerEntity player = context.getSender();
if (player == null) {
return;
}
Container container = player.containerMenu;
if (container instanceof IGuiButtonSensitive) {
((IGuiButtonSensitive) container).onButtonPress(player, msg.messageId, msg.value);
}
});
contextSupplier.get().setPacketHandled(true);
}
Aggregations