Начинающий
- Статус
- Оффлайн
- Регистрация
- 16 Июл 2025
- Сообщения
- 10
- Реакции
- 0
- Выберите загрузчик игры
- Прочие моды
знаю что может быть код хуета но лучше чем НИХУЯ
(
(
Пожалуйста, авторизуйтесь для просмотра ссылки.
)
$ELFCODE:
package ware.leason.ui.display.impl;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.MainWindow;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.ResourceLocation;
import ware.leason.events.EventDisplay;
import ware.leason.events.EventUpdate;
import ware.leason.ui.display.ElementRenderer;
import ware.leason.utils.client.ClientUtil;
import ware.leason.utils.render.ColorUtils;
import ware.leason.utils.render.font.Fonts;
public class TotemCounterRenderer implements ElementRenderer {
private static final ResourceLocation TOTEM_TEXTURE =
new ResourceLocation("minecraft", "textures/item/totem_of_undying.png");
@Override
public void update(EventUpdate e) {
}
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
int totemCount = countTotems();
MainWindow window = mc.getMainWindow();
float screenWidth = ClientUtil.calc(window.getScaledWidth());
float screenHeight = ClientUtil.calc(window.getScaledHeight());
float iconSize = 32f;
float x = screenWidth / 2f + 1;
float y = screenHeight / 2f - 10;
mc.getTextureManager().bindTexture(TOTEM_TEXTURE);
AbstractGui.blit(ms, (int)(x - 40 + iconSize / 2 + 7), (int)(y + 17), 0, 0, 15, 15, 15, 15);
Fonts.montserrat.drawText(ms,
String.valueOf(totemCount),
x + 3,
y - 14 + iconSize + 2,
ColorUtils.rgb(255, 255, 255),
8f,
0.08f);
}
private int countTotems() {
int total = 0;
for (ItemStack stack : mc.player.inventory.mainInventory) {
if (stack.getItem() == Items.TOTEM_OF_UNDYING)
total += stack.getCount();
}
ItemStack offhand = mc.player.getHeldItemOffhand();
if (offhand.getItem() == Items.TOTEM_OF_UNDYING)
total += offhand.getCount();
return total;
}
}