Java Code Examples for net.minecraft.client.Minecraft

The following examples show how to use net.minecraft.client.Minecraft. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: seppuku   Source File: BowBombModule.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Listener
public void sendPacket(EventSendPacket event) {
    if (event.getStage() == EventStageable.EventStage.PRE) {
        if (event.getPacket() instanceof CPacketPlayerDigging) {
            final Minecraft mc = Minecraft.getMinecraft();

            final CPacketPlayerDigging packet = (CPacketPlayerDigging) event.getPacket();
            if (packet.getAction() == CPacketPlayerDigging.Action.RELEASE_USE_ITEM) {
                if (mc.player.inventory.getCurrentItem().getItem() instanceof ItemBow && mc.player.getItemInUseMaxCount() >= 20) {
                    if (!mc.player.onGround) {
                        mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY - 0.1f, mc.player.posZ, false));
                        mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY - 10000f, mc.player.posZ, true));
                    }
                }
            }
        }
    }
}
 
Example 2
Source Project: Chisel   Source File: ItemChiselRenderer.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack stack, Object... data)
{
    RenderHelper.enableGUIStandardItemLighting();

    renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, stack, 0, 0);

    if(stack.stackTagCompound == null) return;

    ItemStack chiselTarget = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
    if(chiselTarget == null) return;

    GL11.glPushMatrix();
    GL11.glScalef(0.65f, 0.65f, 0.65f);
    GL11.glTranslatef(-8f, -8f, 0.0f);

    renderItem.renderItemIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().renderEngine, chiselTarget, 8, 8);

    GL11.glPopMatrix();
}
 
Example 3
Source Project: AdvancedRocketry   Source File: EntityRocket.java    License: MIT License 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void onInventoryButtonPressed(int buttonId) {
	switch(buttonId) {
	case 0:
		PacketHandler.sendToServer(new PacketEntity(this, (byte)EntityRocket.PacketType.DECONSTRUCT.ordinal()));
		break;
	case 1:
		PacketHandler.sendToServer(new PacketEntity(this, (byte)EntityRocket.PacketType.OPENPLANETSELECTION.ordinal()));
		break;
	default:
		PacketHandler.sendToServer(new PacketEntity(this, (byte)(buttonId + BUTTON_ID_OFFSET)));
		//Minecraft.getMinecraft().thePlayer.closeScreen();

		if(buttonId < STATION_LOC_OFFSET) {
			TileEntity tile = storage.getGUItiles().get(buttonId - tilebuttonOffset);
			storage.getBlockState(tile.getPos()).getBlock().onBlockActivated(storage.world, tile.getPos(), storage.getBlockState(tile.getPos()), Minecraft.getMinecraft().player, EnumHand.MAIN_HAND, EnumFacing.DOWN, 0, 0, 0);
		}
	}
}
 
Example 4
Source Project: enderutilities   Source File: GuiMSU.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public static void onTooltipEvent(ItemTooltipEvent event)
{
    if (Minecraft.getMinecraft().currentScreen instanceof GuiMSU && event.getEntityPlayer() != null &&
        event.getEntityPlayer().openContainer instanceof ContainerMSU)
    {
        ContainerMSU container = (ContainerMSU) event.getEntityPlayer().openContainer;
        GuiMSU gui = (GuiMSU) Minecraft.getMinecraft().currentScreen;
        Slot slot = gui.getSlotUnderMouse();

        if (slot != null && slot.getHasStack() && container.getCustomInventorySlotRange().contains(slot.slotNumber))
        {
            String size = EUStringUtils.formatNumberWithKSeparators(slot.getStack().getCount());
            event.getToolTip().add(size + " " + I18n.format("enderutilities.tooltip.item.items"));
        }
    }
}
 
Example 5
Source Project: I18nUpdateMod   Source File: DownloadInfoHelper.java    License: MIT License 6 votes vote down vote up
public static void init() {
    // 消息通知线程
    new Thread(() -> {
        while (true) {
            if (Minecraft.getMinecraft().player != null) {
                while (!info.isEmpty()) {
                    String theInfo = info.remove();
                    Minecraft.getMinecraft().addScheduledTask(() -> Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("[I18nUpdateMod] " + theInfo)));
                }
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }, "I18n-download-info-Thread").start();
}
 
Example 6
Source Project: OpenModsLib   Source File: EntityBlockRenderer.java    License: MIT License 6 votes vote down vote up
@Override
public void doRender(EntityBlock entity, double x, double y, double z, float yaw, float partialTicks) {
	final IBlockState blockState = entity.getBlockState();

	if (blockState.getRenderType() != EnumBlockRenderType.INVISIBLE) {
		GlStateManager.pushMatrix();
		GlStateManager.translate(x - 0.5, y, z + 0.5);
		GlStateManager.disableLighting();

		bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

		Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlockBrightness(blockState, entity.getBrightness());

		GlStateManager.enableLighting();
		GlStateManager.popMatrix();
		super.doRender(entity, x, y, z, yaw, partialTicks);
	}
}
 
Example 7
public static List<CCQuad> applyItemTint(List<CCQuad> quads, ItemStack stack) {
    List<CCQuad> retQuads = new LinkedList<>();
    for (CCQuad quad : quads) {
        int colour = -1;

        if (quad.hasTint()) {
            colour = Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, quad.tintIndex);

            if (EntityRenderer.anaglyphEnable) {
                colour = TextureUtil.anaglyphColor(colour);
            }
            colour = colour | 0xFF000000;
        }
        CCQuad copyQuad = quad.copy();

        Colour c = new ColourARGB(colour);
        for (Colour qC : copyQuad.colours) {
            qC.multiply(c);
        }
        retQuads.add(copyQuad);
    }

    return retQuads;
}
 
Example 8
@Override
public void render(int mouseX, int mouseY, float partialTick){
    GL11.glColor4d(1, 1, 1, 1);
    if(!Mouse.isButtonDown(0)) dragging = false;
    if(!wasClicking && Mouse.isButtonDown(0) && getBounds().contains(mouseX, mouseY)) {
        dragging = true;
    }
    if(!enabled) dragging = false;
    wasClicking = Mouse.isButtonDown(0);
    if(dragging) currentScroll = (float)(mouseY - 7 - getBounds().y) / (getBounds().height - 17);
    currentScroll = MathHelper.clamp_float(currentScroll, 0, 1);
    Minecraft.getMinecraft().getTextureManager().bindTexture(scrollTexture);
    Gui.func_146110_a(x, y, 12, 0, getBounds().width, 1, 26, 15);
    for(int i = 0; i < getBounds().height - 2; i++)
        Gui.func_146110_a(x, y + 1 + i, 12, 1, getBounds().width, 1, 26, 15);
    Gui.func_146110_a(x, y + getBounds().height - 1, 12, 14, getBounds().width, 1, 26, 15);

    if(!enabled) GL11.glColor4d(0.6, 0.6, 0.6, 1);
    Gui.func_146110_a(x + 1, y + 1 + (int)((getBounds().height - 17) * currentScroll), 0, 0, 12, 15, 26, 15);
    GL11.glColor4d(1, 1, 1, 1);
}
 
Example 9
Source Project: seppuku   Source File: FakeChatCommand.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void exec(String input) {
    if (!this.clamp(input, 2)) {
        this.printUsage();
        return;
    }

    final String[] split = input.split(" ");

    final StringBuilder sb = new StringBuilder();

    for (int i = 1; i < split.length; i++) {
        final String s = split[i];
        sb.append(s + (i == split.length - 1 ? "" : " "));
    }

    final String message = sb.toString();
    Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString(message.replace("&", "\247")));
}
 
Example 10
private static void handleWispyLineEffects(World currentRenderWorld, float partialTicks) {
    Tessellator tessellator;
    Iterator<FloatyLineInfo> it = floatyLineInfos.iterator();
    while(it.hasNext()) {
        FloatyLineInfo info = it.next();
        if(info.dimId != currentRenderWorld.provider.dimensionId) {
            it.remove();
            continue;
        }
        info.renderTicks++;
        if(info.renderTicks > info.tickCap) {
            it.remove();
            continue;
        }

        if(info.randomOffset == -1) {
            info.randomOffset = currentRenderWorld.rand.nextInt(20);
        }

        float ticks = Minecraft.getMinecraft().renderViewEntity.ticksExisted + info.randomOffset + partialTicks;
        UtilsFX.drawFloatyLine(info.pedestalX, info.pedestalY, info.pedestalZ, info.originX, info.originY, info.originZ, partialTicks, info.colorAsInt, "textures/misc/wispy.png", -0.02F, Math.min(ticks, 10.0F) / 10.0F);
    }
}
 
Example 11
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
    if (world.isRemote) {
        boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
        boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
        boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();

        if (isJumping) player.motionY = 0.85;

        if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
            player.motionY *= 0.3;

        if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.1;

        if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
            player.motionY = -0.05;

        if (isSneaking && isHoldingJump) player.motionY = 0;

        if (isSneaking && !player.onGround && !isHoldingJump) player.motionY = -0.6;
    }
    if (player.fallDistance > 0.0F) player.fallDistance = 0;
}
 
Example 12
Source Project: NotEnoughItems   Source File: GuiUsageRecipe.java    License: MIT License 6 votes vote down vote up
public static boolean openRecipeGui(String inputId, Object... ingredients) {
    Minecraft mc = Minecraft.getMinecraft();
    GuiContainer prevscreen = mc.currentScreen instanceof GuiContainer ? (GuiContainer) mc.currentScreen : null;

    TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
    ArrayList<IUsageHandler> handlers = new ArrayList<>();
    for (IUsageHandler usagehandler : usagehandlers) {
        profiler.start(usagehandler.getRecipeName());
        IUsageHandler handler = usagehandler.getUsageHandler(inputId, ingredients);
        if (handler.numRecipes() > 0) {
            handlers.add(handler);
        }
    }
    profiler.end();
    if (handlers.isEmpty()) {
        return false;
    }

    mc.displayGuiScreen(new GuiUsageRecipe(prevscreen, handlers));
    return true;
}
 
Example 13
protected ITextComponent getTextUnderMouse(int mouseX, int mouseY) {
    FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
    Position position = getPosition();
    int selectedLine = (mouseY - position.y) / (fontRenderer.FONT_HEIGHT + 2);
    if (mouseX >= position.x && selectedLine >= 0 && selectedLine < displayText.size()) {
        ITextComponent selectedComponent = displayText.get(selectedLine);
        int mouseOffset = mouseX - position.x;
        int currentOffset = 0;
        for (ITextComponent lineComponent : selectedComponent) {
            currentOffset += fontRenderer.getStringWidth(lineComponent.getUnformattedComponentText());
            if (currentOffset >= mouseOffset) {
                return lineComponent;
            }
        }
    }
    return null;
}
 
Example 14
Source Project: Valkyrien-Skies   Source File: ClientProxyWorld.java    License: Apache License 2.0 5 votes vote down vote up
private void registerItemModel(Item toRegister) {
    RenderItem renderItem = Minecraft.getMinecraft()
        .getRenderItem();
    renderItem.getItemModelMesher()
        .register(toRegister, 0, new ModelResourceLocation(
            ValkyrienSkiesWorld.MOD_ID + ":" + toRegister.getTranslationKey()
                .substring(5), "inventory"));
}
 
Example 15
Source Project: NotEnoughItems   Source File: NEIClientEventHandler.java    License: MIT License 5 votes vote down vote up
@SubscribeEvent
public void clientTickEvent(TickEvent.ClientTickEvent event) {

    if (event.phase == Phase.START) {
        Minecraft minecraft = Minecraft.getMinecraft();
        if (minecraft.currentScreen instanceof GuiContainer) {
            objectHandlers.forEach(handler -> handler.guiTick((GuiContainer) minecraft.currentScreen));
        }
    }
}
 
Example 16
@Override
public void deinstall(MissionInit missionInit)
{
    // Restore the player's normal movement control:
    EntityPlayerSP player = Minecraft.getMinecraft().player;
    if (player != null)
    {
        player.movementInput = this.originalMovement;
    }
    
    MinecraftForge.EVENT_BUS.unregister(this);
}
 
Example 17
Source Project: TFC2   Source File: UICharComponent.java    License: GNU General Public License v3.0 5 votes vote down vote up
public float setupChar(char ch)
{
	int i = Minecraft.getMinecraft().fontRenderer.getCharWidth(ch) & 255;
	renderChar = ch;
	if (i == 0)
	{
		return 0.0F;
	}
	else
	{
		int k = i >>> 4;
		int l = i & 15;
		float f = (float)k;
		float f1 = (float)(l + 1);
		float f2 = (float)(ch % 16 * 16) + f;
		float f3 = (float)((ch & 255) / 16 * 16);
		float f4 = f1 - f - 0.02F;
		if(ch != ' ')
		{
			this.addVertex(new VertexTex(new Vec3d(this.xPos + (f4 / 2.0F)*scale, this.yPos, zPos+zLevel*0.001), (f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F));
			this.addVertex(new VertexTex(new Vec3d(this.xPos + (f4 / 2.0F)*scale, this.yPos + (7.99F)*scale, zPos+zLevel*0.001), (f2 + f4) / 256.0F, (f3) / 256.0F));
			this.addVertex(new VertexTex(new Vec3d(this.xPos, this.yPos, zPos+zLevel*0.001), f2 / 256.0F, (f3 + 15.98F) / 256.0F));
			this.addVertex(new VertexTex(new Vec3d(this.xPos, this.yPos + (7.99F)*scale, zPos+zLevel*0.001), f2 / 256.0F, (f3) / 256.0F));
		}

		//xPos += ((f1 - f) / 2.0F + 1.0F)*scale;
		return (f1 - f) / 2.0F + 1.0F;
	}
}
 
Example 18
private void updateDestroyBlockIcons() {
    Minecraft mc = Minecraft.getMinecraft();
    TextureMap texturemap = mc.getTextureMapBlocks();

    for (int i = 0; i < destroyBlockIcons.length; ++i) {
        this.destroyBlockIcons[i] = texturemap.getAtlasSprite("minecraft:blocks/destroy_stage_" + i);
    }
}
 
Example 19
public static void handleAdditions(List<DataFamiliar.FamiliarData> toAdd) {
    for(DataFamiliar.FamiliarData data : toAdd) {
        PartialEntityFamiliar familiar = new PartialEntityFamiliar(Minecraft.getMinecraft().theWorld.getPlayerEntityByName(data.owner), data.owner);
        ExFamiliarData exData = new ExFamiliarData(data, familiar);
        clientFamiliars.put(data.owner, exData);
    }
}
 
Example 20
Source Project: malmo   Source File: ScreenHelper.java    License: MIT License 5 votes vote down vote up
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent ev)
{
    purgeExpiredFragments(null);
    if (Minecraft.getMinecraft().currentScreen != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu))
        return;
    if (Minecraft.getMinecraft().gameSettings.showDebugInfo)    // Don't obscure MC debug info with our debug info
        return;

    ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft());
    int width = res.getScaledWidth();
    int height = res.getScaledHeight();
    float rx = (float) width / 1000f;
    float ry = (float) height / 1000f;

    synchronized(this.fragments)
    {
        for (TextCategory cat : TextCategory.values())
        {
            TextCategoryAttributes atts = this.attributes.get(cat);
            if (atts != null && (!atts.flashing || ((System.currentTimeMillis() / 500) % 3 != 0)) && shouldDisplay(atts.displayLevel))
            {
                int x = Math.round(rx * (float) atts.xOrg);
                int y = Math.round(ry * (float) atts.yOrg);
                ArrayList<TextFragment> frags = this.fragments.get(cat);
                if (frags != null && !frags.isEmpty())
                {
                    for (TextFragment frag : frags)
                    {
                        drawText(frag.text, x, y, atts.colour);
                        y += 10;
                    }
                }
            }
        }
    }
}
 
Example 21
Source Project: qcraft-mod   Source File: QCraftProxyClient.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void showItemTransferGUI( EntityPlayer entityPlayer, TileEntityQuantumComputer computer )
{
    if( Minecraft.getMinecraft().currentScreen == null )
    {
        FMLClientHandler.instance().displayGuiScreen( entityPlayer, new GuiItemTransfer( computer ) );
    }
}
 
Example 22
@Override
public void handleMouseClick(int mouseX, int mouseY, int mouseButton)
{
	if(mouseButton != 0)
		return;
	
	if(mouseX < getX() + getWidth() - buttonWidth - 4)
		return;
	
	Minecraft.getMinecraft().displayGuiScreen(new EditBlockListScreen(
		Minecraft.getMinecraft().currentScreen, setting));
}
 
Example 23
public HyperiumCapeHandler(GameProfile profile) {
    Multithreading.runAsync(() -> {
        HyperiumPurchase purchase = PurchaseApi.getInstance().getPackageSync(profile.getId());
        JsonHolder holder = purchase.getPurchaseSettings().optJSONObject("cape");
        String type = holder.optString("type");
        String url = null;

        if (type.equals("CUSTOM_IMAGE")) {
            url = holder.optString("url");
        } else if (!type.isEmpty()) {
            JsonHolder atlasHolder = PurchaseApi.getInstance().getCapeAtlas().optJSONObject(type);
            url = atlasHolder.optString("url");
            if (url.isEmpty()) return;
        }

        ResourceLocation resourceLocation = new ResourceLocation(String.format("hyperium/capes/%s.png", profile.getId()));

        TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
        ThreadDownloadImageData threadDownloadImageData = new ThreadDownloadImageData(null, url, null, new IImageBuffer() {
            @Override
            public BufferedImage parseUserSkin(BufferedImage image) {
                return HyperiumCapeUtils.parseCape(image);
            }

            @Override
            public void skinAvailable() {
                LOCATION_CACHE.add(location = resourceLocation);
                ready = true;
            }
        });

        try {
            textureManager.loadTexture(resourceLocation, threadDownloadImageData);
        } catch (Exception e) {
            e.printStackTrace();
        }
    });
}
 
Example 24
Source Project: ClientBase   Source File: Utils.java    License: MIT License 5 votes vote down vote up
public static Point calculateMouseLocation() {
    Minecraft minecraft = Minecraft.getMinecraft();
    int scale = minecraft.gameSettings.guiScale;
    if (scale == 0)
        scale = 1000;
    int scaleFactor = 0;
    while (scaleFactor < scale && minecraft.displayWidth / (scaleFactor + 1) >= 320 && minecraft.displayHeight / (scaleFactor + 1) >= 240)
        scaleFactor++;
    return new Point(Mouse.getX() / scaleFactor, minecraft.displayHeight / scaleFactor - Mouse.getY() / scaleFactor - 1);
}
 
Example 25
Source Project: ExtraCells1   Source File: ItemRendererBusFluidStorage.java    License: MIT License 5 votes vote down vote up
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
	Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("extracells", "textures/blocks/texmap_storage_bus.png"));
	GL11.glPushMatrix();
	GL11.glTranslatef(-1.0F, 0.5F, 0.5F);
	GL11.glScalef(1.0F, -1F, -1F);
	GL11.glRotatef(180F, 1, 0, 0);
	GL11.glRotatef(-90F, 0, 0, 1);
	model.render(0.0625f);
	cable.renderBase(-0.5, 0.5F, -0.5F, Colors.CLEAR);
	cable.renderExtend(-0.5, 0.5F, -0.5F, ForgeDirection.DOWN, Colors.CLEAR);
	GL11.glPopMatrix();
}
 
Example 26
Source Project: AgriCraft   Source File: IconHelper.java    License: MIT License 5 votes vote down vote up
public static TextureAtlasSprite getIcon(final String resourceLocation) {
    TextureAtlasSprite sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(resourceLocation);
    if (!sprite.getIconName().equals("missingno")) {
        return sprite;
    } else {
        final int fail = FAIL_COUNTER.addAndGet(1);
        //AgriCore.getLogger("agricraft").debug("Failed to load Icon: " + resourceLocation);
        //AgriCore.getLogger("agricraft").debug("Icon load failure #" + fail);
        return getDefaultIcon();
    }
}
 
Example 27
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event)
{
    Minecraft mc = Minecraft.getMinecraft();

    if (!isLoaded)
    {
        return;
    }

    if (event.phase == TickEvent.Phase.END && mc.world != null && !mc.isGamePaused())
    {
        ItemStack stack = mc.player.getActiveItemStack();

        if (!stack.isEmpty() && stack.getItem() == Items.BREAD)
        {
            Random rand = mc.player.world.rand;

            if (rand.nextFloat() < 0.04)
            {
                String msg = MESSAGES_STOP[rand.nextInt(MESSAGES_STOP.length)];
                int i = mc.gameSettings.narrator;

                if (NARRATOR.active() && (i == 0 || i == 3)) // Don't narrate if the setting is already turned on
                {
                    NARRATOR.clear();
                    NARRATOR.say(msg);
                }

                mc.player.sendMessage(stack.getTextComponent().appendSibling(new TextComponentString(": " + msg)));
            }
        }
    }
}
 
Example 28
@Override
public WidgetComboBox getWidget(){
    if(widget == null) {
        widget = new WidgetComboBox(Minecraft.getMinecraft().fontRenderer, x, y, width, height);
        widget.setElements(getDropdownElements());
        widget.setFixedOptions();
        updateWidget();
    }
    return widget;
}
 
Example 29
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) {
	hovered = ((mouseX >= x) && (mouseY >= y) && (mouseX < x + width) && (mouseY < y + height));
	int i = getHoverState(hovered);
	if (i > 1) {
		drawRect(x, y + 2, x + width, y + height, new Color(255, 255, 255, 80).hashCode());
	}
}
 
Example 30
Source Project: Hyperium   Source File: ChatDisplay.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void tick() {
    if (Levelhead.getInstance().getLevelheadPurchaseStates().isChat()) {
        Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap()
            .stream()
            .map(network -> network.getGameProfile().getId())
            .filter(Objects::nonNull)
            .filter(uuid -> !cache.containsKey(uuid))
            .forEach(uuid -> Levelhead.getInstance().fetch(uuid, this, false));
    }
}