use of com.almuradev.almura.feature.guide.network.ServerboundGuideOpenRequestPacket in project Almura by AlmuraDev.
the class ClientboundPageChangeResponsePacketHandler method handleMessage.
@SideOnly(Side.CLIENT)
@Override
public void handleMessage(ClientboundPageChangeResponsePacket message, RemoteConnection connection, Platform.Type side) {
if (side.isClient() && message.success) {
final Minecraft client = Minecraft.getMinecraft();
if (PacketUtil.checkThreadAndEnqueue(client, message, this, connection, side)) {
final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (currentScreen != null && currentScreen instanceof SimplePageView) {
if (message.changeType == PageChangeType.REMOVE) {
((SimplePageView) currentScreen).close();
manager.network.sendToServer(new ServerboundGuideOpenRequestPacket());
} else {
((SimplePageView) currentScreen).refreshPage();
}
}
}
}
}
Aggregations