當前位置: 首頁>>代碼示例>>Java>>正文


Java GuiScreenEvent.BackgroundDrawnEvent方法代碼示例

本文整理匯總了Java中net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java GuiScreenEvent.BackgroundDrawnEvent方法的具體用法?Java GuiScreenEvent.BackgroundDrawnEvent怎麽用?Java GuiScreenEvent.BackgroundDrawnEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.client.event.GuiScreenEvent的用法示例。


在下文中一共展示了GuiScreenEvent.BackgroundDrawnEvent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onDrawBackground

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@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());
        }
    }
}
 
開發者ID:maruohon,項目名稱:itemscroller,代碼行數:17,代碼來源:RenderEventHandler.java

示例2: onDrawBackgroundEventPost

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@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;
    }
}
 
開發者ID:univrsal,項目名稱:IIDY,代碼行數:19,代碼來源:ClientEventHandler.java

示例3: renderInventoryHR

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void renderInventoryHR(GuiScreenEvent.BackgroundDrawnEvent event)
{
    if(event.getGui() instanceof GuiInventory)
    {
        EntityPlayer player = mc.player;
        IHunterRank hunterRank = player.getCapability(MHCapabilities.HUNTER_RANK, null);
        if(hunterRank == null)
            return;

        FontRenderer fontRenderer = mc.fontRendererObj;
        int xMid = event.getGui().width / 2;
        int x = (event.getGui().width - 176) / 2;
        int y = (event.getGui().height - 166) / 2 - 5;
        int hr = hunterRank.getRank();
        int p = hunterRank.getProgressPoints();
        int pMax = HunterRankProgression.getProgressForRank(hr);

        int barWidth = 176;
        int barHeight = 6;
        int barX = xMid - barWidth / 2;
        int barPointsWidth = Math.round(((float) p / (float) pMax) * (float) barWidth);

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        RenderHelper.disableStandardItemLighting();
        mc.getTextureManager().bindTexture(hunterRankBar);

        //Render progression bar
        drawTexturedModalRect(barX, y, 0, 0, barWidth, barHeight);
        GlStateManager.color(0.8F, 0.8F, 0F, 1F);
        drawTexturedModalRect(barX, y, 0, barHeight, barPointsWidth, barHeight * 2);
        GlStateManager.color(1f, 1f, 1f);
        //Render hunter rank
        drawBorderedString(fontRenderer, "HR: " + hr, x + 3, y - 4, 0xCECE02); //Bar colour: 0xA9A901
    }
}
 
開發者ID:alxnns1,項目名稱:MobHunter,代碼行數:37,代碼來源:HRClientHandler.java

示例4: onDrawBackgroundEventPost

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onDrawBackgroundEventPost(GuiScreenEvent.BackgroundDrawnEvent e) {
    if (JEIButtons.configHasChanged) {
        JEIButtons.configHasChanged = false;
        setUpPositions();
    }

    if (JEIButtons.isServerSidePresent && e.getGui() instanceof GuiMainMenu) {
        JEIButtons.isServerSidePresent = false;
        JEIButtons.isSpongePresent = false;
    } else if (ConfigHandler.showButtons && e.getGui() != null && e.getGui() instanceof GuiContainer) {
        int mouseY = JEIButtons.proxy.getMouseY();
        int mouseX = JEIButtons.proxy.getMouseX();
        GuiContainer g = (GuiContainer) e.getGui();
        EntityPlayerSP pl = ClientProxy.player;

        if (btnGameMode == EnumButtonCommands.SPECTATE && !ConfigHandler.enableSpectatoreMode || btnGameMode == EnumButtonCommands.ADVENTURE && !ConfigHandler.enableAdventureMode)
            btnGameMode = btnGameMode.cycle();

        JEIButtons.isAnyButtonHovered = false;

        {
            btnGameMode.draw();
            btnTrash.draw();
            btnSun.draw();
            btnRain.draw();
            btnDay.draw();
            btnNight.draw();
            btnNoMobs.draw();
            btnFreeze.draw();
            btnMagnet.draw();
        }

        if (ConfigHandler.enableSaves)
            InventorySaveHandler.drawButtons(mouseX, mouseY);

        if (ModSubsetButtonHandler.ENABLE_SUBSETS && ConfigHandler.enableSubsets)
            ModSubsetButtonHandler.drawButtons(mouseX, mouseY, ClientProxy.getGuiTop((GuiContainer) e.getGui()));

        for (EnumButtonCommands btn : btnCustom)
            btn.draw();

        adjustGamemode();

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

            if (JEIButtons.isAnyButtonHovered && JEIButtons.hoveredButton.isEnabled) { // Utility Buttons
                CommandHelper.handleClick(JEIButtons.hoveredButton);
                JEIButtons.proxy.playClick();
            } else { // Save buttons & Mod subsets
                if (ConfigHandler.enableSaves)
                    InventorySaveHandler.click(mouseX, mouseY, false);

                ModSubsetButtonHandler.click(mouseX, mouseY);
            }
        } else if (!Mouse.isButtonDown(0)) {
            isLMBDown = false;
        }

        if (Mouse.isButtonDown(1) && !isRMBDown) {
            isRMBDown = true;
            InventorySaveHandler.click(mouseX, mouseY, true);
        } else if (!Mouse.isButtonDown(1))
            isRMBDown = false;
    }
}
 
開發者ID:univrsal,項目名稱:JustEnoughButtons,代碼行數:68,代碼來源:EventHandlers.java


注:本文中的net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。