if (notify && thePlayer != null && theWorld != null) {
// Screen closed
SpoutPacket packet = null;
Screen widget = null;
if (this.currentScreen != null && screen == null) {
packet = new PacketScreenAction(ScreenAction.Close, ScreenUtil.getType(this.currentScreen));
widget = currentScreen.getScreen();
}
// Screen opened
if (screen != null && this.currentScreen == null) {
packet = new PacketScreenAction(ScreenAction.Open, display);
widget = screen.getScreen();
}
// Screen swapped
if (screen != null && this.currentScreen != null) { // Hopefully just a submenu
packet = new PacketScreenAction(ScreenAction.Open, display);
widget = screen.getScreen();
}
boolean cancel = false;
if (!cancel && packet != null) {
SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet);