当前位置: 首页>>代码示例>>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;未经允许,请勿转载。