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


Java Minecraft.isGuiEnabled方法代碼示例

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


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

示例1: renderTick

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event)
{
	Minecraft mc = FMLClientHandler.instance().getClient();
	World world = mc.theWorld;
	
	if (event.phase != TickEvent.Phase.START) {
	    if ((Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer)) {
	    	EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;

	        if ((player != null) && (mc.inGameHasFocus) && (Minecraft.isGuiEnabled())) {
	        	// If player have radiation detector on hotbar.
	        	if (isPlayerHasItemOnHotbar(player.inventory, ItemsHZDS.radiation_detector)) {
        			PlayerTracker tracker = TrackerManager.lookupTrackerFromUsername(mc.thePlayer.getCommandSenderName());
        			
        			if (tracker != null) {
        				renderRadiation(tracker);
        			}
        		}

	        }
	    }
	}
}
 
開發者ID:TwilightWingsStudio,項目名稱:HazardsLib,代碼行數:26,代碼來源:ClientEventHandler.java

示例2: canRenderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
    EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer;

    if (entity instanceof EntityPlayer && entity != entityplayersp)
    {
        Team team = entity.getTeam();
        Team team1 = entityplayersp.getTeam();

        if (team != null)
        {
            Team.EnumVisible team$enumvisible = team.getNameTagVisibility();

            switch (team$enumvisible)
            {
                case ALWAYS:
                    return true;

                case NEVER:
                    return false;

                case HIDE_FOR_OTHER_TEAMS:
                    return team1 == null || team.isSameTeam(team1);

                case HIDE_FOR_OWN_TEAM:
                    return team1 == null || !team.isSameTeam(team1);

                default:
                    return true;
            }
        }
    }

    return Minecraft.isGuiEnabled() && entity != this.renderManager.livingPlayer && !entity.isInvisibleToPlayer(entityplayersp) && entity.riddenByEntity == null;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:36,代碼來源:RendererLivingEntity.java

示例3: func_110813_b

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
protected boolean func_110813_b(EntityLivingBase entity) {
	boolean isGUiEnabled = Minecraft.isGuiEnabled();
	boolean isPlayer = entity != renderManager.livingPlayer;
	boolean isInvisible = !entity.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer);
	boolean isBeingRidden = entity.riddenByEntity == null;

	return isGUiEnabled && isPlayer && isInvisible && isBeingRidden;
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:10,代碼來源:NewRenderPlayer.java

示例4: canRenderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
    EntityPlayerSP entityplayersp = Minecraft.getMinecraft().player;
    boolean flag = !entity.isInvisibleToPlayer(entityplayersp);

    if (entity != entityplayersp)
    {
        Team team = entity.getTeam();
        Team team1 = entityplayersp.getTeam();

        if (team != null)
        {
            Team.EnumVisible team$enumvisible = team.getNameTagVisibility();

            switch (team$enumvisible)
            {
                case ALWAYS:
                    return flag;

                case NEVER:
                    return false;

                case HIDE_FOR_OTHER_TEAMS:
                    return team1 == null ? flag : team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);

                case HIDE_FOR_OWN_TEAM:
                    return team1 == null ? flag : !team.isSameTeam(team1) && flag;

                default:
                    return true;
            }
        }
    }

    return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag && !entity.isBeingRidden();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:37,代碼來源:RenderLivingBase.java

示例5: renderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && !entity.getDisplayedItem().func_190926_b() && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        double d0 = entity.getDistanceSqToEntity(this.renderManager.renderViewEntity);
        float f = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f * f))
        {
            String s = entity.getDisplayedItem().getDisplayName();
            this.renderLivingLabel(entity, s, x, y, z, 64);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:15,代碼來源:RenderItemFrame.java

示例6: canRenderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
@Override
protected boolean canRenderName(AbstractClientPlayer entity) {
	EntityPlayerSP entityplayersp = Minecraft.getMinecraft().player;
	if (TF2Util.isOnSameTeam(entity, entityplayersp))
		return super.canRenderName(entity);
	else {
		boolean flag = !entity.isInvisibleToPlayer(entityplayersp);

		if (entity != entityplayersp) {
			Team team = Minecraft.getMinecraft().world.getScoreboard().getPlayersTeam(
					WeaponsCapability.get(entity).getDisguiseType().substring(2));
			Team team1 = entityplayersp.getTeam();

			if (team != null) {
				Team.EnumVisible team$enumvisible = team.getNameTagVisibility();

				switch (team$enumvisible) {
				case ALWAYS:
					return flag;
				case NEVER:
					return false;
				case HIDE_FOR_OTHER_TEAMS:
					return team1 == null ? flag
							: team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);
				case HIDE_FOR_OWN_TEAM:
					return team1 == null ? flag : !team.isSameTeam(team1) && flag;
				default:
					return true;
				}
			}
		}
		return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag
				&& !entity.isBeingRidden();
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:36,代碼來源:RenderPlayerDisguised.java

示例7: canRenderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected boolean canRenderName(T entity)
{
    EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer;
    boolean flag = !entity.isInvisibleToPlayer(entityplayersp);

    if (entity != entityplayersp)
    {
        Team team = entity.getTeam();
        Team team1 = entityplayersp.getTeam();

        if (team != null)
        {
            Team.EnumVisible team$enumvisible = team.getNameTagVisibility();

            switch (team$enumvisible)
            {
                case ALWAYS:
                    return flag;
                case NEVER:
                    return false;
                case HIDE_FOR_OTHER_TEAMS:
                    return team1 == null ? flag : team.isSameTeam(team1) && (team.getSeeFriendlyInvisiblesEnabled() || flag);
                case HIDE_FOR_OWN_TEAM:
                    return team1 == null ? flag : !team.isSameTeam(team1) && flag;
                default:
                    return true;
            }
        }
    }

    return Minecraft.isGuiEnabled() && entity != this.renderManager.renderViewEntity && flag && !entity.isBeingRidden();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:33,代碼來源:RenderLivingBase.java

示例8: renderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        double d0 = entity.getDistanceSqToEntity(this.renderManager.renderViewEntity);
        float f = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f * f))
        {
            String s = entity.getDisplayedItem().getDisplayName();
            this.renderLivingLabel(entity, s, x, y, z, 64);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:RenderItemFrame.java

示例9: renderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected void renderName(EntityPlayer entityplayer, double d, double d1, double d2)
{
    if(Minecraft.isGuiEnabled() && entityplayer != renderManager.livingPlayer)
    {
        float f = 1.6F;
        float f1 = 0.01666667F * f;
        float f2 = entityplayer.getDistanceToEntity(renderManager.livingPlayer);
        float f3 = entityplayer.isSneaking() ? 32F : 64F;
        if(f2 < f3)
        {
            String s = entityplayer.username;
            if(!entityplayer.isSneaking())
            {
                if(entityplayer.isPlayerSleeping())
                {
                    renderLivingLabel(entityplayer, s, d, d1 - 1.5D, d2, 64);
                } else
                {
                    renderLivingLabel(entityplayer, s, d, d1, d2, 64);
                }
            } else
            {
                FontRenderer fontrenderer = getFontRendererFromRenderManager();
                GL11.glPushMatrix();
                GL11.glTranslatef((float)d + 0.0F, (float)d1 + 2.3F, (float)d2);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GL11.glScalef(-f1, -f1, f1);
                GL11.glDisable(2896 /*GL_LIGHTING*/);
                GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F);
                GL11.glDepthMask(false);
                GL11.glEnable(3042 /*GL_BLEND*/);
                GL11.glBlendFunc(770, 771);
                Tessellator tessellator = Tessellator.instance;
                GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
                tessellator.startDrawingQuads();
                int i = fontrenderer.getStringWidth(s) / 2;
                tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
                tessellator.addVertex(-i - 1, -1D, 0.0D);
                tessellator.addVertex(-i - 1, 8D, 0.0D);
                tessellator.addVertex(i + 1, 8D, 0.0D);
                tessellator.addVertex(i + 1, -1D, 0.0D);
                tessellator.draw();
                GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
                GL11.glDepthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff);
                GL11.glEnable(2896 /*GL_LIGHTING*/);
                GL11.glDisable(3042 /*GL_BLEND*/);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glPopMatrix();
            }
        }
    }
}
 
開發者ID:jd-lang,項目名稱:betaexpansion,代碼行數:56,代碼來源:RenderPlayer.java

示例10: renderName

import net.minecraft.client.Minecraft; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        float f = 1.6F;
        float f1 = 0.016666668F * f;
        double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float f2 = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f2 * f2))
        {
            String s = entity.getDisplayedItem().getDisplayName();

            if (entity.isSneaking())
            {
                FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                GlStateManager.pushMatrix();
                GlStateManager.translate((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GlStateManager.scale(-f1, -f1, f1);
                GlStateManager.disableLighting();
                GlStateManager.translate(0.0F, 0.25F / f1, 0.0F);
                GlStateManager.depthMask(false);
                GlStateManager.enableBlend();
                GlStateManager.blendFunc(770, 771);
                Tessellator tessellator = Tessellator.getInstance();
                WorldRenderer worldrenderer = tessellator.getWorldRenderer();
                int i = fontrenderer.getStringWidth(s) / 2;
                GlStateManager.disableTexture2D();
                worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                tessellator.draw();
                GlStateManager.enableTexture2D();
                GlStateManager.depthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                GlStateManager.enableLighting();
                GlStateManager.disableBlend();
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                GlStateManager.popMatrix();
            }
            else
            {
                this.renderLivingLabel(entity, s, x, y, z, 64);
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:53,代碼來源:RenderItemFrame.java


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