Upload files to "src/openonyx/utilities"

This commit is contained in:
winterflyt committed 2026-11-30 06:19:14 +02:00
1 parent 9040c85bb4
commit 19951e7e54
4 files changed
+269

No files matched your search

@@ -0,0 +1,5 @@
package openonyx.utilities;
public interface RotationRequester {
boolean isToggled();
}
+76
View File
@@ -0,0 +1,76 @@
package openonyx.utilities;
public class Timer {
private long time;
public void setTime(long l) {
this.time = l;
}
public long elapsed() {
return System.currentTimeMillis() - this.time;
}
public static String decrypt(String string) {
String string1 = string;
int k = --5 << 3 ^ 1;
String string2;
int n = (string2 = string1).length();
char[] e = new char[n];
boolean bl = true;
int i;
int m = i = n - 1;
char[] c = e;
byte d = 110;
k = m;
byte b = 106;
while (k >= 0) {
int l = i;
int j = string2.charAt(i);
i--;
c[l] = (char)(j ^ b);
if (i < 0) {
break;
}
j = i--;
c[j] = (char)(string2.charAt(j) ^ d);
k = i;
}
return new String(c);
}
public void extend(long l) {
this.time = Math.max(this.time, System.currentTimeMillis() + l);
}
public void reset() {
this.setTime(System.currentTimeMillis());
}
public boolean hasReached(long l) {
return this.time + l <= System.currentTimeMillis();
}
public boolean hasElapsed(long l) {
return this.time + l < System.currentTimeMillis();
}
public long since(long l) {
return l - this.time;
}
public Timer() {
this(0L);
}
public Timer(long l) {
this.time = l;
}
public boolean isReady() {
return this.hasElapsed(0L);
}
}
@@ -0,0 +1,46 @@
package openonyx.utilities;
public final class UtilitySupport_476 {
public static final int l = -500;
public static final int I = -50;
public static final int d = -10;
public static final int i = -100;
public static final int f = 500;
public static final int H = 1000;
public static final int e = -1000;
private UtilitySupport_476() {
}
public static String decrypt(String string) {
String string1 = string;
int m = --2 << 3 ^ 3;
int o = 4 << 4 ^ 6;
String string2;
int p = (string2 = string1).length();
char[] dx = new char[p];
boolean bl = true;
int j;
int k = j = p - 1;
char[] c = dx;
int ix = o;
m = k;
byte b = 112;
while (m >= 0) {
int n = j;
int lx = string2.charAt(j);
j--;
c[n] = (char)(lx ^ b);
if (j < 0) {
break;
}
lx = j--;
c[lx] = (char)(string2.charAt(lx) ^ ix);
m = j;
}
return new String(c);
}
}
+142
View File
@@ -0,0 +1,142 @@
package openonyx.utilities;
import java.util.Iterator;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.Vec3;
import net.minecraft.util.Vec3i;
public class VecUtils {
public static double L(Vec3 vec3, double d, double e, double f) {
return vec3.xCoord * d + vec3.yCoord * e + vec3.zCoord * f;
}
public static double d(Vec3 vec3, Vec3 vec31) {
return d(vec3, vec31.xCoord, vec31.zCoord);
}
public static Vec3 d(Vec3 vec3, double d, double e, double f) {
return vec3.multiply(d, e, f);
}
public static Vec3 i(Vec3 vec3, double d) {
return new Vec3(vec3.xCoord, d, vec3.zCoord);
}
public static boolean L(Vec3 vec3, double d) {
return Math.abs(vec3.lengthSqr() - 1.0) < d;
}
public static Vec3 D(Vec3i vec3i) {
return Vec3.upFromBottomCenterOf(vec3i, 1.0);
}
public static BlockPos L(Vec3 vec3, double d, double e, double f) {
return new BlockPos(Math.floor(vec3.xCoord + d), Math.floor(vec3.yCoord + e), Math.floor(vec3.zCoord + f));
}
public static double d(Vec3 vec3, double d, double e) {
return Math.sqrt(L(vec3, d, e));
}
private static boolean L(double d) {
return Math.abs(d) < 1.0E-5;
}
public static double L(Vec3 vec3) {
return Math.atan2(-vec3.xCoord, vec3.zCoord) * (180.0 / Math.PI);
}
public static Vec3 L(Iterable<Vec3> iterable) {
Iterable iterable1 = iterable;
double d = 0.0;
double e = 0.0;
double f = 0.0;
int i = 0;
Iterator iterator;
for (Iterator iterator1 = iterator = iterable1.iterator(); iterator1.hasNext(); iterator1 = iterator) {
Vec3 vec3 = (Vec3)iterator.next();
d += vec3.xCoord;
e += vec3.yCoord;
i++;
f += vec3.zCoord;
}
return new Vec3(d / i, e / i, f / i);
}
public static Vec3 D(Vec3 vec3, double d) {
double e;
return L(e = vec3.lengthSqr()) ? Vec3.ZERO : vec3.scale(d / Math.sqrt(e));
}
public static Vec3 L(Vec3 vec3, double d, Vec3 vec31) {
return new Vec3(Math.fma(d, vec31.xCoord, vec3.xCoord), Math.fma(d, vec31.yCoord, vec3.yCoord), Math.fma(d, vec31.zCoord, vec3.zCoord));
}
public static double L(Vec3 vec3, Vec3 vec31) {
return L(vec3, vec31.xCoord, vec31.zCoord);
}
public static Vec3 d(Vec3i vec3i) {
return Vec3.atBottomCenterOf(vec3i);
}
public static Vec3 L(Vec3i vec3i) {
return Vec3.atCenterOf(vec3i);
}
public static long L(Vec3i vec3i) {
long l = vec3i.getX();
long m = vec3i.getY();
long n = vec3i.getZ();
return l * l + m * m + n * n;
}
public static BlockPos L(Vec3 vec3) {
return new BlockPos(Math.floor(vec3.xCoord), Math.floor(vec3.yCoord), Math.floor(vec3.zCoord));
}
public static Vec3 d(Vec3 vec3, double d) {
return new Vec3(vec3.xCoord, vec3.yCoord, d);
}
public static Vec3 L(Vec3 vec3, double d) {
return new Vec3(d, vec3.yCoord, vec3.zCoord);
}
public static boolean d(Vec3 vec3) {
return L(vec3.lengthSqr());
}
public static Vec3 L(Vec3i vec3i, double d) {
return Vec3.upFromBottomCenterOf(vec3i, d);
}
public static AxisAlignedBB L(Vec3 vec3, double d) {
return new AxisAlignedBB(vec3.xCoord - d, vec3.yCoord - d, vec3.zCoord - d, vec3.xCoord + d, vec3.yCoord + d, vec3.zCoord + d);
}
public static Vec3 L(Vec3 vec3, double d, double e, double f) {
return new Vec3(d, e, f);
}
public static double L(Vec3 vec3, double d, double e) {
d = vec3.xCoord - d;
e = vec3.zCoord - e;
return d * d + e * e;
}
public static boolean L(Vec3 vec3) {
return L(vec3, 1.0E-4);
}
public static double L(Vec3 vec3, Vec3i vec3i) {
return L(vec3, vec3i.getX(), vec3i.getZ());
}
public static Vec3 L(Vec3 vec3) {
return L(vec3) ? vec3 : vec3.normalize();
}
}