use of com.almuradev.almura.feature.guide.client.gui.SimplePageView 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();
}
}
}
}
}
use of com.almuradev.almura.feature.guide.client.gui.SimplePageView in project Almura by AlmuraDev.
the class ClientboundPageOpenResponsePacketHandler method handleMessage.
@Override
public void handleMessage(ClientboundPageOpenResponsePacket message, RemoteConnection connection, Platform.Type side) {
if (side.isClient()) {
final Minecraft client = Minecraft.getMinecraft();
if (PacketUtil.checkThreadAndEnqueue(client, message, this, connection, side)) {
this.manager.setPage(message.page);
SimplePageView view = null;
final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (currentScreen instanceof UIMessageBox.MessageBoxDialogScreen && ((UIMessageBox.MessageBoxDialogScreen) currentScreen).getParent() instanceof SimplePageView) {
view = (SimplePageView) ((UIMessageBox.MessageBoxDialogScreen) currentScreen).getParent();
} else if (currentScreen instanceof SimplePageView) {
view = (SimplePageView) currentScreen;
}
if (view != null) {
view.refreshPage();
}
}
}
}
use of com.almuradev.almura.feature.guide.client.gui.SimplePageView in project Almura by AlmuraDev.
the class ClientboundPageListingsPacketHandler method handleMessage.
@Override
public void handleMessage(ClientboundPageListingsPacket message, RemoteConnection connection, Platform.Type side) {
if (side.isClient()) {
final Minecraft client = Minecraft.getMinecraft();
if (PacketUtil.checkThreadAndEnqueue(client, message, this, connection, side)) {
this.manager.setPageEntries(message.pageEntries, message.switchToPageId);
SimplePageView view = null;
final GuiScreen currentScreen = client.currentScreen;
if (currentScreen instanceof UIMessageBox.MessageBoxDialogScreen && ((UIMessageBox.MessageBoxDialogScreen) currentScreen).getParent() instanceof SimplePageView) {
view = (SimplePageView) ((UIMessageBox.MessageBoxDialogScreen) currentScreen).getParent();
} else if (currentScreen instanceof SimplePageView) {
view = (SimplePageView) currentScreen;
}
if (view != null) {
view.refreshPageEntries(message.switchToPageId);
}
}
}
}
Aggregations