Java Code Examples for net.minecraft.client.Minecraft#isGuiEnabled()

The following examples show how to use net.minecraft.client.Minecraft#isGuiEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MixinRendererLivingEntity.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @author Sk1er
 * @reason Fix Levelhead not rendering on self
 */
@Overwrite
protected boolean canRenderName(T entity) {
    if (Settings.BETTERF1 && Minecraft.getMinecraft().gameSettings.hideGUI) return false;
    EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer;

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

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

            switch (team$enumvisible) {
                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);
                case ALWAYS:
                default:
                    return true;
            }
        }
    }

    return Minecraft.isGuiEnabled() && entity != renderManager.livingPlayer && !entity.isInvisibleToPlayer(entityplayersp) && entity.riddenByEntity == null;
}
 
Example 2
Source File: NewRenderPlayer.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@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;
}
 
Example 3
Source File: WrapperMinecraft.java    From ClientBase with MIT License 4 votes vote down vote up
public static boolean isGuiEnabled() {
    return Minecraft.isGuiEnabled();
}