added skeleton ESP
This commit is contained in:
@@ -33,6 +33,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
modules.add(new Lavacast());
|
||||
//modules.add(new ObsidianFarm());
|
||||
modules.add(new RenderInvisible());
|
||||
modules.add(new SkeletonESP());
|
||||
modules.add(new SoundLocator());
|
||||
modules.add(new TPSSync());
|
||||
|
||||
|
||||
145
src/main/java/cloudburst/rejects/modules/SkeletonESP.java
Normal file
145
src/main/java/cloudburst/rejects/modules/SkeletonESP.java
Normal file
@@ -0,0 +1,145 @@
|
||||
package cloudburst.rejects.modules;
|
||||
|
||||
import cloudburst.rejects.MeteorRejectsAddon;
|
||||
import cloudburst.rejects.utils.Render3DUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import minegame159.meteorclient.events.render.RenderEvent;
|
||||
import minegame159.meteorclient.settings.*;
|
||||
import minegame159.meteorclient.systems.modules.Module;
|
||||
import minegame159.meteorclient.utils.render.color.Color;
|
||||
import minegame159.meteorclient.utils.render.color.SettingColor;
|
||||
import net.minecraft.client.model.ModelPart;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||
import net.minecraft.client.render.entity.PlayerEntityRenderer;
|
||||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.*;
|
||||
|
||||
public class SkeletonESP extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<SettingColor> skeletonColorSetting = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("players-color")
|
||||
.description("The other player's color.")
|
||||
.defaultValue(new SettingColor(255, 255, 255))
|
||||
.build()
|
||||
);
|
||||
|
||||
public SkeletonESP() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "skeleton-esp", "Looks cool as fuck");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onRender(RenderEvent event) {
|
||||
MatrixStack matrixStack = event.matrices;
|
||||
float g = event.tickDelta;
|
||||
Render3DUtils.INSTANCE.setup3DRender(true);
|
||||
Color skeletonColor = skeletonColorSetting.get();
|
||||
mc.world.getEntities().forEach(entity -> {
|
||||
if (entity instanceof PlayerEntity && entity.getUuid() != mc.player.getUuid()) {
|
||||
PlayerEntity playerEntity = (PlayerEntity) entity;
|
||||
|
||||
Vec3d footPos = Render3DUtils.INSTANCE.getEntityRenderPosition(playerEntity, g);
|
||||
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer)(LivingEntityRenderer) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
|
||||
PlayerEntityModel playerEntityModel = (PlayerEntityModel)livingEntityRenderer.getModel();
|
||||
|
||||
float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw);
|
||||
float j = MathHelper.lerpAngleDegrees(g, playerEntity.prevHeadYaw, playerEntity.headYaw);
|
||||
|
||||
float q = playerEntity.limbAngle - playerEntity.limbDistance * (1.0F - g);
|
||||
float p = MathHelper.lerp(g, playerEntity.lastLimbDistance, playerEntity.limbDistance);
|
||||
float o = (float)playerEntity.age + g;
|
||||
float k = j - h;
|
||||
float m = MathHelper.lerp(g, playerEntity.prevPitch, playerEntity.pitch);
|
||||
|
||||
playerEntityModel.setAngles(playerEntity, q, p, o, k, m);
|
||||
boolean sneaking = playerEntity.isSneaking();
|
||||
|
||||
ModelPart head = playerEntityModel.head;
|
||||
ModelPart leftArm = playerEntityModel.leftArm;
|
||||
ModelPart rightArm = playerEntityModel.rightArm;
|
||||
ModelPart leftLeg = playerEntityModel.leftLeg;
|
||||
ModelPart rightLeg = playerEntityModel.rightLeg;
|
||||
|
||||
matrixStack.translate(footPos.x, footPos.y, footPos.z);
|
||||
matrixStack.multiply(new Quaternion(new Vector3f(0, -1, 0), playerEntity.bodyYaw + 180, true));
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
bufferBuilder.begin(1, VertexFormats.POSITION_COLOR);
|
||||
|
||||
Matrix4f matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();
|
||||
bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//spine
|
||||
|
||||
bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//shoulders
|
||||
bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 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();//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();
|
||||
|
||||
matrixStack.push();//head
|
||||
matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0);
|
||||
rotate(matrixStack, head);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 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.push();//right leg
|
||||
matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||
rotate(matrixStack, rightLeg);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 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.push();//left leg
|
||||
matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0);
|
||||
rotate(matrixStack, leftLeg);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 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.push();//right arm
|
||||
matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||
rotate(matrixStack, rightArm);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 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.push();//left arm
|
||||
matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0);
|
||||
rotate(matrixStack, leftArm);
|
||||
matrix4f = matrixStack.peek().getModel();
|
||||
bufferBuilder.vertex(matrix4f, 0, 0, 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();
|
||||
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
|
||||
matrixStack.multiply(new Quaternion(new Vector3f(0, 1, 0), playerEntity.bodyYaw + 180, true));
|
||||
matrixStack.translate(-footPos.x, -footPos.y, -footPos.z);
|
||||
}
|
||||
});
|
||||
Render3DUtils.INSTANCE.end3DRender();
|
||||
}
|
||||
|
||||
private void rotate(MatrixStack matrix, ModelPart modelPart) {
|
||||
if (modelPart.roll != 0.0F) {
|
||||
matrix.multiply(Vector3f.POSITIVE_Z.getRadialQuaternion(modelPart.roll));
|
||||
}
|
||||
|
||||
if (modelPart.yaw != 0.0F) {
|
||||
matrix.multiply(Vector3f.NEGATIVE_Y.getRadialQuaternion(modelPart.yaw));
|
||||
}
|
||||
|
||||
if (modelPart.pitch != 0.0F) {
|
||||
matrix.multiply(Vector3f.NEGATIVE_X.getRadialQuaternion(modelPart.pitch));
|
||||
}
|
||||
}
|
||||
}
|
||||
216
src/main/java/cloudburst/rejects/utils/Render3DUtils.java
Normal file
216
src/main/java/cloudburst/rejects/utils/Render3DUtils.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package cloudburst.rejects.utils;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import minegame159.meteorclient.utils.render.color.Color;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.ItemEntity;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
||||
public enum Render3DUtils {
|
||||
INSTANCE;
|
||||
|
||||
public Vec3d getEntityRenderPosition(Entity entity, double partial) {
|
||||
double x = entity.prevX + ((entity.getX() - entity.prevX) * partial) - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().x;
|
||||
double y = entity.prevY + ((entity.getY() - entity.prevY) * partial) - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().y;
|
||||
double z = entity.prevZ + ((entity.getZ() - entity.prevZ) * partial) - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().z;
|
||||
return new Vec3d(x, y, z);
|
||||
}
|
||||
|
||||
public Vec3d getRenderPosition(double x, double y, double z) {
|
||||
double minX = x - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().x;
|
||||
double minY = y - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().y;
|
||||
double minZ = z - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().z;
|
||||
return new Vec3d(minX, minY, minZ);
|
||||
}
|
||||
|
||||
public Vec3d getRenderPosition(Vec3d vec3d) {
|
||||
double minX = vec3d.getX() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().x;
|
||||
double minY = vec3d.getY() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().y;
|
||||
double minZ = vec3d.getZ() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().z;
|
||||
return new Vec3d(minX, minY, minZ);
|
||||
}
|
||||
|
||||
public Vec3d getRenderPosition(BlockPos blockPos) {
|
||||
double minX = blockPos.getX() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().x;
|
||||
double minY = blockPos.getY() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().y;
|
||||
double minZ = blockPos.getZ() - MinecraftClient.getInstance().getEntityRenderDispatcher().camera.getPos().z;
|
||||
return new Vec3d(minX, minY, minZ);
|
||||
}
|
||||
|
||||
public void fixCameraRots() {
|
||||
Camera camera = MinecraftClient.getInstance().getEntityRenderDispatcher().camera;
|
||||
GL11.glRotated(-MathHelper.wrapDegrees(camera.getYaw() + 180.0D), 0.0D, 1.0D, 0.0D);
|
||||
GL11.glRotated(-MathHelper.wrapDegrees(camera.getPitch()), 1.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
public void applyCameraRots() {
|
||||
Camera camera = MinecraftClient.getInstance().getEntityRenderDispatcher().camera;
|
||||
GL11.glRotated(MathHelper.wrapDegrees(camera.getPitch()), 1.0D, 0.0D, 0.0D);
|
||||
GL11.glRotated(MathHelper.wrapDegrees(camera.getYaw() + 180.0D), 0.0D, 1.0D, 0.0D);
|
||||
}
|
||||
|
||||
public void setup3DRender(boolean disableDepth) {
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ONE, GlStateManager.DstFactor.ZERO);
|
||||
if (disableDepth)
|
||||
RenderSystem.disableDepthTest();
|
||||
RenderSystem.depthMask(MinecraftClient.isFabulousGraphicsOrBetter());
|
||||
RenderSystem.enableCull();
|
||||
}
|
||||
|
||||
public void end3DRender() {
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.disableCull();
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.depthMask(true);
|
||||
}
|
||||
|
||||
public void drawSphere(MatrixStack matrixStack, float radius, int gradation, Color color, boolean testDepth, Vec3d pos) {
|
||||
Matrix4f matrix4f = matrixStack.peek().getModel();
|
||||
final float PI = 3.141592f;
|
||||
float x, y, z, alpha, beta;
|
||||
setup3DRender(!testDepth);
|
||||
for (alpha = 0.0f; alpha < Math.PI; alpha += PI / gradation) {
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
bufferBuilder.begin(1, VertexFormats.POSITION_COLOR);
|
||||
for (beta = 0.0f; beta < 2.01f * Math.PI; beta += PI / gradation) {
|
||||
x = (float) (pos.getX() + (radius * Math.cos(beta) * Math.sin(alpha)));
|
||||
y = (float) (pos.getY() + (radius * Math.sin(beta) * Math.sin(alpha)));
|
||||
z = (float) (pos.getZ() + (radius * Math.cos(alpha)));
|
||||
Vec3d renderPos = Render3DUtils.INSTANCE.getRenderPosition(x, y, z);
|
||||
bufferBuilder.vertex(matrix4f, (float)renderPos.x, (float)renderPos.y, (float)renderPos.z).color(color.r, color.g, color.b, color.a).next();
|
||||
x = (float) (pos.getX() + (radius * Math.cos(beta) * Math.sin(alpha + PI / gradation)));
|
||||
y = (float) (pos.getY() + (radius * Math.sin(beta) * Math.sin(alpha + PI / gradation)));
|
||||
z = (float) (pos.getZ() + (radius * Math.cos(alpha + PI / gradation)));
|
||||
renderPos = Render3DUtils.INSTANCE.getRenderPosition(x, y, z);
|
||||
bufferBuilder.vertex(matrix4f, (float)renderPos.x, (float)renderPos.y, (float)renderPos.z).color(color.r, color.g, color.b, color.a).next();
|
||||
}
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
}
|
||||
end3DRender();
|
||||
}
|
||||
|
||||
public void drawBox(MatrixStack matrixStack, Box bb, Color color) {
|
||||
setup3DRender(true);
|
||||
drawFilledBox(matrixStack, bb, color);
|
||||
RenderSystem.lineWidth(1);
|
||||
drawOutlineBox(matrixStack, bb, color);
|
||||
end3DRender();
|
||||
}
|
||||
|
||||
public void drawBoxOutline(MatrixStack matrixStack, Box bb, Color color) {
|
||||
setup3DRender(true);
|
||||
RenderSystem.lineWidth(1);
|
||||
drawOutlineBox(matrixStack, bb, color);
|
||||
end3DRender();
|
||||
}
|
||||
|
||||
public void drawBoxInside(MatrixStack matrixStack, Box bb, Color color) {
|
||||
setup3DRender(true);
|
||||
drawFilledBox(matrixStack, bb, color);
|
||||
end3DRender();
|
||||
}
|
||||
|
||||
public void drawEntityBox(MatrixStack matrixStack, Entity entity, float partialTicks, Color color) {
|
||||
Vec3d renderPos = getEntityRenderPosition(entity, partialTicks);
|
||||
drawEntityBox(matrixStack, entity, renderPos.x, renderPos.y, renderPos.z, color);
|
||||
}
|
||||
|
||||
public void drawEntityBox(MatrixStack matrixStack, Entity entity, double x, double y, double z, Color color) {
|
||||
float yaw = MathHelper.lerpAngleDegrees(MinecraftClient.getInstance().getTickDelta(), entity.prevYaw, entity.yaw);
|
||||
setup3DRender(true);
|
||||
matrixStack.translate(x, y, z);
|
||||
matrixStack.multiply(new Quaternion(new Vector3f(0, -1, 0), yaw, true));
|
||||
matrixStack.translate(-x, -y, -z);
|
||||
|
||||
Box bb = new Box(x - entity.getWidth() + 0.25, y, z - entity.getWidth() + 0.25, x + entity.getWidth() - 0.25, y + entity.getHeight() + 0.1, z + entity.getWidth() - 0.25);
|
||||
if (entity instanceof ItemEntity)
|
||||
bb = new Box(x - 0.15, y + 0.1f, z - 0.15, x + 0.15, y + 0.5, z + 0.15);
|
||||
|
||||
drawFilledBox(matrixStack, bb, color);
|
||||
RenderSystem.lineWidth(1);
|
||||
drawOutlineBox(matrixStack, bb, color);
|
||||
|
||||
end3DRender();
|
||||
matrixStack.translate(x, y, z);
|
||||
matrixStack.multiply(new Quaternion(new Vector3f(0, 1, 0), yaw, true));
|
||||
matrixStack.translate(-x, -y, -z);
|
||||
}
|
||||
|
||||
public double interpolate(final double now, final double then, final double percent) {
|
||||
return (then + (now - then) * percent);
|
||||
}
|
||||
|
||||
public void drawFilledBox(MatrixStack matrixStack, Box bb, Color color) {
|
||||
Matrix4f matrix4f = matrixStack.peek().getModel();
|
||||
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
bufferBuilder.begin(7/*QUADS*/, VertexFormats.POSITION_COLOR);
|
||||
float minX = (float)bb.minX;
|
||||
float minY = (float)bb.minY;
|
||||
float minZ = (float)bb.minZ;
|
||||
float maxX = (float)bb.maxX;
|
||||
float maxY = (float)bb.maxY;
|
||||
float maxZ = (float)bb.maxZ;
|
||||
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, maxX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, minY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, maxZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, minX, maxY, minZ).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
}
|
||||
|
||||
public void drawOutlineBox(MatrixStack matrixStack, Box bb, Color color) {
|
||||
Matrix4f matrix4f = matrixStack.peek().getModel();
|
||||
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
bufferBuilder.begin(1/*LINES*/, VertexFormats.POSITION_COLOR);
|
||||
|
||||
VoxelShape shape = VoxelShapes.cuboid(bb);
|
||||
shape.forEachEdge((x1, y1, z1, x2, y2, z2) -> {
|
||||
bufferBuilder.vertex(matrix4f, (float)x1, (float)y1, (float)z1).color(color.r, color.g, color.b, color.a).next();
|
||||
bufferBuilder.vertex(matrix4f, (float)x2, (float)y2, (float)z2).color(color.r, color.g, color.b, color.a).next();
|
||||
});
|
||||
|
||||
bufferBuilder.end();
|
||||
BufferRenderer.draw(bufferBuilder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user