Skip to content

Commit

Permalink
1.20.4 Update
Browse files Browse the repository at this point in the history
also added sphere option to Jump Helper
  • Loading branch information
cqb13 committed Dec 13, 2023
1 parent 62c4807 commit b6d41b1
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Java CI with Gradle

concurrency:
group: "build-1.20.2"
group: "build-1.20.4"
cancel-in-progress: true

on:
Expand Down Expand Up @@ -31,8 +31,8 @@ jobs:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "1.20.2-build-${{ github.run_number }}"
automatic_release_tag: "1.20.4-build-${{ github.run_number }}"
prerelease: false
title: "1.20.2 Build ${{ github.run_number }}"
title: "1.20.4 Build ${{ github.run_number }}"
files: |
./build/libs/*.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Fancy badges -->
<a href="https://github.com/cqb13/Numby-hack/releases"><img src="https://img.shields.io/badge/Version-v2.2-green" alt="Version"></a>
<a href="https://anticope.ml/addons/?"><img src="https://img.shields.io/badge/Verified-Yes!-green" alt="Verified"></a>
<img src="https://img.shields.io/badge/Minecraft%20Version-1.20.2-green" alt="Minecraft Version">
<img src="https://img.shields.io/badge/Minecraft%20Version-1.20.4-green" alt="Minecraft Version">
<img src="https://img.shields.io/github/downloads/cqb13/Numby-hack/total?color=green">
<img src="https://img.shields.io/github/languages/code-size/cqb13/Numby-hack?color=green" alt="Code Size">
<img src="https://img.shields.io/github/stars/cqb13/Numby-hack?color=green" alt="Stars">
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx2G

# Fabric Properties
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.0

# Mod Properties
mod_version=2.2
maven_group=cqb13.NumbyHack
archives_base_name=Numby-Hack

meteor_version=0.5.5
meteor_version=0.5.6
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void playerLog() {
for (Entity entity : mc.world.getEntities()) {
if (entity instanceof PlayerEntity && entity.getUuid() != mc.player.getUuid()) {
if (onlyTrusted.get() && entity != mc.player && !Friends.get().isFriend((PlayerEntity) entity)) {
disconnect(Text.of("[Auto Log+] A non trusted player ["+ entity.getEntityName() +"] has entered your render distance."));
disconnect(Text.of("[Auto Log+] A non trusted player ["+ entity.getName().getString() +"] has entered your render distance."));
}
}

Expand Down
95 changes: 73 additions & 22 deletions src/main/java/cqb13/NumbyHack/modules/general/JumpHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,58 @@
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.MathHelper;

public class JumpHelper extends Module {

private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Boolean> alwaysShow = sgGeneral.add(new BoolSetting.Builder()
.name("always-show")
.description("Always show the shape.")
.defaultValue(false)
.build());

private final Setting<Boolean> useRainbow = sgGeneral.add(new BoolSetting.Builder()
.name("use-rainbow")
.defaultValue(false)
.build());

private final Setting<SettingColor> circleColor = sgGeneral.add(new ColorSetting.Builder()
.name("circle-color")
.description("Color for circle rendering")
.defaultValue(new SettingColor(146,188,98, 255))
private final Setting<SettingColor> shapeColor = sgGeneral.add(new ColorSetting.Builder()
.name("shape-color")
.description("Color for shape rendering")
.defaultValue(new SettingColor(146, 188, 98, 255))
.visible(() -> !useRainbow.get())
.build());

private final Setting<Double> circleRadius = sgGeneral.add(new DoubleSetting.Builder()
.name("circle-radius")
.description("How big the circle should be draw.")
private final Setting<Double> shapeRadius = sgGeneral.add(new DoubleSetting.Builder()
.name("shape-radius")
.description("How big the shape should be drawn.")
.defaultValue(3.5)
.min(0)
.build());

private final Setting<Boolean> makeItASphere = sgGeneral.add(new BoolSetting.Builder()
.name("make-it-a-sphere")
.description("Make the shape a sphere.")
.defaultValue(false)
.build());

public Setting<Integer> gradation = sgGeneral.add(new IntSetting.Builder()
.name("gradation")
.defaultValue(30)
.range(20, 100)
.sliderRange(20, 100)
.visible(makeItASphere::get)
.build()
);

public JumpHelper() {
super(NumbyHack.CATEGORY, "jump-helper", "Draws a circle around you when you jump to help with movement.");
super(NumbyHack.CATEGORY, "jump-helper", "Draws a shape around you when you jump to help with movement.");
}

private double circleSection = 0.0;
Vec3d renderPos = new Vec3d(0, 0 ,0);
private double shapeResolution = 30;
Vec3d renderPos = new Vec3d(0, 0, 0);

@EventHandler
private void onTick(TickEvent.Post event) {
Expand All @@ -54,33 +76,62 @@ private void onRender(Render3DEvent event) {
if (!Utils.canUpdate()) return;

if (mc.player == null) return;
if (mc.player.isOnGround()) return;
if (mc.player.isOnGround() && !alwaysShow.get()) return;

boolean rainbow = useRainbow.get();
double radius = circleRadius.get();
double radius = shapeRadius.get();

if (makeItASphere.get()) {
renderSphere(event, radius, gradation.get(), renderPos);
} else {
renderCircle(event, rainbow, radius, renderPos);
}
}

private void renderCircle(Render3DEvent event, boolean rainbow, double radius, Vec3d origin) {
Vec3d last = null;
circleSection += rainbow ? 1.0 : 0;
if (circleSection > 360) circleSection = 0;
double shapeSection = 0.0;
shapeSection += rainbow ? 1.0 : 0;
if (shapeSection > 360) shapeSection = 0;

for (int i = 0; i <= 360; i += rainbow ? 1 : 7) {
Color drawCircleColor;
if (!rainbow) drawCircleColor = circleColor.get();
Color drawShapeColor;
if (!rainbow) drawShapeColor = shapeColor.get();
else {
double rot = (255.0 * 3) * (((((double) i) + circleSection) % 360) / 360.0);
double rot = (255.0 * 3) * (((((double) i) + shapeSection) % 360) / 360.0);
int seed = (int) Math.floor(rot / 255.0);
double current = rot % 255;
double red = seed == 0 ? current : (seed == 1 ? Math.abs(current - 255) : 0);
double green = seed == 1 ? current : (seed == 2 ? Math.abs(current - 255) : 0);
double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0);
drawCircleColor = new Color((int) red, (int) green, (int) blue);
drawShapeColor = new Color((int) red, (int) green, (int) blue);
}
Vec3d drawVec = renderPos;
double rad = Math.toRadians(i);
double sin = Math.sin(rad) * radius;
double cos = Math.cos(rad) * radius;
Vec3d c = new Vec3d(drawVec.x + sin, drawVec.y, drawVec.z + cos);
if (last != null) event.renderer.line(last.x, last.y, last.z, c.x, c.y, c.z, drawCircleColor);
Vec3d c = new Vec3d(origin.x + sin, origin.y, origin.z + cos);
if (last != null) event.renderer.line(last.x, last.y, last.z, c.x, c.y, c.z, drawShapeColor);
last = c;
}
}
}


private void renderSphere(Render3DEvent event, double radius, int gradation, Vec3d pos) {
float alpha, beta;

for (alpha = 0.0f; alpha < Math.PI; alpha += Math.PI / gradation) {
for (beta = 0.0f; beta < 2.0 * Math.PI; beta += Math.PI / gradation) {
double x1 = (float) (pos.getX() + (radius * Math.cos(beta) * Math.sin(alpha)));
double y1 = (float) (pos.getY() + (radius * Math.sin(beta) * Math.sin(alpha)));
double z1 = (float) (pos.getZ() + (radius * Math.cos(alpha)));

double sin = Math.sin(alpha + Math.PI / gradation);
double x2 = (float) (pos.getX() + (radius * Math.cos(beta) * sin));
double y2 = (float) (pos.getY() + (radius * Math.sin(beta) * sin));
double z2 = (float) (pos.getZ() + (radius * Math.cos(alpha + Math.PI / gradation)));

event.renderer.line(x1, y1, z1, x2, y2, z2, shapeColor.get());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public Entry(PlayerEntity entity) {
this.entity = entity;

uuid = entity.getUuid();
name = entity.getEntityName();
name = entity.getName().getString();
health = Math.round(entity.getHealth() + entity.getAbsorptionAmount());
maxHealth = Math.round(entity.getMaxHealth() + entity.getAbsorptionAmount());

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/cqb13/NumbyHack/modules/general/NewChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.util.math.Vec3d;

import java.util.*;

Expand Down Expand Up @@ -110,7 +111,7 @@ private void onRender(Render3DEvent event) {
synchronized (newChunks) {
for (ChunkPos c : newChunks) {
if (mc.getCameraEntity().getBlockPos().isWithinDistance(c.getStartPos(), 1024)) {
render(new Box(c.getStartPos(), c.getStartPos().add(16, renderHeight.get(), 16)), newChunksSideColor.get(), newChunksLineColor.get(), shapeMode.get(), event);
render(new Box(new Vec3d(c.getStartPos().getX(), c.getStartPos().getY()+renderHeight.get(), c.getStartPos().getZ()), new Vec3d(c.getStartPos().getX()+16, c.getStartPos().getY()+renderHeight.get(), c.getStartPos().getZ()+16)), newChunksSideColor.get(), newChunksLineColor.get(), shapeMode.get(), event);
}
}
}
Expand All @@ -120,7 +121,7 @@ private void onRender(Render3DEvent event) {
synchronized (oldChunks) {
for (ChunkPos c : oldChunks) {
if (mc.getCameraEntity().getBlockPos().isWithinDistance(c.getStartPos(), 1024)) {
render(new Box(c.getStartPos(), c.getStartPos().add(16, renderHeight.get(), 16)), oldChunksSideColor.get(), oldChunksLineColor.get(), shapeMode.get(), event);
render(new Box(new Vec3d(c.getStartPos().getX(), c.getStartPos().getY()+renderHeight.get(), c.getStartPos().getZ()), new Vec3d(c.getStartPos().getX()+16, c.getStartPos().getY()+renderHeight.get(), c.getStartPos().getZ()+16)), oldChunksSideColor.get(), oldChunksLineColor.get(), shapeMode.get(), event);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cqb13/NumbyHack/modules/hud/TextRadarHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void tick(HudRenderer renderer) {
if (entity.equals(mc.player)) continue;
if (!friends.get() && Friends.get().isFriend(entity)) continue;

String text = entity.getEntityName();
String text = entity.getName().getString();
if (health.get()) text += " " + (int) entity.getHealth() + entity.getAbsorptionAmount();
if (ping.get()) text += String.format("(%sms)", EntityUtils.getPing(entity));
if (distance.get()) text += String.format("(%sm)", Math.round(Objects.requireNonNull(mc.getCameraEntity()).distanceTo(entity)));
Expand Down Expand Up @@ -198,7 +198,7 @@ public void render(HudRenderer renderer) {
if (entity.equals(mc.player)) continue;
if (!friends.get() && Friends.get().isFriend(entity)) continue;

String text = entity.getEntityName();
String text = entity.getName().getString();
Color color = PlayerUtils.getPlayerColor(entity, primaryColor.get());

double width = renderer.textWidth(text, shadow.get(), getScale());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static Value getServerBrand() {
public static boolean isTarget() {
for (Module module : Modules.get().getAll()) {
if (module.getInfoString() != null) {
if (module.getInfoString().contains(deadEntity.getEntityName())) return true;
if (module.getInfoString().contains(deadEntity.getName().getString())) return true;
}
}
return false;
Expand Down

0 comments on commit b6d41b1

Please sign in to comment.