-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Код:
//
// Best Client Quite Client!
// Developer lummet.txt
// Expensive ready
//
package dev.lummet.functions.impl.render;
import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import dev.lummet.command.friends.FriendStorage;
import dev.lummet.events.EventDisplay;
import dev.lummet.events.EventDisplay.Type;
import dev.lummet.functions.api.Category;
import dev.lummet.functions.api.Function;
import dev.lummet.functions.api.FunctionRegister;
import dev.lummet.functions.impl.combat.AntiBot;
import dev.lummet.functions.settings.Setting;
import dev.lummet.functions.settings.impl.BooleanSetting;
import dev.lummet.functions.settings.impl.ColorSetting;
import dev.lummet.functions.settings.impl.ModeListSetting;
import dev.lummet.functions.settings.impl.ModeSetting;
import dev.lummet.utils.math.MathUtil;
import dev.lummet.utils.math.Vector4i;
import dev.lummet.utils.projections.ProjectionUtil;
import dev.lummet.utils.render.ColorUtils;
import dev.lummet.utils.render.DisplayUtils;
import dev.lummet.utils.render.font.Fonts;
import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.PointOfView;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.IFormattableTextComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import org.lwjgl.opengl.GL11;
@FunctionRegister(
name = "ESP",
type = Category.Render
)
public class ESP extends Function {
public ModeListSetting remove = new ModeListSetting("Включить", new BooleanSetting[]{new BooleanSetting("Боксы", true), new BooleanSetting("Предметы", true), new BooleanSetting("Полоску хп", true), new BooleanSetting("Текст хп", true), new BooleanSetting("Зачарования", false), new BooleanSetting("Список эффектов", true), new BooleanSetting("Индикация предметов", false)});
private final ModeSetting colores = new ModeSetting("Тип", "Клиент", new String[]{"Клиент", "Свой"});
public ColorSetting colordeft = (new ColorSetting("Цвет", ColorUtils.rgb(255, 255, 255))).setVisible(() -> {
return this.colores.is("Свой");
});
public ColorSetting colorfr = (new ColorSetting("Цвет друга", ColorUtils.rgb(255, 255, 255))).setVisible(() -> {
return this.colores.is("Свой");
});
private final HashMap<Entity, Vector4f> positions = new HashMap();
public ColorSetting color = new ColorSetting("Color", -1);
public ESP() {
this.addSettings(new Setting[]{this.remove, this.colores, this.colordeft, this.colorfr});
}
@Subscribe
public void onDisplay(EventDisplay e) {
if (mc.world != null && e.getType() == Type.PRE) {
this.positions.clear();
Vector4i colors = new Vector4i(HUD.getColor(0, 1.0F), HUD.getColor(90, 1.0F), HUD.getColor(180, 1.0F), HUD.getColor(270, 1.0F));
Vector4i friendColors = new Vector4i(HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 0, 1.0F), HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 90, 1.0F), HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 180, 1.0F), HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 270, 1.0F));
Iterator var4 = mc.world.getAllEntities().iterator();
while(true) {
Entity entity;
do {
do {
do {
if (!var4.hasNext()) {
RenderSystem.enableBlend();
RenderSystem.disableTexture();
RenderSystem.defaultBlendFunc();
RenderSystem.shadeModel(7425);
buffer.endVertex();
buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
var4 = this.positions.entrySet().iterator();
while(true) {
LivingEntity living;
float out;
Vector4f position;
float hpOffset;
do {
Object var37;
do {
Map.Entry entry;
if (!var4.hasNext()) {
Tessellator.getInstance().draw();
RenderSystem.shadeModel(7424);
RenderSystem.enableTexture();
RenderSystem.disableBlend();
var4 = this.positions.entrySet().iterator();
while(true) {
while(var4.hasNext()) {
entry = (Map.Entry)var4.next();
Entity entity = (Entity)entry.getKey();
float width;
float width;
if (entity instanceof LivingEntity) {
living = (LivingEntity)entity;
Score score = mc.world.getScoreboard().getOrCreateScore(living.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
float hp = living.getHealth();
width = living.getMaxHealth();
String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский"))) {
hp = (float)score.getScorePoints();
width = 20.0F;
}
Vector4f position = (Vector4f)entry.getValue();
width = position.z - position.x;
String hpText = (int)hp + "HP";
float hpWidth = Fonts.montserrat.getWidth(hpText, 5.0F);
float hpPercent = MathHelper.clamp(hp / width, 0.0F, 1.0F);
float hpPosY = position.y + (position.w - position.y) * (1.0F - hpPercent);
if ((Boolean)this.remove.getValueByName("Текст хп").get()) {
Fonts.montserrat.drawText(e.getMatrixStack(), hpText, position.x - hpWidth - 6.0F, hpPosY, -1, 5.0F, 0.05F);
}
String hptext1 = "" + (int)hp;
ITextComponent text = entity.getDisplayName();
TextComponent name = (TextComponent)text;
name.append(new StringTextComponent(" [" + TextFormatting.GREEN + (int)hp + TextFormatting.WHITE + "]"));
float length = (float)mc.fontRenderer.getStringPropertyWidth(name);
GL11.glPushMatrix();
this.glCenteredScale(position.x + width / 2.0F - length / 2.0F, position.y - 7.0F, length, 10.0F, 0.5F);
if (FriendStorage.isFriend(entity.getName().getString())) {
DisplayUtils.drawRoundedRect(position.x - 2.0F + width / 2.0F - length / 1.9F, position.y - 16.0F, length + 8.0F, 14.0F, 2.0F, ColorUtils.rgba(10, 92, 1, 150));
} else {
DisplayUtils.drawRoundedRect(position.x - 2.0F + width / 2.0F - length / 1.9F, position.y - 16.0F, length + 8.0F, 14.0F, 2.0F, ColorUtils.rgba(10, 10, 10, 100));
}
mc.fontRenderer.func_243246_a(e.getMatrixStack(), name, position.x + width / 2.0F - length / 2.0F, position.y - 13.0F, -1);
if (entity instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity)entity;
if ((Boolean)this.remove.getValueByName("Индикация предметов").get()) {
ItemStack stack = player.getHeldItemOffhand();
String nameS = "";
String itemName = stack.getDisplayName().getString();
if (stack.getItem() == Items.PLAYER_HEAD) {
CompoundNBT tag = stack.getTag();
if (tag != null && tag.contains("display", 10)) {
CompoundNBT display = tag.getCompound("display");
if (display.contains("Lore", 9)) {
ListNBT lore = display.getList("Lore", 8);
if (!lore.isEmpty()) {
String firstLore = lore.getString(0);
int levelIndex = firstLore.indexOf("Уровень");
if (levelIndex != -1) {
String levelString = firstLore.substring(levelIndex + "Уровень".length()).trim();
String gat = levelString;
if (gat.contains("1/3")) {
nameS = "- 1/3]";
} else if (gat.contains("2/3")) {
nameS = "- 2/3]";
} else if (gat.contains("MAX")) {
nameS = "- MAX]";
} else {
nameS = "";
}
}
}
}
}
if (itemName.contains("Пандо")) {
itemName = "[PANDORA ";
} else if (itemName.contains("Аполл")) {
itemName = "[APOLLON ";
} else if (itemName.contains("Тит")) {
itemName = "[TITANA ";
} else if (itemName.contains("Осир")) {
itemName = "[OSIRIS ";
} else if (itemName.contains("Андро")) {
itemName = "[ANDROMEDA";
} else if (itemName.contains("Хим")) {
itemName = "[XIMERA ";
} else if (itemName.contains("Астр")) {
itemName = "[ASTREYA ";
}
Fonts.sfMedium.drawText(e.getMatrixStack(), itemName + nameS, position.x - 15.0F, position.y - 55.0F, ColorUtils.rgb(255, 16, 16), 10.5F, 1.0E-4F);
}
}
}
GL11.glPopMatrix();
if ((Boolean)this.remove.getValueByName("Список эффектов").get()) {
this.drawPotions(e.getMatrixStack(), living, position.z + 2.0F, position.y);
}
this.drawItems(e.getMatrixStack(), living, (int)(position.x + width / 2.0F), (int)(position.y - 20.0F));
} else if (entity instanceof ItemEntity) {
ItemEntity item = (ItemEntity)entity;
new MatrixStack();
if ((Boolean)this.remove.getValueByName("Предметы").get()) {
GL11.glPushMatrix();
Vector4f position = (Vector4f)entry.getValue();
width = position.z - position.x;
ITextComponent textComponent = item.getItem().getDisplayName();
TextComponent tag = (TextComponent)textComponent;
tag.append(new StringTextComponent(item.getItem().getCount() < 1 ? "" : " x" + item.getItem().getCount()));
width = (float)mc.fontRenderer.getStringPropertyWidth(tag);
this.glCenteredScale(position.x + width / 2.0F - width / 2.0F, position.y - 7.0F, width, 10.0F, 0.5F);
DisplayUtils.drawRoundedRect(position.x - 5.0F + width / 2.0F - width / 2.0F, position.y - 16.0F, width + 10.0F, 16.0F, 2.0F, ColorUtils.rgba(10, 10, 10, 150));
mc.fontRenderer.func_243246_a(e.getMatrixStack(), tag, position.x + width / 2.0F - width / 2.0F, position.y - 12.0F, -1);
GL11.glPopMatrix();
}
}
}
return;
}
}
entry = (Map.Entry)var4.next();
position = (Vector4f)entry.getValue();
var37 = entry.getKey();
} while(!(var37 instanceof LivingEntity));
living = (LivingEntity)var37;
if ((Boolean)this.remove.getValueByName("Боксы").get()) {
if (this.colores.is("Клиент")) {
DisplayUtils.drawBox((double)(position.x - 0.5F), (double)(position.y - 0.5F), (double)(position.z + 0.5F), (double)(position.w + 0.5F), 1.5, ColorUtils.rgba(0, 0, 0, 128));
DisplayUtils.drawBoxTest((double)position.x, (double)position.y, (double)position.z, (double)position.w, 0.75, FriendStorage.isFriend(living.getName().getString()) ? friendColors : colors);
} else if (this.colores.is("Свой")) {
DisplayUtils.drawBox((double)(position.x - 0.5F), (double)(position.y - 0.5F), (double)(position.z + 0.5F), (double)(position.w + 0.5F), 1.5, ColorUtils.rgba(0, 0, 0, 128));
DisplayUtils.drawBoxTest2((double)position.x, (double)position.y, (double)position.z, (double)position.w, 0.75, FriendStorage.isFriend(living.getName().getString()) ? (Integer)this.colorfr.get() : (Integer)this.colordeft.get());
}
}
hpOffset = 3.0F;
out = 0.5F;
} while(!(Boolean)this.remove.getValueByName("Полоску хп").get());
String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
DisplayUtils.drawRectBuilding((double)(position.x - hpOffset - out), (double)(position.y - out), (double)(position.x - hpOffset + 1.0F + out), (double)(position.w + out), ColorUtils.rgba(0, 0, 0, 128));
DisplayUtils.drawRectBuilding((double)(position.x - hpOffset), (double)position.y, (double)(position.x - hpOffset + 1.0F), (double)position.w, ColorUtils.rgba(0, 0, 0, 128));
Score score = mc.world.getScoreboard().getOrCreateScore(living.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
float hp = living.getHealth();
float maxHp = living.getMaxHealth();
if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский"))) {
hp = (float)score.getScorePoints();
maxHp = 20.0F;
}
if (FriendStorage.isFriend(living.getName().getString())) {
DisplayUtils.drawMCVerticalBuilding((double)(position.x - hpOffset), (double)(position.y + (position.w - position.y) * (1.0F - MathHelper.clamp(hp / maxHp, 0.0F, 1.0F))), (double)(position.x - hpOffset + 1.0F), (double)position.w, getHealthColor(living, (new Color(0, 128, 6)).getRGB(), (new Color(0, 128, 6)).getRGB()), getHealthColor(living, (new Color(0, 128, 6)).getRGB(), (new Color(0, 128, 6)).getRGB()));
} else {
DisplayUtils.drawMCVerticalBuilding((double)(position.x - hpOffset), (double)(position.y + (position.w - position.y) * (1.0F - MathHelper.clamp(hp / maxHp, 0.0F, 1.0F))), (double)(position.x - hpOffset + 1.0F), (double)position.w, ColorUtils.rgb(113, 247, 106), ColorUtils.rgb(113, 247, 106));
}
}
}
entity = (Entity)var4.next();
} while(!this.isValid(entity));
} while(!(entity instanceof PlayerEntity) && !(entity instanceof ItemEntity));
Minecraft var10001 = mc;
} while(entity == Minecraft.player && mc.gameSettings.getPointOfView() == PointOfView.FIRST_PERSON);
double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, (double)e.getPartialTicks());
double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, (double)e.getPartialTicks());
double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, (double)e.getPartialTicks());
Vector3d size = new Vector3d(entity.getBoundingBox().maxX - entity.getBoundingBox().minX, entity.getBoundingBox().maxY - entity.getBoundingBox().minY, entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ);
AxisAlignedBB aabb = new AxisAlignedBB(x - size.x / 1.5, y, z - size.z / 1.5, x + size.x / 1.5, y + size.y + 0.10000000149011612, z + size.z / 1.5);
Vector4f position = null;
for(int i = 0; i < 8; ++i) {
Vector2f vector = ProjectionUtil.project(i % 2 == 0 ? aabb.minX : aabb.maxX, i / 2 % 2 == 0 ? aabb.minY : aabb.maxY, i / 4 % 2 == 0 ? aabb.minZ : aabb.maxZ);
if (position == null) {
position = new Vector4f(vector.x, vector.y, 1.0F, 1.0F);
} else {
position.x = Math.min(vector.x, position.x);
position.y = Math.min(vector.y, position.y);
position.z = Math.max(vector.x, position.z);
position.w = Math.max(vector.y, position.w);
}
}
this.positions.put(entity, position);
}
}
}
public static int getHealthColor(LivingEntity entity, int c1, int c2) {
float health = entity.getHealth();
float maxHealth = entity.getMaxHealth();
float hpPercentage = health / maxHealth;
int red = (int)((float)(c2 >> 16 & 255) * hpPercentage + (float)(c1 >> 16 & 255) * (1.0F - hpPercentage));
int green = (int)((float)(c2 >> 8 & 255) * hpPercentage + (float)(c1 >> 8 & 255) * (1.0F - hpPercentage));
int blue = (int)((float)(c2 & 255) * hpPercentage + (float)(c1 & 255) * (1.0F - hpPercentage));
return (new Color(red, green, blue)).getRGB();
}
public ModeListSetting getRemove() {
return this.remove;
}
public HashMap<Entity, Vector4f> getPositions() {
return this.positions;
}
public ColorSetting getColor() {
return this.color;
}
public boolean isInView(Entity ent) {
if (mc.getRenderViewEntity() == null) {
return false;
} else {
WorldRenderer.frustum.setCameraPosition(mc.getRenderManager().info.getProjectedView().x, mc.getRenderManager().info.getProjectedView().y, mc.getRenderManager().info.getProjectedView().z);
return WorldRenderer.frustum.isBoundingBoxInFrustum(ent.getBoundingBox()) || ent.ignoreFrustumCheck;
}
}
private void drawPotions(MatrixStack matrixStack, LivingEntity entity, float posX, float posY) {
for(Iterator var5 = entity.getActivePotionEffects().iterator(); var5.hasNext(); posY += Fonts.consolas.getHeight(6.0F)) {
EffectInstance pot = (EffectInstance)var5.next();
int amp = pot.getAmplifier();
String ampStr = "";
if (amp >= 1 && amp <= 9) {
String var10000 = "" + (amp + 1);
ampStr = " " + I18n.format(var10000, new Object[0]);
}
String text = I18n.format(pot.getEffectName(), new Object[0]) + ampStr + " - " + EffectUtils.getPotionDurationString(pot, 1.0F);
Fonts.consolas.drawText(matrixStack, text, posX, posY, -1, 5.0F, 0.05F);
}
}
private void drawItems(MatrixStack matrixStack, LivingEntity entity, int posX, int posY) {
int size = 8;
int padding = 6;
float fontHeight = Fonts.consolas.getHeight(6.0F);
List<ItemStack> items = new ArrayList();
ItemStack mainStack = entity.getHeldItemMainhand();
if (!mainStack.isEmpty()) {
items.add(mainStack);
}
Iterator var10 = entity.getArmorInventoryList().iterator();
while(var10.hasNext()) {
ItemStack itemStack = (ItemStack)var10.next();
if (!itemStack.isEmpty()) {
items.add(itemStack);
}
}
ItemStack offStack = entity.getHeldItemOffhand();
if (!offStack.isEmpty()) {
items.add(offStack);
}
posX = (int)((float)posX - (float)(items.size() * (size + padding)) / 2.0F);
Iterator var21 = items.iterator();
while(true) {
ItemStack itemStack;
do {
if (!var21.hasNext()) {
return;
}
itemStack = (ItemStack)var21.next();
} while(itemStack.isEmpty());
GL11.glPushMatrix();
this.glCenteredScale((float)posX, (float)posY, (float)size / 2.0F, (float)size / 2.0F, 0.5F);
mc.getItemRenderer().renderItemAndEffectIntoGUI(itemStack, posX, posY);
mc.getItemRenderer().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, posX, posY, (String)null);
GL11.glPopMatrix();
if (itemStack.isEnchanted() && (Boolean)this.remove.getValueByName("Зачарования").get()) {
int ePosY = (int)((float)posY - fontHeight);
Map<Enchantment, Integer> enchantmentsMap = EnchantmentHelper.getEnchantments(itemStack);
Iterator var15 = enchantmentsMap.keySet().iterator();
while(var15.hasNext()) {
Enchantment enchantment = (Enchantment)var15.next();
int level = (Integer)enchantmentsMap.get(enchantment);
if (level >= 1 && enchantment.canApply(itemStack)) {
IFormattableTextComponent iformattabletextcomponent = new TranslationTextComponent(enchantment.getName());
String var10000 = iformattabletextcomponent.getString().substring(0, 2);
String enchText = var10000 + level;
Fonts.consolas.drawText(matrixStack, enchText, (float)posX, (float)ePosY, -1, 6.0F, 0.05F);
ePosY -= (int)fontHeight;
}
}
}
posX += size + padding;
}
}
public boolean isValid(Entity e) {
return AntiBot.isBot(e) ? false : this.isInView(e);
}
public void glCenteredScale(float x, float y, float w, float h, float f) {
GL11.glTranslatef(x + w / 2.0F, y + h / 2.0F, 0.0F);
GL11.glScalef(f, f, 1.0F);
GL11.glTranslatef(-x - w / 2.0F, -y - h / 2.0F, 0.0F);
}
public static void drawMcRect(double left, double top, double right, double bottom, int color) {
double j;
if (left < right) {
j = left;
left = right;
right = j;
}
if (top < bottom) {
j = top;
top = bottom;
bottom = j;
}
float f3 = (float)(color >> 24 & 255) / 255.0F;
float f = (float)(color >> 16 & 255) / 255.0F;
float f1 = (float)(color >> 8 & 255) / 255.0F;
float f2 = (float)(color & 255) / 255.0F;
BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();
bufferbuilder.pos(left, bottom, 1.0).color(f, f1, f2, f3).endVertex();
bufferbuilder.pos(right, bottom, 1.0).color(f, f1, f2, f3).endVertex();
bufferbuilder.pos(right, top, 1.0).color(f, f1, f2, f3).endVertex();
bufferbuilder.pos(left, top, 1.0).color(f, f1, f2, f3).endVertex();
}
}
Последнее редактирование модератором: