Skip to content

Commit 884334e

Browse files
author
nxyi
committed
remove useless functions and usused classes
1 parent b73ff10 commit 884334e

File tree

6 files changed

+1
-298
lines changed

6 files changed

+1
-298
lines changed

src/main/java/com/dark/zewo2/Utils/JinxUtils.java

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,6 @@
55

66
package com.dark.zewo2.Utils;
77

8-
import meteordevelopment.meteorclient.utils.player.ChatUtils;
9-
import net.minecraft.client.MinecraftClient;
10-
import net.minecraft.client.network.ClientPlayerEntity;
11-
import net.minecraft.client.world.ClientWorld;
12-
import net.minecraft.entity.Entity;
13-
import net.minecraft.item.Item;
14-
import net.minecraft.item.ItemStack;
15-
import net.minecraft.nbt.StringNbtReader;
16-
import net.minecraft.network.ClientConnection;
17-
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
18-
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
19-
import net.minecraft.text.Text;
20-
import net.minecraft.util.math.Box;
21-
import net.minecraft.util.math.MathHelper;
22-
import net.minecraft.util.math.Vec2f;
23-
import net.minecraft.util.math.Vec3d;
24-
25-
import java.security.MessageDigest;
26-
import java.util.Arrays;
27-
import java.util.List;
28-
import java.util.Random;
29-
30-
import static meteordevelopment.meteorclient.MeteorClient.LOG;
31-
import static meteordevelopment.meteorclient.MeteorClient.mc;
32-
338
public class JinxUtils {
349

3510
public static void sleep(long ms) {
@@ -38,122 +13,6 @@ public static void sleep(long ms) {
3813
} catch (Exception ignored) {
3914
}
4015
}
41-
public static void sendSignedMessage(String message) {
42-
if (message.startsWith("/")) mc.player.sendMessage(Text.of(message.substring(1)), false);
43-
else mc.player.networkHandler.sendChatMessage(message);
44-
}
45-
46-
public static String generateMessage(int amount) {
47-
StringBuilder message = new StringBuilder();
48-
for (int i = 0; i < amount; i++) message.append((char) (0x4e00 + (int) (Math.random() * (0x9fa5 - 0x4e00 + 1))));
49-
return message.toString();
50-
}
51-
52-
public static String randomString(int amount) {
53-
StringBuilder message = new StringBuilder();
54-
String[] chars = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
55-
for (int i = 0; i < amount; i++) message.append(chars[new Random().nextInt(chars.length)]);
56-
return message.toString();
57-
}
58-
59-
public static Vec3d randomPosBetween(int min, int max) {
60-
int x = new Random().nextInt(min, max);
61-
int y = 255;
62-
int z = new Random().nextInt(min, max);
63-
return new Vec3d(x, y, z);
64-
}
65-
66-
public static Vec3d pickRandomPos() {
67-
int x = new Random().nextInt(16777215);
68-
int y = 255;
69-
int z = new Random().nextInt(16777215);
70-
return new Vec3d(x, y, z);
71-
}
72-
73-
public static Vec2f getPitchYawFromOtherEntity(Vec3d eyePos, Vec3d targetV3) {
74-
double vec = 57.2957763671875;
75-
Vec3d target = targetV3.subtract(eyePos);
76-
double square = Math.sqrt(target.x * target.x + target.z * target.z);
77-
float pitch = MathHelper.wrapDegrees((float) (-(MathHelper.atan2(target.y, square) * vec)));
78-
float yaw = MathHelper.wrapDegrees((float) (MathHelper.atan2(target.z, target.x) * vec) - 90.0F);
79-
return new Vec2f(pitch, yaw);
80-
}
81-
82-
public static Vec3d relativeToAbsolute(Vec3d absRootPos, Vec2f rotation, Vec3d relative) {
83-
double xOffset = relative.x;
84-
double yOffset = relative.y;
85-
double zOffset = relative.z;
86-
float rot = 0.017453292F;
87-
float f = MathHelper.cos((rotation.y + 90.0F) * rot);
88-
float g = MathHelper.sin((rotation.y + 90.0F) * rot);
89-
float h = MathHelper.cos(-rotation.x * rot);
90-
float i = MathHelper.sin(-rotation.x * rot);
91-
float j = MathHelper.cos((-rotation.x + 90.0F) * rot);
92-
float k = MathHelper.sin((-rotation.x + 90.0F) * rot);
93-
Vec3d vec3d2 = new Vec3d(f * h, i, g * h);
94-
Vec3d vec3d3 = new Vec3d(f * j, k, g * j);
95-
Vec3d vec3d4 = vec3d2.crossProduct(vec3d3).multiply(-1.0D);
96-
double d = vec3d2.x * zOffset + vec3d3.x * yOffset + vec3d4.x * xOffset;
97-
double e = vec3d2.y * zOffset + vec3d3.y * yOffset + vec3d4.y * xOffset;
98-
double l = vec3d2.z * zOffset + vec3d3.z * yOffset + vec3d4.z * xOffset;
99-
return new Vec3d(absRootPos.x + d, absRootPos.y + e, absRootPos.z + l);
100-
}
101-
102-
public static double distance(Vec3d vec1, Vec3d vec2) {
103-
double dX = vec2.x - vec1.x;
104-
double dY = vec2.y - vec1.y;
105-
double dZ = vec2.z - vec1.z;
106-
return Math.sqrt(dX * dX + dY * dY + dZ * dZ);
107-
}
108-
109-
public static double[] directionSpeed(double speed) {
110-
float forward = mc.player.forwardSpeed;
111-
float side = mc.player.sidewaysSpeed;
112-
float yaw = mc.player.prevYaw + (mc.player.getYaw() - mc.player.prevYaw);
113-
if (forward != 0.0f) {
114-
if (side > 0.0f) yaw += ((forward > 0.0f) ? -45 : 45);
115-
else if (side < 0.0f) yaw += ((forward > 0.0f) ? 45 : -45);
116-
side = 0.0f;
117-
if (forward > 0.0f) forward = 1.0f;
118-
else if (forward < 0.0f) forward = -1.0f;
119-
}
120-
double sin = Math.sin(Math.toRadians(yaw + 90.0F));
121-
double cos = Math.cos(Math.toRadians(yaw + 90.0F));
122-
double dx = forward * speed * cos + side * speed * sin;
123-
double dz = forward * speed * sin - side * speed * cos;
124-
return new double[]{dx, dz};
125-
}
126-
127-
public static double roundCoordinates(double coord) {
128-
coord = Math.round(coord * 100.0) / 100.0;
129-
coord = Math.nextAfter(coord, coord + Math.signum(coord));
130-
if ((int) (coord * 1000.0) % 10.0 != 0.0) coord = Math.ceil(coord);
131-
return coord;
132-
}
133-
134-
public static String getHWID() {
135-
try{
136-
String toEncrypt = System.getenv("COMPUTERNAME") + System.getProperty("user.name") + System.getenv("PROCESSOR_IDENTIFIER") + System.getenv("PROCESSOR_LEVEL");
137-
MessageDigest md = MessageDigest.getInstance("MD5");
138-
md.update(toEncrypt.getBytes());
139-
StringBuffer hexString = new StringBuffer();
140-
141-
byte byteData[] = md.digest();
142-
143-
for (byte aByteData : byteData) {
144-
String hex = Integer.toHexString(0xff & aByteData);
145-
if (hex.length() == 1) hexString.append('0');
146-
hexString.append(hex);
147-
}
148-
149-
LOG.info(hexString.toString());
150-
return hexString.toString();
151-
} catch (Exception e) {
152-
e.printStackTrace();
153-
LOG.info("ERROR HWID");
154-
return "Error";
155-
}
156-
}
15716

15817
public static int rainbowColors(int colors) {
15918
int color = 0;

src/main/java/com/dark/zewo2/Utils/JsonUtils.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/main/java/com/dark/zewo2/Utils/NetworkUtils.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/main/java/com/dark/zewo2/Utils/RecieveUtils.java

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,13 @@
11
package com.dark.zewo2.Utils;
22

3-
import net.minecraft.block.Block;
4-
import net.minecraft.block.Blocks;
5-
import net.minecraft.client.MinecraftClient;
6-
import net.minecraft.item.Item;
7-
import net.minecraft.item.ItemStack;
8-
import net.minecraft.nbt.StringNbtReader;
9-
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
103
import net.minecraft.util.hit.BlockHitResult;
114
import net.minecraft.util.hit.HitResult;
12-
import net.minecraft.util.math.BlockPos;
13-
import net.minecraft.util.math.MathHelper;
145
import net.minecraft.util.math.Vec3d;
156
import net.minecraft.world.RaycastContext;
16-
import oshi.SystemInfo;
17-
import oshi.hardware.GraphicsCard;
18-
import oshi.hardware.HardwareAbstractionLayer;
197

20-
import java.security.MessageDigest;
21-
import java.util.ArrayList;
8+
import static meteordevelopment.meteorclient.MeteorClient.mc;
229

2310
public class Utils {
24-
static MinecraftClient mc = MinecraftClient.getInstance();
25-
public static String getHWID() {
26-
try {
27-
SystemInfo si = new SystemInfo();
28-
HardwareAbstractionLayer hal = si.getHardware();
29-
StringBuilder toEncrypt = new StringBuilder();
30-
for (GraphicsCard graphicsCard : hal.getGraphicsCards()) {
31-
toEncrypt.append(graphicsCard.getVendor()).append(graphicsCard.getName());
32-
}
33-
toEncrypt.append(hal.getComputerSystem().getBaseboard().getModel());
34-
toEncrypt.append(hal.getComputerSystem().getHardwareUUID());
35-
MessageDigest md = MessageDigest.getInstance("MD5");
36-
md.update(toEncrypt.toString().getBytes());
37-
StringBuilder hexString = new StringBuilder();
38-
39-
byte[] byteData = md.digest();
40-
41-
for (byte aByteData : byteData) {
42-
String hex = Integer.toHexString(0xff & aByteData);
43-
if (hex.length() == 1) hexString.append('0');
44-
hexString.append(hex);
45-
}
46-
47-
return hexString.toString();
48-
} catch (Exception e) {
49-
e.printStackTrace();
50-
return "Error";
51-
}
52-
}
5311

5412
public static boolean isABFree(Vec3d a, Vec3d b) {
5513
assert mc.player != null;
@@ -58,26 +16,4 @@ public static boolean isABFree(Vec3d a, Vec3d b) {
5816
BlockHitResult raycast = mc.world.raycast(rc);
5917
return raycast.getType() == HitResult.Type.MISS;
6018
}
61-
62-
public static Vec3d getRotationVector(float pitch, float yaw) {
63-
float f = pitch * 0.017453292F;
64-
float g = -yaw * 0.017453292F;
65-
float h = MathHelper.cos(g);
66-
float i = MathHelper.sin(g);
67-
float j = MathHelper.cos(f);
68-
float k = MathHelper.sin(f);
69-
return new Vec3d(i * j, -k, h * j);
70-
}
71-
72-
public static Block getBlock(BlockPos pos) {
73-
return mc.world.getBlockState(pos).getBlock();
74-
}
75-
76-
public static BlockPos getBlockPos(Vec3d vec) {
77-
return new BlockPos((int) vec.getX(), (int) vec.getY(), (int) vec.getZ());
78-
}
79-
80-
public static Vec3d getVec3(BlockPos blockPos) {
81-
return new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ());
82-
}
8319
}

0 commit comments

Comments
 (0)