Neo
Owner
- Apr 13, 2022
- 20
- 8
Source by: pon228337
The ItemESP function itself:
The ItemESP function itself:
Code:
package me.funtimeutils.module.impl;
import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.systems.RenderSystem;
import me.funtimeutils.FuntimeUtils;
import me.funtimeutils.event.impl.EventRender3D;
import me.funtimeutils.module.api.Module;
import me.funtimeutils.module.api.ModuleInfo;
import me.funtimeutils.util.ItemStorage;
import me.funtimeutils.util.items.item.ClientItem;
import me.funtimeutils.util.render.RenderUtils;
import net.minecraft.entity.ItemEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.Vec3d;
@ModuleInfo(name = "ItemESP", description = "Показывает донатные предметы")
public class ItemESP extends Module {
@Subscribe
public void onRender3D(EventRender3D e) {
for (ItemEntity item : ItemStorage.getInstance().getItemEntities()) {
ClientItem clientItem = FuntimeUtils.getInstance().getItemList().getItem(item.getStack());
if (clientItem == null)
continue;
Vec3d pos = item.getPos().subtract(RenderUtils.getInterpolationOffset(item)).add(0, item.getEyeHeight(item.getPose()) + 0.75, 0);
Vec3d interpolationOffset = RenderUtils.getInterpolationOffset(mc.player);
Vec3d playerPos = mc.player.getPos().subtract(interpolationOffset);
double scale = Math.max(2, playerPos.distanceTo(pos) / 3.5);
RenderSystem.disableDepthTest();
RenderSystem.depthMask(false);
LiteralText text = new LiteralText(Formatting.RED + clientItem.getName() + " x" + item.getStack().getCount());
RenderUtils.drawText(text, pos.x, pos.y, pos.z, scale, true);
RenderSystem.depthMask(true);
RenderSystem.enableDepthTest();
}
}
}