当前位置: 首页>>代码示例>>Java>>正文


Java GuiIngameForge类代码示例

本文整理汇总了Java中net.minecraftforge.client.GuiIngameForge的典型用法代码示例。如果您正苦于以下问题:Java GuiIngameForge类的具体用法?Java GuiIngameForge怎么用?Java GuiIngameForge使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiIngameForge类属于net.minecraftforge.client包,在下文中一共展示了GuiIngameForge类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkingameGUI

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
static void checkingameGUI() {
    boolean b = mc.ingameGUI instanceof IngameGUI;
    if (mc.ingameGUI != null && OptionCore.VANILLA_UI.getValue() == b)
        mc.ingameGUI = b ? new GuiIngameForge(mc) : new IngameGUI(mc);
    deadHandlers.forEach(ent -> {
        if (ent != null) {
            final boolean deadStart = (ent.deathTime == 1);
            final boolean deadExactly = (ent.deathTime >= 18);
            if (deadStart) {
                ent.deathTime++;
                SoundCore.playAtEntity(ent, SoundCore.PARTICLES_DEATH);
            }

            if (deadExactly) {
                StaticRenderer.doSpawnDeathParticles(mc, ent);
                ent.setDead();
            }
        }
    });
    deadHandlers.removeIf(ent -> ent.isDead);
}
 
开发者ID:Tencao,项目名称:SAO-UI---1.8,代码行数:22,代码来源:RenderHandler.java

示例2: onKeyInput

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
    Minecraft mc = Minecraft.getMinecraft();

    for(ToolPage page : WigMod.Pages) {
        if (page.shouldToggle()) {
            if (page == WigMod.ActivePage) {
                if (WigMod.ActiveTool == null) {
                    WigMod.ActivePage = null;
                    GuiIngameForge.renderHotbar = true;
                    mc.ingameGUI.remainingHighlightTicks = 40;
                } else {
                    WigMod.ActiveTool = null;
                }
            } else {
                WigMod.ActivePage = page;
                GuiIngameForge.renderHotbar = false;
                mc.ingameGUI.remainingHighlightTicks = 0;
            }
        }
    }
}
 
开发者ID:CannibalVox,项目名称:wig,代码行数:23,代码来源:BarSelectInputHandler.java

示例3: onMouseInput

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent
public void onMouseInput(MouseEvent event) {
    if (WigMod.ActivePage == null || WigMod.ActiveTool != null) {
        return;
    }

    event.setCanceled(true);

    Minecraft mc = Minecraft.getMinecraft();

    if (event.dwheel != 0) {
        int diff = (event.dwheel > 0)?-1:1;
        WigMod.ActivePage.setToolIndex(Math.floorMod(WigMod.ActivePage.getToolIndex() + diff, 9));
    } else if (event.button == 0 && WigMod.ActivePage.getSelectedTool() != null && event.buttonstate) {
        WigMod.ActiveTool = WigMod.ActivePage.getSelectedTool();
    } else if (event.button == 1 && event.buttonstate) {
        WigMod.ActivePage = null;
        GuiIngameForge.renderHotbar = true;
        mc.ingameGUI.remainingHighlightTicks = 40;
    }
}
 
开发者ID:CannibalVox,项目名称:wig,代码行数:22,代码来源:SingleBarInputHandler.java

示例4: init

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@Override
public void init(FMLInitializationEvent event)
{
	super.init(event);
	MinecraftForge.EVENT_BUS.register(new RenderOverlayHandler());
	MinecraftForge.EVENT_BUS.register(new ClientRenderHandler());
	MinecraftForge.EVENT_BUS.register(new BackgroundMusicHandler());
	MinecraftForge.EVENT_BUS.register(new AnvilHighlightHandler());

	setupBlockColors();

	//Disable vanilla UI elements
	GuiIngameForge.renderHealth = false;
	GuiIngameForge.renderArmor = false;
	GuiIngameForge.renderExperiance = false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:17,代码来源:ClientProxy.java

示例5: onRenderMountHealth

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderMountHealth(RenderGameOverlayEvent event)
{
    if (event.type == ElementType.EXPERIENCE || event.type == ElementType.FOOD || event.type == ElementType.JUMPBAR )
    {
        YesOrNo = true;
    }

    if (!event.isCancelable() || !YesOrNo)return;

    if(this.mc.thePlayer.ridingEntity != null)
    {
        GuiIngameForge.renderFood = true;
    }

    if(GuiIngameForge.renderExperiance)
    {
        if(this.mc.thePlayer.ridingEntity instanceof EntityHorse)
        {
            GuiIngameForge.renderJumpBar = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
        }
    }
}
 
开发者ID:DouweKoopmans,项目名称:BetterHorseHud,代码行数:24,代码来源:ModGui.java

示例6: renderAirBar

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private void renderAirBar(ScaledResolution res) {
       GL11.glEnable(GL11.GL_BLEND);
       int width = res.getScaledWidth();
       int height = res.getScaledHeight();
       int left = width / 2 + 91;
       int top = height - GuiIngameForge.right_height;

       Minecraft mc = Minecraft.getMinecraft();
       int air = getAirLevel(mc.thePlayer);
       int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D);
       int partial = MathHelper.ceiling_double_int((double)air * 10.0D / 300.0D) - full;
       
       for (int i = 0; i < full + partial; ++i)
       {
       	mc.ingameGUI.drawTexturedModalRect(left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9);
       }
       GuiIngameForge.right_height += 10;
       
       GL11.glDisable(GL11.GL_BLEND);
}
 
开发者ID:lawremi,项目名称:PerFabricaAdAstra,代码行数:22,代码来源:RespirationHandler.java

示例7: onRenderOverlay

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent
public void onRenderOverlay(RenderGameOverlayEvent.Pre event)
{	
	if (event.getType() == ElementType.HEALTH)
	{
		event.setCanceled(true);
	}
	
	/*
	 * Repositions other Gui elements. 
	 */
	
	if (event.getType() == ElementType.ARMOR)
	{
		GuiIngameForge.left_height = 49;
	}
	
	if (event.getType() == ElementType.FOOD)
	{
		GuiIngameForge.right_height = 49;
	}
	
	if (event.getType() == ElementType.AIR)
	{
		GuiIngameForge.right_height = 59;
	}
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:28,代码来源:GuiHealth.java

示例8: renderOverlay

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent
public static void renderOverlay(RenderGameOverlayEvent.Post event) {
    RenderGameOverlayEvent.ElementType type = event.getType();
    if (type == RenderGameOverlayEvent.ElementType.ALL || (type == RenderGameOverlayEvent.ElementType.TEXT && FirstAidConfig.overlay.position == 2)) {
        GuiIngameForge.renderHealth = FirstAidConfig.overlay.showVanillaHealthBar;
        HUDHandler.renderOverlay(event.getResolution());
    }
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:9,代码来源:ClientEventHandler.java

示例9: init

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@Override
public void init() {
    FirstAid.logger.debug("Loading ClientProxy");
    MinecraftForge.EVENT_BUS.register(ClientEventHandler.class);
    ClientRegistry.registerKeyBinding(showWounds);
    GuiIngameForge.renderHealth = FirstAidConfig.overlay.showVanillaHealthBar;
    ((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(manager -> HUDHandler.rebuildTranslationTable());
    EventCalendar.checkDate();
}
 
开发者ID:ichttt,项目名称:FirstAid,代码行数:10,代码来源:ClientProxy.java

示例10: onMorph

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
/**
 * On morph, hide air bar in HUD
 * 
 * SideOnly annotation needed to remove this method from server (since 
 * it will likely cause {@link NoClassDefFoundError} on dedicated server.
 */
@Override
@SideOnly(Side.CLIENT)
public void onMorph(EntityLivingBase target)
{
    if (target.worldObj.isRemote && target == Minecraft.getMinecraft().thePlayer)
    {
        GuiIngameForge.renderAir = false;
    }
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:16,代码来源:WaterBreath.java

示例11: onDemorph

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
/**
 * On demorph, show back air bar in HUD
 * 
 * SideOnly annotation needed to remove this method from server (since 
 * it will likely cause {@link NoClassDefFoundError} on dedicated server.
 */
@Override
@SideOnly(Side.CLIENT)
public void onDemorph(EntityLivingBase target)
{
    if (target.worldObj.isRemote && target == Minecraft.getMinecraft().thePlayer)
    {
        GuiIngameForge.renderAir = true;
    }
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:16,代码来源:WaterBreath.java

示例12: draw

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
/** Render the bar as a full replacement for {@link GuiIngameForge#renderArmor(int, int)} */
public void draw(int width, int height) {
	MINECRAFT.mcProfiler.startSection("armor");
	int left = width / 2 - 91;
	int top = height - GuiIngameForge.left_height;

	MINECRAFT.getTextureManager().bindTexture(ARMOR_ICONS);
	glEnable(GL_BLEND);

	// Total points in all rows so far
	int barPoints = 0;
	int[] armorPoints = getBarPoints(MINECRAFT.player);

	zLevel = -7;
	for(int i = 0; i < MINECRAFT.player.inventory.armorInventory.size(); i++) {
		if(armorPoints[i] > 0) {
			if(barPoints == 0) { // Draw background
				drawBackground(left, top, armorPoints[4]); // levels
				++zLevel;
			}

			drawPiece(left, top, barPoints, armorPoints[i], MINECRAFT.player.inventory.armorItemInSlot(i));
			barPoints += armorPoints[i];

			++zLevel; // Make sure blending works with GL_EQUAL
		}
	}

	// Let other bars draw in the correct position
	GuiIngameForge.left_height += (barPoints-1) / 20 * ROW_SPACING + 10;

	MINECRAFT.getTextureManager().bindTexture(ICONS);
	MINECRAFT.mcProfiler.endSection();
}
 
开发者ID:mccreery,项目名称:armor-chroma,代码行数:35,代码来源:GuiArmor.java

示例13: onRenderOverlay

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderOverlay(RenderGameOverlayEvent event) {
  // https://github.com/LothrazarMinecraftMods/OverpoweredInventory/blob/8a7459161837b930c5417f774676504bce970e66/src/main/java/com/lothrazar/powerinventory/EventHandler.java
  if (showHungerMounted) {
    GuiIngameForge.renderFood = true;
  } //else config is false, so leave it alone
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:9,代码来源:MountedTweaksModule.java

示例14: onRenderOverlay

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
@SubscribeEvent
    public void onRenderOverlay(RenderGameOverlayEvent event) {
        if (!enabled || event.isCancelable() || event.getType() != ElementType.TEXT) {
            return;
        }

        getClientDragon();
        getServerDragon();

        if (dragonClient != null) {
            GuiIngameForge ingameGUI = (GuiIngameForge) mc.ingameGUI;
            res = ingameGUI.getResolution();

            renderTitle();

            try {
                if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) {
                    renderNavigation();
                    renderAttributes();
                    renderBreedPoints();
                } else {
                    renderEntityInfo();
                    renderAITasks();
//                    renderWatchedObjects();
                }

                renderProbe();
            } catch (Exception ex) {
                renderException(ex);
            }

            if (dragonClient.isDead) {
                dragonClient = null;
                dragonServer = null;
            }
        }

    }
 
开发者ID:ata4,项目名称:dragon-mounts,代码行数:39,代码来源:GuiDragonDebug.java

示例15: getGuiElementState

import net.minecraftforge.client.GuiIngameForge; //导入依赖的package包/类
public static boolean getGuiElementState(GuiElements element) {
	switch (element) {
		case OVERLAY:
			return GuiIngameForge.renderHelmet;
		case PORTAL:
			return GuiIngameForge.renderPortal;
		case HOTBAR:
			return GuiIngameForge.renderHotbar;
		case CROSSHAIRS:
			return GuiIngameForge.renderCrosshairs;
		case BOSS_HEALTH:
			return GuiIngameForge.renderBossHealth;
		case HEALTH:
			return GuiIngameForge.renderHealth;
		case ARMOR:
			return GuiIngameForge.renderArmor;
		case FOOD:
			return GuiIngameForge.renderFood;
		case MOUNT_HEALTH:
			return GuiIngameForge.renderHealthMount;
		case AIR:
			return GuiIngameForge.renderAir;
		case EXPERIENCE:
			return GuiIngameForge.renderExperiance;
		case JUMP_BAR:
			return GuiIngameForge.renderJumpBar;
		case OBJECTIVES:
			return GuiIngameForge.renderObjective;
		default:
			return false;
	}
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:33,代码来源:GuiUtils.java


注:本文中的net.minecraftforge.client.GuiIngameForge类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。