net.minecraft.client.gui.inventory.GuiEditSign Java Examples

The following examples show how to use net.minecraft.client.gui.inventory.GuiEditSign. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutoSignModule.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
@Listener
public void displayGui(EventDisplayGui event) {
    if (event.getScreen() != null && event.getScreen() instanceof GuiEditSign) {
        final GuiEditSign gui = (GuiEditSign) event.getScreen();

        final boolean shouldCancel = this.overflow.getValue() ? true : this.lines != null;

        if (gui != null && shouldCancel && gui.tileSign != null) {
            Minecraft.getMinecraft().player.connection.sendPacket(new CPacketUpdateSign(gui.tileSign.getPos(), new TextComponentString[]{new TextComponentString(""), new TextComponentString(""), new TextComponentString(""), new TextComponentString("")}));
            Minecraft.getMinecraft().displayGuiScreen(null);
            event.setCanceled(true);
        }
    }
}