improve skeleton esp
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
package anticope.rejects.modules;
|
package anticope.rejects.modules;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
import meteordevelopment.orbit.EventHandler;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||||
import meteordevelopment.meteorclient.settings.*;
|
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||||
|
import meteordevelopment.meteorclient.settings.ColorSetting;
|
||||||
|
import meteordevelopment.meteorclient.settings.Setting;
|
||||||
|
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||||
import meteordevelopment.meteorclient.systems.config.Config;
|
import meteordevelopment.meteorclient.systems.config.Config;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
@@ -12,9 +15,7 @@ import meteordevelopment.meteorclient.utils.player.PlayerUtils;
|
|||||||
import meteordevelopment.meteorclient.utils.player.Rotations;
|
import meteordevelopment.meteorclient.utils.player.Rotations;
|
||||||
import meteordevelopment.meteorclient.utils.render.color.Color;
|
import meteordevelopment.meteorclient.utils.render.color.Color;
|
||||||
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
|
||||||
|
import meteordevelopment.orbit.EventHandler;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.option.Perspective;
|
import net.minecraft.client.option.Perspective;
|
||||||
@@ -30,8 +31,6 @@ import net.minecraft.util.math.*;
|
|||||||
public class SkeletonESP extends Module {
|
public class SkeletonESP extends Module {
|
||||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
|
|
||||||
private final Freecam freecam;
|
|
||||||
|
|
||||||
private final Setting<SettingColor> skeletonColorSetting = sgGeneral.add(new ColorSetting.Builder()
|
private final Setting<SettingColor> skeletonColorSetting = sgGeneral.add(new ColorSetting.Builder()
|
||||||
.name("players-color")
|
.name("players-color")
|
||||||
.description("The other player's color.")
|
.description("The other player's color.")
|
||||||
@@ -39,6 +38,15 @@ public class SkeletonESP extends Module {
|
|||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public final Setting<Boolean> distance = sgGeneral.add(new BoolSetting.Builder()
|
||||||
|
.name("distance-colors")
|
||||||
|
.description("Changes the color of skeletons depending on distance.")
|
||||||
|
.defaultValue(false)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
private final Freecam freecam;
|
||||||
|
|
||||||
public SkeletonESP() {
|
public SkeletonESP() {
|
||||||
super(MeteorRejectsAddon.CATEGORY, "skeleton-esp", "Looks cool as fuck");
|
super(MeteorRejectsAddon.CATEGORY, "skeleton-esp", "Looks cool as fuck");
|
||||||
freecam = Modules.get().get(Freecam.class);
|
freecam = Modules.get().get(Freecam.class);
|
||||||
@@ -48,6 +56,7 @@ public class SkeletonESP extends Module {
|
|||||||
private void onRender(Render3DEvent event) {
|
private void onRender(Render3DEvent event) {
|
||||||
MatrixStack matrixStack = event.matrices;
|
MatrixStack matrixStack = event.matrices;
|
||||||
float g = event.tickDelta;
|
float g = event.tickDelta;
|
||||||
|
|
||||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||||
RenderSystem.disableTexture();
|
RenderSystem.disableTexture();
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
@@ -55,12 +64,14 @@ public class SkeletonESP extends Module {
|
|||||||
RenderSystem.disableDepthTest();
|
RenderSystem.disableDepthTest();
|
||||||
RenderSystem.depthMask(MinecraftClient.isFabulousGraphicsOrBetter());
|
RenderSystem.depthMask(MinecraftClient.isFabulousGraphicsOrBetter());
|
||||||
RenderSystem.enableCull();
|
RenderSystem.enableCull();
|
||||||
|
|
||||||
mc.world.getEntities().forEach(entity -> {
|
mc.world.getEntities().forEach(entity -> {
|
||||||
if (!(entity instanceof PlayerEntity)) return;
|
if (!(entity instanceof PlayerEntity)) return;
|
||||||
if (mc.options.getPerspective() == Perspective.FIRST_PERSON && !freecam.isActive() && mc.player == entity) return;
|
if (mc.options.getPerspective() == Perspective.FIRST_PERSON && !freecam.isActive() && mc.player == entity) return;
|
||||||
int rotationHoldTicks = Config.get().rotationHoldTicks.get();
|
int rotationHoldTicks = Config.get().rotationHoldTicks.get();
|
||||||
|
|
||||||
Color skeletonColor = PlayerUtils.getPlayerColor((PlayerEntity)entity, skeletonColorSetting.get());
|
Color skeletonColor = PlayerUtils.getPlayerColor((PlayerEntity) entity, skeletonColorSetting.get());
|
||||||
|
if (distance.get()) skeletonColor = getColorFromDistance(entity);
|
||||||
PlayerEntity playerEntity = (PlayerEntity) entity;
|
PlayerEntity playerEntity = (PlayerEntity) entity;
|
||||||
|
|
||||||
Vec3d footPos = getEntityRenderPosition(playerEntity, g);
|
Vec3d footPos = getEntityRenderPosition(playerEntity, g);
|
||||||
@@ -74,7 +85,7 @@ public class SkeletonESP extends Module {
|
|||||||
|
|
||||||
float q = playerEntity.limbAngle - playerEntity.limbDistance * (1.0F - g);
|
float q = playerEntity.limbAngle - playerEntity.limbDistance * (1.0F - g);
|
||||||
float p = MathHelper.lerp(g, playerEntity.lastLimbDistance, playerEntity.limbDistance);
|
float p = MathHelper.lerp(g, playerEntity.lastLimbDistance, playerEntity.limbDistance);
|
||||||
float o = (float)playerEntity.age + g;
|
float o = (float) playerEntity.age + g;
|
||||||
float k = j - h;
|
float k = j - h;
|
||||||
float m = playerEntity.getPitch(g);
|
float m = playerEntity.getPitch(g);
|
||||||
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch;
|
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) m = Rotations.serverPitch;
|
||||||
@@ -93,14 +104,11 @@ public class SkeletonESP extends Module {
|
|||||||
ModelPart rightLeg = playerEntityModel.rightLeg;
|
ModelPart rightLeg = playerEntityModel.rightLeg;
|
||||||
|
|
||||||
matrixStack.translate(footPos.x, footPos.y, footPos.z);
|
matrixStack.translate(footPos.x, footPos.y, footPos.z);
|
||||||
if (swimming)
|
if (swimming) matrixStack.translate(0, 0.35f, 0);
|
||||||
matrixStack.translate(0, 0.35f, 0);
|
|
||||||
|
|
||||||
matrixStack.multiply(new Quaternion(new Vec3f(0, -1, 0), h + 180, true));
|
matrixStack.multiply(new Quaternion(new Vec3f(0, -1, 0), h + 180, true));
|
||||||
if (swimming || flying)
|
if (swimming || flying) matrixStack.multiply(new Quaternion(new Vec3f(-1, 0, 0), 90 + m, true));
|
||||||
matrixStack.multiply(new Quaternion(new Vec3f(-1, 0, 0), 90 + m, true));
|
if (swimming) matrixStack.translate(0, -0.95f, 0);
|
||||||
if (swimming)
|
|
||||||
matrixStack.translate(0, -0.95f, 0);
|
|
||||||
|
|
||||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||||
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
|
bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
|
||||||
@@ -115,7 +123,8 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//pelvis
|
bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//pelvis
|
||||||
bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||||
|
|
||||||
matrixStack.push();//head
|
// Head
|
||||||
|
matrixStack.push();
|
||||||
matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0);
|
matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0);
|
||||||
rotate(matrixStack, head);
|
rotate(matrixStack, head);
|
||||||
matrix4f = matrixStack.peek().getPositionMatrix();
|
matrix4f = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -123,7 +132,8 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||||
matrixStack.pop();
|
matrixStack.pop();
|
||||||
|
|
||||||
matrixStack.push();//right leg
|
// Right Leg
|
||||||
|
matrixStack.push();
|
||||||
matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||||
rotate(matrixStack, rightLeg);
|
rotate(matrixStack, rightLeg);
|
||||||
matrix4f = matrixStack.peek().getPositionMatrix();
|
matrix4f = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -131,7 +141,8 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||||
matrixStack.pop();
|
matrixStack.pop();
|
||||||
|
|
||||||
matrixStack.push();//left leg
|
// Left Leg
|
||||||
|
matrixStack.push();
|
||||||
matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||||
rotate(matrixStack, leftLeg);
|
rotate(matrixStack, leftLeg);
|
||||||
matrix4f = matrixStack.peek().getPositionMatrix();
|
matrix4f = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -139,7 +150,8 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||||
matrixStack.pop();
|
matrixStack.pop();
|
||||||
|
|
||||||
matrixStack.push();//right arm
|
// Right Arm
|
||||||
|
matrixStack.push();
|
||||||
matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0);
|
matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||||
rotate(matrixStack, rightArm);
|
rotate(matrixStack, rightArm);
|
||||||
matrix4f = matrixStack.peek().getPositionMatrix();
|
matrix4f = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -147,7 +159,8 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||||
matrixStack.pop();
|
matrixStack.pop();
|
||||||
|
|
||||||
matrixStack.push();//left arm
|
// Left Arm
|
||||||
|
matrixStack.push();
|
||||||
matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0);
|
matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||||
rotate(matrixStack, leftArm);
|
rotate(matrixStack, leftArm);
|
||||||
matrix4f = matrixStack.peek().getPositionMatrix();
|
matrix4f = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -158,16 +171,14 @@ public class SkeletonESP extends Module {
|
|||||||
bufferBuilder.end();
|
bufferBuilder.end();
|
||||||
BufferRenderer.draw(bufferBuilder);
|
BufferRenderer.draw(bufferBuilder);
|
||||||
|
|
||||||
if (swimming)
|
if (swimming) matrixStack.translate(0, 0.95f, 0);
|
||||||
matrixStack.translate(0, 0.95f, 0);
|
if (swimming || flying) matrixStack.multiply(new Quaternion(new Vec3f(1, 0, 0), 90 + m, true));
|
||||||
if (swimming || flying)
|
if (swimming) matrixStack.translate(0, -0.35f, 0);
|
||||||
matrixStack.multiply(new Quaternion(new Vec3f(1, 0, 0), 90 + m, true));
|
|
||||||
if (swimming)
|
|
||||||
matrixStack.translate(0, -0.35f, 0);
|
|
||||||
|
|
||||||
matrixStack.multiply(new Quaternion(new Vec3f(0, 1, 0), h + 180, true));
|
matrixStack.multiply(new Quaternion(new Vec3f(0, 1, 0), h + 180, true));
|
||||||
matrixStack.translate(-footPos.x, -footPos.y, -footPos.z);
|
matrixStack.translate(-footPos.x, -footPos.y, -footPos.z);
|
||||||
});
|
});
|
||||||
|
|
||||||
RenderSystem.enableTexture();
|
RenderSystem.enableTexture();
|
||||||
RenderSystem.disableCull();
|
RenderSystem.disableCull();
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
@@ -195,4 +206,28 @@ public class SkeletonESP extends Module {
|
|||||||
double z = entity.prevZ + ((entity.getZ() - entity.prevZ) * partial) - mc.getEntityRenderDispatcher().camera.getPos().z;
|
double z = entity.prevZ + ((entity.getZ() - entity.prevZ) * partial) - mc.getEntityRenderDispatcher().camera.getPos().z;
|
||||||
return new Vec3d(x, y, z);
|
return new Vec3d(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color getColorFromDistance(Entity entity) {
|
||||||
|
double distance = mc.gameRenderer.getCamera().getPos().distanceTo(entity.getPos());
|
||||||
|
double percent = distance / 60;
|
||||||
|
|
||||||
|
if (percent < 0 || percent > 1) {
|
||||||
|
color.set(0, 255, 0, 255);
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
int r, g;
|
||||||
|
|
||||||
|
if (percent < 0.5) {
|
||||||
|
r = 255;
|
||||||
|
g = (int) (255 * percent / 0.5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
g = 255;
|
||||||
|
r = 255 - (int) (255 * (percent - 0.5) / 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
color.set(r, g, 0, 255);
|
||||||
|
return color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user