Java 类net.minecraftforge.client.event.GuiScreenEvent 实例源码

项目:motecraft    文件:GuiWiimoteStatus.java   
@SubscribeEvent
public void onDraw(GuiScreenEvent.DrawScreenEvent.Post event) {
    if (event.gui instanceof GuiMainMenu
            || event.gui instanceof GuiIngameMenu) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_LIGHTING);
        if (MoteCraft.mote == null) {
            this.mc.renderEngine.bindTexture(new ResourceLocation(
                    MoteCraft.MODID, String.format("wiimote_search%02d.png",
                            this.animstate / 3)));
        } else {
            this.mc.renderEngine.bindTexture(new ResourceLocation(
                    MoteCraft.MODID, "wiimote_found.png"));
        }
        /*
         * this.drawTexturedModalRect( 0, 0, 0, 0, 230, 1000);
         */
        Utils.drawTexturedQuadFit(10, 10, 32, 32, zLevel + 1);
    }
}
项目:CreeperKiller    文件:HammerKiller.java   
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
    if (args == null || args.length > 1 || args.length == 0) {
        return methodProxy.invokeSuper(obj, args);
    }

    if (method.getName().contains("guiRender") || method.getName().contains("mouseClick")) {
        Object arg0 = args[0];
        if (arg0 instanceof GuiScreenEvent) {
            GuiScreenEvent drawEvent = (GuiScreenEvent) arg0;

            if (drawEvent.getGui() instanceof GuiMainMenu) {
                // Don't invoke.
                return methodProxy.getSignature().getReturnType().getOpcode(VOID);
            }
        }
    }
    return methodProxy.invokeSuper(obj, args);
}
项目:BetterThanLlamas    文件:BetterThanLlamas.java   
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityLlama.class);
        if(renderer instanceof RenderLlama)
        {
            RenderLlama renderLlama = (RenderLlama)renderer;
            renderLlama.addLayer(new LayerFancyLlama(renderLlama));
        }
    }
}
项目:ItemZoom    文件:EventHandler.java   
@SubscribeEvent(priority = EventPriority.LOW)
public void onGuiKeyboardEvent(GuiScreenEvent.KeyboardInputEvent.Post event) {
    if (Keyboard.getEventKeyState()) {
        int eventKey = Keyboard.getEventKey();
        if (KeyBindings.TOGGLE.isActiveAndMatches(eventKey)) {
            Config.toggleEnabled();
            event.setCanceled(true);
        } else if (KeyBindings.ZOOM_IN.isActiveAndMatches(eventKey)) {
            Config.increaseZoom();
            event.setCanceled(true);
        } else if (KeyBindings.ZOOM_OUT.isActiveAndMatches(eventKey)) {
            Config.decreaseZoom();
            event.setCanceled(true);
        }
    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
    if (Minecraft.getMinecraft().player != null) {
        if ((event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative || event.getGui() instanceof GuiWearables)
                && !Minecraft.getMinecraft().player.getCapability(TF2weapons.INVENTORY_CAP, null).isEmpty()) {
            // GuiContainer gui = (GuiContainer) event.getGui();
            event.getButtonList().add(new GuiButton(97535627, event.getGui().width / 2 - 10, event.getGui().height / 2 + 95, 20, 20, "W"));
        }

        if (event.getGui() instanceof GuiMerchant)
            if (((GuiMerchant) event.getGui()).getMerchant().getDisplayName().getUnformattedText().equals(I18n.format("entity.hale.name"))) {
                event.getButtonList().add(new GuiButton(7578, event.getGui().width / 2 - 100, event.getGui().height / 2 - 110, 100, 20, "Change Team"));
                event.getButtonList().add(new GuiButton(7579, event.getGui().width / 2, event.getGui().height / 2 - 110, 100, 20, "Recover Lost Items"));
            }
        Minecraft.getMinecraft().player.getCapability(TF2weapons.WEAPONS_CAP, null).state &= 8;
    }
}
项目:Mods    文件:TF2EventsClient.java   
@SubscribeEvent
public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event) {

    if (event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative)
        if (event.getButton().id == 97535627) {
            // Minecraft.getMinecraft().displayGuiScreen(null);
            TF2weapons.network.sendToServer(new TF2Message.ShowGuiMessage(0));
        }

    if (event.getGui() instanceof GuiWearables)
        if (event.getButton().id == 97535627) {
            event.getGui().mc.displayGuiScreen(new GuiInventory(event.getGui().mc.player));
        }
    // PacketHandler.INSTANCE.sendToServer(new
    // PacketOpenNormalInventory(event.getGui().mc.player));
    if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7578) {
        ClientProxy.displayScreenJoinTeam();
    }
    else if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7579) {
        TF2weapons.network.sendToServer(new TF2Message.ActionMessage(18));
    }
}
项目:Better-Than-Bunnies    文件:BetterThanBunnies.java   
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityRabbit.class);
        if(renderer instanceof RenderRabbit)
        {
            RenderRabbit renderRabbit = (RenderRabbit)renderer;
            renderRabbit.addLayer(new LayerFancyBunny(renderRabbit));
        }
    }
}
项目:4Space-5    文件:GuiScreen.java   
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
{
    if (p_73864_3_ == 0) {
        for (int l = 0; l < this.buttonList.size(); l++)
        {
            GuiButton guibutton = (GuiButton)this.buttonList.get(l);
            if (guibutton.mousePressed(this.mc, p_73864_1_, p_73864_2_))
            {
                GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
                if (MinecraftForge.EVENT_BUS.post(event)) {
                    break;
                }
                this.selectedButton = event.button;
                event.button.func_146113_a(this.mc.getSoundHandler());
                actionPerformed(event.button);
                if (equals(this.mc.currentScreen)) {
                    MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.buttonList));
                }
            }
        }
    }
}
项目:Controller-Support    文件:ModEventHandler.java   
@SubscribeEvent
public void onInitGuiScreen(GuiScreenEvent.InitGuiEvent.Post event) {
    if (active) {
        LabelButtonInfo.inject(event.getGui());
        if (event.getGui() instanceof GuiIngameMenu) {
            event.getButtonList().add(new GuiButton(200, (event.getGui().width / 2) - 100, event.getGui().height - 20, I18n.format("gui.controller")));
        }
        if (event.getGui() instanceof GuiMainMenu) {
            this.selector = new GuiButtonSelector(event.getGui().width / 2, event.getGui().height / 2 + 30, 40, event.getButtonList().toArray(new GuiButton[0]));
            event.getButtonList().clear();
        }
        if (event.getButtonList().size() != 0)
            ActionButtonChange.moveMouse(new Wrapper(event.getButtonList().get(0)), event.getGui().width, event.getGui().height);
    }
}
项目:GuideBook    文件:ClientPlayerHandler.java   
@SubscribeEvent
public void preKeyboardInput(GuiScreenEvent.KeyboardInputEvent.Pre event) {
    if (event.getGui() instanceof GuiContainer && playerHasBook()) {
        GuiContainer gui = (GuiContainer) event.getGui();
        Slot slot = gui.getSlotUnderMouse();
        if (slot != null && slot.getHasStack()) {
            if (Keyboard.getEventKey() == ProxyClient.recipeKey.getKeyCode() && RecipeManager.hasRecipes(slot.getStack())) {
                GuideBookGui.onOpenCmd = "recipe";
                GuideBookGui.onOpenArg = slot.getStack();
                Minecraft.getMinecraft().player.openGui(GuideBookMod.instance, 0, Minecraft.getMinecraft().world, 0, 0, 0);
            }
            else if(Keyboard.getEventKey() == ProxyClient.usageKey.getKeyCode() && RecipeManager.hasUsages(slot.getStack())) {
                GuideBookGui.onOpenCmd = "usage";
                GuideBookGui.onOpenArg = slot.getStack();
                Minecraft.getMinecraft().player.openGui(GuideBookMod.instance, 0, Minecraft.getMinecraft().world, 0, 0, 0);
            }
        }
    }
}
项目:TeambattleMod    文件:ClientEventHandler.java   
@SubscribeEvent
public void onGuiScreenonInitGui(GuiScreenEvent.InitGuiEvent event) {
    if (event.gui instanceof GuiIngameMenu) {
        GuiIngameMenu menue = (GuiIngameMenu) event.gui;
        event.buttonList.add(new GuiButton(20, menue.width / 2 - 100, menue.height / 4 + 128, 200, 20, "Teambattle Settings"));
    }
}
项目:itemscroller    文件:RenderEventHandler.java   
@SubscribeEvent
public void onDrawBackground(GuiScreenEvent.BackgroundDrawnEvent event)
{
    if (renderRecipes && event.getGui() instanceof GuiContainer)
    {
        GuiContainer gui = (GuiContainer) event.getGui();
        RecipeStorage recipes = InputEventHandler.instance().getRecipes();
        int count = recipes.getRecipeCount();

        for (int recipeId = 0; recipeId < count; recipeId++)
        {
            this.renderStoredRecipeStack(recipeId, count, recipes.getRecipe(recipeId).getResult(),
                    gui, gui.mc, recipeId == recipes.getSelection());
        }
    }
}
项目:IIDY    文件:ClientEventHandler.java   
@SubscribeEvent
public void onDrawBackgroundEventPost(GuiScreenEvent.BackgroundDrawnEvent e)  {
    if (currentTask == ITask.TaskType.INVENTORY_SLOT) {
        GuiScreen currentGui = e.getGui();
        if (currentGui instanceof GuiContainer) {

            Container openContainer = ClientProxy.mc.player.openContainer;
            if (openContainer != null) {

                if (guiInventoryTask == null)
                    guiInventoryTask = new GuiInventoryTask(current_target, current_dimension, openContainer, (GuiContainer) currentGui);
                guiInventoryTask.drawScreen(e.getMouseX(), e.getMouseY(), 1.0F);
            }
        }
    } else {
        guiInventoryTask = null;
    }
}
项目:EZStorage2    文件:GuiExtractPort.java   
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClickedSuper(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (mouseButton == 0)
    {
        for (int i = 0; i < this.buttonList.size(); ++i)
        {
            GuiButton guibutton = (GuiButton)this.buttonList.get(i);

            if (guibutton.mousePressed(this.mc, mouseX, mouseY))
            {
                GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
                if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
                    break;
                guibutton = event.getButton();
                ReflectionHelper.setPrivateValue(GuiScreen.class, this, guibutton, "selectedButton", "field_146290_a");
                guibutton.playPressSound(this.mc.getSoundHandler());
                this.actionPerformed(guibutton);
                if (this.equals(this.mc.currentScreen))
                    MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.buttonList));
            }
        }
    }
}
项目:OpenFM    文件:GuiRadioBase.java   
@SideOnly(Side.CLIENT)
protected void mouseClicked(int par1, int par2, int par3) {
    if (par3 == 0) {
        for (int l = 0; l < this.OFMbuttonList.size(); l++) {
            GuiButton guibutton = (GuiButton)this.OFMbuttonList.get(l);
            if (guibutton.mousePressed(this.mc, par1, par2)) {
                GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.OFMbuttonList);
                if (MinecraftForge.EVENT_BUS.post(event))
                    break;
                event.button.func_146113_a(this.mc.getSoundHandler());
                actionPerformed(event.button.id);
                if (equals(this.mc.currentScreen))
                    MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.OFMbuttonList));
            }
        } 
    }
    super.mouseClicked(par1, par2, par3);
}
项目:GimmeTime    文件:GuiScreenEditAlarm.java   
@Override
protected void mouseClicked(int x, int y, int button) {
    super.mouseClicked(x, y, button);
    title.mouseClicked(x, y, button);
    if (button == 1) {
        for (Object o : buttonList) {
            if (o instanceof GuiSwitchButton) {
                GuiSwitchButton guibutton = (GuiSwitchButton) o;
                if (guibutton.mouseRightPressed(mc, x, y)) {
                    GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, buttonList);
                    if (MinecraftForge.EVENT_BUS.post(event))
                        break;
                    selectedButton = event.button;
                    event.button.func_146113_a(mc.getSoundHandler());
                    actionPerformed(event.button);
                    if (equals(mc.currentScreen))
                        MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, buttonList));
                }
            }
        }
    }
}
项目:GimmeTime    文件:GuiScreenClockConfig.java   
@Override
protected void mouseClicked(int x, int y, int button) {
    super.mouseClicked(x, y, button);
    separator.mouseClicked(x, y, button);
    if (button == 1) {
        for (Object o : buttonList) {
            if (o instanceof GuiSwitchButton) {
                GuiSwitchButton guibutton = (GuiSwitchButton) o;
                if (guibutton.mouseRightPressed(mc, x, y)) {
                    GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, buttonList);
                    if (MinecraftForge.EVENT_BUS.post(event))
                        break;
                    selectedButton = event.button;
                    event.button.func_146113_a(mc.getSoundHandler());
                    actionPerformed(event.button);
                    if (equals(mc.currentScreen))
                        MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, buttonList));
                }
            }
        }
    }
}
项目:4Space-1.7    文件:GuiScreen.java   
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
{
    if (p_73864_3_ == 0) {
        for (int l = 0; l < this.buttonList.size(); l++)
        {
            GuiButton guibutton = (GuiButton)this.buttonList.get(l);
            if (guibutton.mousePressed(this.mc, p_73864_1_, p_73864_2_))
            {
                GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
                if (MinecraftForge.EVENT_BUS.post(event)) {
                    break;
                }
                this.selectedButton = event.button;
                event.button.func_146113_a(this.mc.getSoundHandler());
                actionPerformed(event.button);
                if (equals(this.mc.currentScreen)) {
                    MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.buttonList));
                }
            }
        }
    }
}
项目:CosmeticArmor    文件:GuiHandler.java   
@SubscribeEvent
public void drawGui(GuiScreenEvent.DrawScreenEvent event) {
    if (!(event.gui instanceof ScreenChatOptions))
        return;

    if (buttonToggleArmor != null)
        buttonToggleArmor.drawButton(event.gui.mc, event.mouseX, event.mouseY);

    if (!mouseClicked) {
        if (Mouse.isButtonDown(0)) {
            mouseClicked = true;

            if (buttonToggleArmor.mousePressed(event.gui.mc, event.mouseX, event.mouseY)) {
                showArmor = !showArmor;
                updateText();
                buttonToggleArmor.func_146113_a(event.gui.mc.getSoundHandler());
            }
        }
    } else {
        if (!Mouse.isButtonDown(0))
            mouseClicked = false;
    }
}
项目:Zombie-Total-Conversion-Craft    文件:MainGuiOverrideManager.java   
@SuppressWarnings("unused")
@SubscribeEvent
public void onDrawGui(GuiScreenEvent.DrawScreenEvent event) {
    if (event.gui.getClass() == GuiMainMenu.class) {
        TextRenderHelper.drawString(Lang.get("itemGroup.Zombie Total Conversion"), 2, 2, TextAlignment.Left);
        TextRenderHelper.drawString("Developed by:", 2, 22, TextAlignment.Left);
        TextRenderHelper.drawString("Gavin Gassmann: @TheGassmama", 2, 32, TextAlignment.Left);
    }
    else if(event.gui.getClass() == GuiGameOver.class) {
        if(Keyboard.isKeyDown(Keyboard.KEY_G) && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
            Minecraft.getMinecraft().thePlayer.respawnPlayer();
            Minecraft.getMinecraft().displayGuiScreen(null);
        }
        TextRenderHelper.drawString(Lang.get("ui.debug.ongameover"), 2, 2, TextAlignment.Left);
    }
}
项目:harshencastle    文件:HandlerGuiEvent.java   
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
    if (event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiPlayerInventoryExtended){
        GuiContainer gui = (GuiContainer) event.getGui();
        event.getButtonList().add(new GuiHarshenButton(8178, gui, 140, 51, 24, 24,
                I18n.translateToLocalFormatted((event.getGui() instanceof GuiInventory) ? "button.harsheninventory" : "button.normal"), event.getGui() instanceof GuiInventory));
    }
}
项目:HardcoreRevival    文件:PingAddon.java   
@SubscribeEvent
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
    GuiScreen gui = event.getGui();
    if(isEnabled && gui.mc.player != null && gui.mc.player.getHealth() <= 0f && gui instanceof GuiChat) {
        buttonPing = new GuiButton(-999, gui.width / 2 - 100, gui.height / 2 + 30, I18n.format("gui.hardcorerevival.send_ping"));
        event.getButtonList().add(buttonPing);
    }
}
项目:HardcoreRevival    文件:PingAddon.java   
@SubscribeEvent
public void onActionPerformed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
    if(isEnabled && event.getButton() == buttonPing) {
        Minecraft mc = Minecraft.getMinecraft();
        buttonPing.playPressSound(mc.getSoundHandler());
        if(mc.player != null) {
            sendPingBelowPlayer(mc.player);
        }
    }
}
项目:HardcoreRevival    文件:ClientProxy.java   
@SubscribeEvent
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
    Minecraft mc = event.getGui().mc;
    if (mc.player != null && isKnockedOut && event.getGui() instanceof GuiChat) {
        GuiScreen gui = event.getGui();
        enableButtonTimer = 0;
        buttonDie = new GuiButton(-2, gui.width / 2 - 100, gui.height / 2 - 30, I18n.format("gui.hardcorerevival.die"));
        buttonDie.enabled = false;
        event.getButtonList().add(buttonDie);
    }
}
项目:HardcoreRevival    文件:ClientProxy.java   
@SubscribeEvent
public void onActionPerformed(GuiScreenEvent.ActionPerformedEvent.Pre event) {
    if(event.getButton() == buttonDie) {
        event.getButton().playPressSound(Minecraft.getMinecraft().getSoundHandler());
        NetworkHandler.instance.sendToServer(new MessageDie());
        acceptedDeath = true;
    }
}
项目:HardcoreRevival    文件:ClientProxy.java   
@SubscribeEvent
public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) {
    GuiScreen gui = event.getGui();
    Minecraft mc = gui.mc;
    if (mc.player != null && isKnockedOut && gui instanceof GuiChat) {
        enableButtonTimer += event.getRenderPartialTicks();
        if(buttonDie != null) {
            if (enableButtonTimer >= 40) {
                buttonDie.enabled = true;
                buttonDie.displayString = I18n.format("gui.hardcorerevival.die");
            } else if (enableButtonTimer >= 30) {
                buttonDie.displayString = "... " + I18n.format("gui.hardcorerevival.die") + " ...";
            } else if (enableButtonTimer >= 20) {
                buttonDie.displayString = ".. " + I18n.format("gui.hardcorerevival.die") + " ..";
            } else if (enableButtonTimer >= 10) {
                buttonDie.displayString = ". " + I18n.format("gui.hardcorerevival.die") + " .";
            }
        }

        GlStateManager.pushMatrix();
        GlStateManager.scale(2f, 2f, 2f);
        gui.drawCenteredString(mc.fontRenderer, I18n.format("gui.hardcorerevival.knocked_out"), gui.width / 2 / 2, 30, 16777215);
        GlStateManager.popMatrix();

        gui.drawCenteredString(mc.fontRenderer, I18n.format("gui.hardcorerevival.rescue_time_left", Math.max(0, (ModConfig.maxDeathTicks - deathTime) / 20)), gui.width / 2, gui.height / 2 + 10, 16777215);
    } else if(buttonDie != null) {
        buttonDie.visible = false;
    }
}
项目:Twitchy    文件:TCDrawScreen.java   
@SubscribeEvent
public static void drawScreen(GuiScreenEvent.DrawScreenEvent.Post event)
{
    if(mc.player != null && Twitchy.persistantIcon) {
        RenderHelper.disableStandardItemLighting();
        drawIcon();
        if(twitchRect.contains(event.getMouseX(), event.getMouseY()))
            drawTooltip(event.getGui(), event.getMouseX(), event.getMouseY());
        RenderHelper.enableStandardItemLighting();
    }
}
项目:Twitchy    文件:TCDrawScreen.java   
@SubscribeEvent
public static void mouseClick(GuiScreenEvent.MouseInputEvent.Pre event)
{
    if(mc.player != null && Mouse.getEventButton() == 0 && Mouse.getEventButtonState()) {
        //Get mouse position
        ScaledResolution sr = new ScaledResolution(mc);
        int srHeight = sr.getScaledHeight();
        int mouseX = Mouse.getX() * sr.getScaledWidth() / mc.displayWidth;
        int mouseY = srHeight - Mouse.getY() * srHeight / mc.displayHeight - 1;

        if (twitchRect.contains(mouseX, mouseY))
            openTwitchStream();
    }
}
项目:customstuff4    文件:GuiModifier.java   
@SubscribeEvent
void onPostInitGui(GuiScreenEvent.InitGuiEvent.Post event)
{
    if (isCorrectGui(event.getGui()))
    {
        event.getButtonList().removeIf(button -> removeButtons.contains(button.id));
        editButtons.forEach(b -> b.postInit(event));
    }
}
项目:customstuff4    文件:GuiModifier.java   
@SubscribeEvent
void onRenderGui(GuiScreenEvent.DrawScreenEvent.Post event)
{
    if (isCorrectGui(event.getGui()))
    {
        labels.forEach(m -> m.render(event));
    }
}
项目:customstuff4    文件:GuiModifier.java   
@Override
public void render(GuiScreenEvent.DrawScreenEvent.Post event)
{
    FontRenderer font = Minecraft.getMinecraft().fontRenderer;

    int left = getLeft(event.getGui(), font.getStringWidth(text));
    int top = getTop(event.getGui(), font.FONT_HEIGHT);

    font.drawString(text, left, top, color.getRGB(), dropShadow);
}
项目:ModularMachinery    文件:ClientMouseJEIGuiEventHandler.java   
@SubscribeEvent
public void onMouseEventPre(GuiScreenEvent.MouseInputEvent.Pre preMouse) {
    if(glMouseEventDWheelField == null) return;

    GuiScreen cScreen = preMouse.getGui();
    if(cScreen != null && cScreen instanceof IRecipesGui && System.currentTimeMillis() - StructurePreviewWrapper.lastRenderMs <= 200) {
        try {
            eventDWheelState = Mouse.getEventDWheel();
            glMouseEventDWheelField.set(null, 0);
        } catch (Exception e) {}
    }
}
项目:ModularMachinery    文件:ClientMouseJEIGuiEventHandler.java   
@SubscribeEvent
public void onMouseEventPost(GuiScreenEvent.MouseInputEvent.Post postMouse) {
    if(glMouseEventDWheelField == null) return;

    if(eventDWheelState != 0) {
        try {
            glMouseEventDWheelField.set(null, eventDWheelState);
        } catch (Exception e) {}
    }
}
项目:Overlord    文件:ClientEvents.java   
@SubscribeEvent
public static void screenload(GuiScreenEvent.InitGuiEvent event) {
    if (event.getGui() instanceof GuiMainMenu) {
        IResource iresource = null;
        try {
            List<String> defaultSplashes = Lists.newArrayList();
            iresource = Minecraft.getMinecraft().getResourceManager().getResource(SPLASH_TEXTS);
            BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(iresource.getInputStream(), StandardCharsets.UTF_8));
            String s;

            while ((s = bufferedreader.readLine()) != null) {
                s = s.trim();

                if (!s.isEmpty()) {
                    defaultSplashes.add(s);
                }
            }

            int splashNum = rand.nextInt(defaultSplashes.size() + finalSplashOffsetCount);

            if (splashNum >= defaultSplashes.size() + finalSplashOffsetCount - mySplashes.size())
                ReflectionHelper.setPrivateValue(GuiMainMenu.class, (GuiMainMenu) event.getGui(), mySplashes.get(splashNum - (defaultSplashes.size() + finalSplashOffsetCount - mySplashes.size())), "splashText", "field_73975_c");
        } catch (IOException e) {
            Overlord.logWarn(e.getLocalizedMessage());
        } finally {
            IOUtils.closeQuietly(iresource);
        }
    }
}
项目:4Space-5    文件:TabRegistry.java   
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void guiPostInit (GuiScreenEvent.InitGuiEvent.Post event)
{
    if (event.gui instanceof GuiInventory)
    {
        int guiLeft = (event.gui.width - 176) / 2;
        int guiTop = (event.gui.height - 166) / 2;
        guiLeft += getPotionOffset();

        TabRegistry.updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
        TabRegistry.addTabsToList(event.gui.buttonList);
    }
}
项目:4Space-5    文件:GuiScreen.java   
public void setWorldAndResolution(Minecraft p_146280_1_, int p_146280_2_, int p_146280_3_)
{
    this.mc = p_146280_1_;
    this.fontRendererObj = p_146280_1_.fontRenderer;
    this.width = p_146280_2_;
    this.height = p_146280_3_;
    if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Pre(this, this.buttonList)))
    {
        this.buttonList.clear();
        initGui();
    }
    MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Post(this, this.buttonList));
}
项目:Controller-Support    文件:ModEventHandler.java   
@SubscribeEvent
public void onDrawGuiScreen(GuiScreenEvent.DrawScreenEvent event) {
    handleTick();
    if (event.getGui() instanceof GuiMainMenu) {
        if (HotplugHandler.init())
            return;
        if (active) {
            selector.handleInput();
            selector.draw();
        }
    }
}
项目:jGui    文件:VanillaGuiScreen.java   
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onMouseInput(GuiScreenEvent.MouseInputEvent.Pre event) throws IOException {
    event.setCanceled(true);

    getSuperMcGui().handleMouseInput();

    if (mcScreen.equals(getMinecraft().currentScreen)) {
        MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.MouseInputEvent.Post(mcScreen));
    }
}
项目:jGui    文件:VanillaGuiScreen.java   
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onKeyboardInput(GuiScreenEvent.KeyboardInputEvent.Pre event) throws IOException {
    event.setCanceled(true);

    getSuperMcGui().handleKeyboardInput();

    if (mcScreen.equals(getMinecraft().currentScreen)) {
        MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.KeyboardInputEvent.Post(mcScreen));
    }
}
项目:SignPicture    文件:SignHandler.java   
@CoreEvent
public void onDraw(final @Nonnull GuiScreenEvent.DrawScreenEvent.Post event) {
    if (this.isPlaceMode)
        for (final INameHandler handler : handlers)
            if (handler!=null&&event.gui!=null)
                handler.onDraw(event.gui);
}