1.17 pog (#12)

* 1.17?

* event bus monke

* coding on da github

* fixes fixes bruh

* fixes again

* lazy fix to worklow actions

* fix gradle.yml
This commit is contained in:
Cloudburst
2021-06-12 09:10:19 +02:00
committed by GitHub
parent 12c2049b8b
commit e81df336f6
38 changed files with 210 additions and 212 deletions

View File

@@ -5,7 +5,7 @@ import minegame159.meteorclient.utils.player.ChatUtils;
import net.minecraft.client.MinecraftClient;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.StringNbtReader;
import java.util.Random;
@@ -273,9 +273,9 @@ public class GiveUtils {
}
if (container.equals("egg")) {
CompoundTag ct = new CompoundTag();
NbtCompound ct = new NbtCompound();
ct.put("EntityTag", StringNbtReader.parse("{Time:1,id:\"minecraft:falling_block\",BlockState:{Name:\"minecraft:chest\"}}"));
((CompoundTag) ct.get("EntityTag")).put("TileEntityData", item.getTag().get("BlockEntityTag"));
((NbtCompound) ct.get("EntityTag")).put("TileEntityData", item.getTag().get("BlockEntityTag"));
ct.put("display", item.getTag().get("display"));
item = new ItemStack(Items.STRIDER_SPAWN_EGG);
item.setTag(ct);

View File

@@ -6,7 +6,7 @@ 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.util.math.Vec3f;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.util.math.*;
@@ -83,7 +83,7 @@ public class Render3DUtils {
setup3DRender(!testDepth);
for (alpha = 0.0f; alpha < Math.PI; alpha += PI / gradation) {
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(1, VertexFormats.POSITION_COLOR);
bufferBuilder.begin(VertexFormat.DrawMode.LINES, 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)));
@@ -129,10 +129,10 @@ public class Render3DUtils {
}
public static void drawEntityBox(MatrixStack matrixStack, Entity entity, double x, double y, double z, Color color) {
float yaw = MathHelper.lerpAngleDegrees(mc.getTickDelta(), entity.prevYaw, entity.yaw);
float yaw = MathHelper.lerpAngleDegrees(mc.getTickDelta(), entity.prevYaw, entity.getYaw());
setup3DRender(true);
matrixStack.translate(x, y, z);
matrixStack.multiply(new Quaternion(new Vector3f(0, -1, 0), yaw, true));
matrixStack.multiply(new Quaternion(new Vec3f(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);
@@ -145,7 +145,7 @@ public class Render3DUtils {
end3DRender();
matrixStack.translate(x, y, z);
matrixStack.multiply(new Quaternion(new Vector3f(0, 1, 0), yaw, true));
matrixStack.multiply(new Quaternion(new Vec3f(0, 1, 0), yaw, true));
matrixStack.translate(-x, -y, -z);
}
@@ -157,7 +157,7 @@ public class Render3DUtils {
Matrix4f matrix4f = matrixStack.peek().getModel();
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(7/*QUADS*/, VertexFormats.POSITION_COLOR);
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
float minX = (float)bb.minX;
float minY = (float)bb.minY;
float minZ = (float)bb.minZ;
@@ -202,7 +202,7 @@ public class Render3DUtils {
Matrix4f matrix4f = matrixStack.peek().getModel();
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(1/*LINES*/, VertexFormats.POSITION_COLOR);
bufferBuilder.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION_COLOR);
VoxelShape shape = VoxelShapes.cuboid(bb);
shape.forEachEdge((x1, y1, z1, x2, y2, z2) -> {

View File

@@ -28,6 +28,6 @@ public class WorldUtils {
double d = pos1.getX() - pos2.getX();
double e = pos1.getY() - pos2.getY();
double f = pos1.getZ() - pos2.getZ();
return MathHelper.sqrt(d * d + e * e + f * f);
return MathHelper.sqrt((float) (d * d + e * e + f * f));
}
}

View File

@@ -3,13 +3,13 @@ package cloudburst.rejects.utils.gui;
import cloudburst.rejects.mixin.meteor.GuiRendererAccessor;
import minegame159.meteorclient.gui.renderer.GuiRenderer;
import minegame159.meteorclient.gui.widgets.WWidget;
import minegame159.meteorclient.rendering.MeshBuilder;
import minegame159.meteorclient.renderer.Renderer2D;
import minegame159.meteorclient.utils.render.color.Color;
public class GuiUtils {
public static void quadRounded(GuiRenderer renderer, double x, double y, double width, double height, Color color, int round, boolean roundTop) {
MeshBuilder mb = ((GuiRendererAccessor)renderer).getMeshbuilder();
RoundedMeshBuilder.quadRounded(mb, x, y, width, height, color, round, roundTop);
Renderer2D mb = ((GuiRendererAccessor)renderer).getRenderer2D();
RoundedRenderer2D.quadRounded(mb, x, y, width, height, color, round, roundTop);
}
public static void quadRounded(GuiRenderer renderer, double x, double y, double width, double height, Color color, int round) {
quadRounded(renderer, x, y, width, height, color, round, true);
@@ -18,25 +18,25 @@ public class GuiUtils {
quadRounded(renderer, widget.x, widget.y, widget.width, widget.height, color, round);
}
public static void quadOutlineRounded(GuiRenderer renderer, double x, double y, double width, double height, Color color, int round, double s) {
MeshBuilder mb = ((GuiRendererAccessor)renderer).getMeshbuilder();
RoundedMeshBuilder.quadRoundedOutline(mb, x, y, width, height, color, round, s);
Renderer2D mb = ((GuiRendererAccessor)renderer).getRenderer2D();
RoundedRenderer2D.quadRoundedOutline(mb, x, y, width, height, color, round, s);
}
public static void quadOutlineRounded(GuiRenderer renderer, WWidget widget, Color color, int round, double s) {
quadOutlineRounded(renderer, widget.x, widget.y, widget.width, widget.height, color, round, s);
}
public static void quadRoundedSide(GuiRenderer renderer, double x, double y, double width, double height, Color color, int r, boolean right) {
MeshBuilder mb = ((GuiRendererAccessor)renderer).getMeshbuilder();
RoundedMeshBuilder.quadRoundedSide(mb, x, y, width, height, color, r, right);
Renderer2D mb = ((GuiRendererAccessor)renderer).getRenderer2D();
RoundedRenderer2D.quadRoundedSide(mb, x, y, width, height, color, r, right);
}
public static void quadRoundedSide(GuiRenderer renderer, WWidget widget, Color color, int round, boolean right) {
quadRoundedSide(renderer, widget.x, widget.y, widget.width, widget.height, color, round, right);
}
public static void circlePart(GuiRenderer renderer, double x, double y, double r, double startAngle, double angle, Color color) {
MeshBuilder mb = ((GuiRendererAccessor)renderer).getMeshbuilder();
RoundedMeshBuilder.circlePart(mb, x, y, r, startAngle, angle, color);
Renderer2D mb = ((GuiRendererAccessor)renderer).getRenderer2D();
RoundedRenderer2D.circlePart(mb, x, y, r, startAngle, angle, color);
}
public static void circlePartOutline(GuiRenderer renderer, double x, double y, double r, double startAngle, double angle, Color color, double outlineWidth) {
MeshBuilder mb = ((GuiRendererAccessor)renderer).getMeshbuilder();
RoundedMeshBuilder.circlePartOutline(mb, x, y, r, startAngle, angle, color, outlineWidth);
Renderer2D mb = ((GuiRendererAccessor)renderer).getRenderer2D();
RoundedRenderer2D.circlePartOutline(mb, x, y, r, startAngle, angle, color, outlineWidth);
}
}

View File

@@ -1,16 +1,16 @@
package cloudburst.rejects.utils.gui;
import minegame159.meteorclient.rendering.MeshBuilder;
import minegame159.meteorclient.renderer.Renderer2D;
import minegame159.meteorclient.utils.render.color.Color;
public class RoundedMeshBuilder {
public class RoundedRenderer2D {
private static final double circleNone = 0;
private static final double circleQuarter = Math.PI / 2;
private static final double circleHalf = circleQuarter * 2;
private static final double circleThreeQuarter = circleQuarter * 3;
public static void quadRoundedOutline(MeshBuilder mb, double x, double y, double width, double height, Color color, int r, double s) {
public static void quadRoundedOutline(Renderer2D mb, double x, double y, double width, double height, Color color, int r, double s) {
r = getR(r, width, height);
if (r == 0) {
mb.quad(x, y, width, s, color);
@@ -33,7 +33,7 @@ public class RoundedMeshBuilder {
}
}
public static void quadRounded(MeshBuilder mb, double x, double y, double width, double height, Color color, int r, boolean roundTop) {
public static void quadRounded(Renderer2D mb, double x, double y, double width, double height, Color color, int r, boolean roundTop) {
r = getR(r, width, height);
if (r == 0)
mb.quad(x, y, width, height, color);
@@ -57,7 +57,7 @@ public class RoundedMeshBuilder {
}
}
public static void quadRoundedSide(MeshBuilder mb, double x, double y, double width, double height, Color color, int r, boolean right) {
public static void quadRoundedSide(Renderer2D mb, double x, double y, double width, double height, Color color, int r, boolean right) {
r = getR(r, width, height);
if (r == 0)
mb.quad(x, y, width, height, color);
@@ -91,21 +91,21 @@ public class RoundedMeshBuilder {
return Math.max(1, (int)(angle * r / circleQuarter));
}
public static void circlePart(MeshBuilder mb, double x, double y, double r, double startAngle, double angle, Color color) {
public static void circlePart(Renderer2D mb, double x, double y, double r, double startAngle, double angle, Color color) {
int cirDepth = getCirDepth(r, angle);
double cirPart = angle / cirDepth;
vert2(mb,x + Math.sin(startAngle) * r, y - Math.cos(startAngle) * r, color);
int center = mb.triangles.vec2(x, y).color(color).next();
int prev = mb.triangles.vec2(x + Math.sin(startAngle) * r, y - Math.cos(startAngle) * r).color(color).next();
for (int i = 1; i < cirDepth + 1; i++) {
vert2(mb, x, y, color);
double xV = x + Math.sin(startAngle + cirPart * i) * r;
double yV = y - Math.cos(startAngle + cirPart * i) * r;
vert2(mb, xV, yV, color);
if (i != cirDepth)
vert2(mb, xV, yV, color);
int next = mb.triangles.vec2(xV, yV).color(color).next();
mb.triangles.quad(prev, center, next, next);
prev = next;
}
}
public static void circlePartOutline(MeshBuilder mb, double x, double y, double r, double startAngle, double angle, Color color, double outlineWidth) {
public static void circlePartOutline(Renderer2D mb, double x, double y, double r, double startAngle, double angle, Color color, double outlineWidth) {
int cirDepth = getCirDepth(r, angle);
double cirPart = angle / cirDepth;
for (int i = 0; i < cirDepth; i++) {
@@ -117,18 +117,13 @@ public class RoundedMeshBuilder {
double yON = y - Math.cos(startAngle + cirPart * (i + 1)) * r;
double xIN = x + Math.sin(startAngle + cirPart * (i + 1)) * (r - outlineWidth);
double yIN = y - Math.cos(startAngle + cirPart * (i + 1)) * (r - outlineWidth);
//
vert2(mb, xOC, yOC, color);
vert2(mb, xON, yON, color);
vert2(mb, xIC, yIC, color);
//
vert2(mb, xIC, yIC, color);
vert2(mb, xON, yON, color);
vert2(mb, xIN, yIN, color);
mb.triangles.quad(
mb.triangles.vec2(xOC, yOC).color(color).next(),
mb.triangles.vec2(xON, yON).color(color).next(),
mb.triangles.vec2(xIC, yIC).color(color).next(),
mb.triangles.vec2(xIN, yIN).color(color).next()
);
}
}
public static void vert2(MeshBuilder mb, double x, double y, Color c) {
mb.pos(x, y, 0).color(c).endVertex();
}
}