use of net.minecraft.inventory.container.Container in project BluePower by Qmunity.
the class MessageCraftingSync method handle.
public static void handle(MessageCraftingSync msg, Supplier<NetworkEvent.Context> contextSupplier) {
NetworkEvent.Context context = contextSupplier.get();
context.enqueueWork(() -> {
ServerPlayerEntity player = context.getSender();
if (player != null) {
Container container = player.containerMenu;
if (container != null) {
container.slotsChanged(null);
}
}
});
contextSupplier.get().setPacketHandled(true);
}
use of net.minecraft.inventory.container.Container 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