Upload files to "src/openonyx/features/render"
This commit is contained in:
1 parent
4fcb9ccb3f
commit
f809352c54
5 files changed
+293
No files matched your search
@@ -0,0 +1,95 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.tileentity.TileEntityEnderChest;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.tileentity.TileEntityHopper;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import openonyx.features.Module;
|
||||
import openonyx.features.ModuleCategory;
|
||||
import openonyx.history.internal.BooleanSetting;
|
||||
import openonyx.history.internal.NumberSetting;
|
||||
import openonyx.render.BoxRenderer;
|
||||
import openonyx.theme.internal.ColorUtils;
|
||||
|
||||
public final class ContainerESP extends Module {
|
||||
public final BooleanSetting enderChests;
|
||||
public final BooleanSetting throughWalls;
|
||||
public final BooleanSetting fill;
|
||||
public final BooleanSetting hoppers;
|
||||
public final NumberSetting lineWidth;
|
||||
public final BooleanSetting chests = new BooleanSetting("Chests", true);
|
||||
public final BooleanSetting furnaces;
|
||||
|
||||
public void L(float f) {
|
||||
ContainerESP containerESP1 = this;
|
||||
if (containerESP1.isEnabled() && mc.theWorld != null) {
|
||||
ArrayList arrayList = new ArrayList<>(mc.theWorld.loadedTileEntityList);
|
||||
boolean bl = false;
|
||||
Iterator iterator;
|
||||
Iterator iterator1 = iterator = arrayList.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
TileEntity tileEntity = (TileEntity)iterator.next();
|
||||
int i;
|
||||
if ((i = containerESP1.L(tileEntity)) == 0) {
|
||||
iterator1 = iterator;
|
||||
} else {
|
||||
if (!bl) {
|
||||
if (!BoxRenderer.L(f, containerESP1.throughWalls.isEnabled())) {
|
||||
return;
|
||||
}
|
||||
|
||||
bl = true;
|
||||
}
|
||||
|
||||
BlockPos blockPos;
|
||||
BoxRenderer.L(
|
||||
AxisAlignedBB.fromBounds(
|
||||
(blockPos = tileEntity.getPos()).getX() - 0.003,
|
||||
blockPos.getY() - 0.003,
|
||||
blockPos.getZ() - 0.003,
|
||||
blockPos.getX() + 1.003,
|
||||
blockPos.getY() + 1.003,
|
||||
blockPos.getZ() + 1.003
|
||||
),
|
||||
ColorUtils.withAlpha(i, 0.95F),
|
||||
containerESP1.lineWidth.getFloat(),
|
||||
ColorUtils.withAlpha(i, containerESP1.fill.isEnabled() ? 0.14F : 0.0F)
|
||||
);
|
||||
iterator1 = iterator;
|
||||
}
|
||||
}
|
||||
|
||||
if (bl) {
|
||||
BoxRenderer.L();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int L(TileEntity tileEntity) {
|
||||
if (tileEntity instanceof TileEntityChest && this.chests.isEnabled()) {
|
||||
return -19673;
|
||||
} else if (tileEntity instanceof TileEntityEnderChest && this.enderChests.isEnabled()) {
|
||||
return -7055617;
|
||||
} else if (tileEntity instanceof TileEntityHopper && this.hoppers.isEnabled()) {
|
||||
return -8947070;
|
||||
} else {
|
||||
return tileEntity instanceof TileEntityFurnace && this.furnaces.isEnabled() ? -3092272 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
public ContainerESP() {
|
||||
super("ContainerESP", "Highlights storage blocks", ModuleCategory.RENDER);
|
||||
this.enderChests = new BooleanSetting("Ender chests", false);
|
||||
this.hoppers = new BooleanSetting("Hoppers", false);
|
||||
this.furnaces = new BooleanSetting("Furnaces", false);
|
||||
this.fill = new BooleanSetting("Fill", true);
|
||||
this.throughWalls = new BooleanSetting("Through walls", true);
|
||||
this.lineWidth = new NumberSetting("Line width", 1.5, 0.5, 5.0, 0.5).withSuffix(" px");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.features.Module;
|
||||
import openonyx.features.ModuleCategory;
|
||||
import openonyx.history.internal.BooleanSetting;
|
||||
import openonyx.history.internal.ColorSetting;
|
||||
import openonyx.history.internal.EnumSetting;
|
||||
import openonyx.history.internal.NumberSetting;
|
||||
import openonyx.render.Render2D;
|
||||
import openonyx.theme.ThemeManager;
|
||||
import openonyx.theme.internal.ColorUtils;
|
||||
|
||||
public class Crosshair extends Module {
|
||||
public BooleanSetting centerDot;
|
||||
public EnumSetting<ColorMode> color;
|
||||
private float M;
|
||||
public BooleanSetting pulse;
|
||||
private boolean j;
|
||||
public NumberSetting follow;
|
||||
public NumberSetting size = new NumberSetting("Size", 5.0, 2.0, 16.0, 0.5).withSuffix("px").describe("Radius of the ring");
|
||||
private float l;
|
||||
private float I;
|
||||
private float d;
|
||||
public ColorSetting customColour;
|
||||
private long f;
|
||||
public NumberSetting thickness = new NumberSetting("Thickness", 1.5, 0.5, 4.0, 0.25).withSuffix("px");
|
||||
private static final long e = System.nanoTime();
|
||||
|
||||
private int L(float f) {
|
||||
switch ((ColorMode)this.color.getValue()) {
|
||||
case RAINBOW:
|
||||
while (false) {
|
||||
}
|
||||
|
||||
return ColorUtils.hsvToArgb(fx * 60.0F % 360.0F, 0.75F, 1.0F, 255);
|
||||
case ACCENT:
|
||||
return ThemeManager.getPalette().primary() | 0xFF000000;
|
||||
case CUSTOM:
|
||||
return this.customColour.getValue();
|
||||
default:
|
||||
throw new MatchException(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public Crosshair() {
|
||||
super("Crosshair", "Animated dynamic crosshair", ModuleCategory.RENDER);
|
||||
this.centerDot = new BooleanSetting("Center dot", true);
|
||||
this.color = new EnumSetting<>("Color", ColorMode.ACCENT).describe("Rainbow shimmer, the global accent, or a fixed colour");
|
||||
this.customColour = new ColorSetting("Custom colour", -1).L().visibleWhen(() -> this.color.is(ColorMode.CUSTOM));
|
||||
this.follow = new NumberSetting("Follow", 40.0, 0.0, 100.0, 5.0).withSuffix("%").describe("How much the crosshair drifts with view movement");
|
||||
this.pulse = new BooleanSetting("Pulse", true).describe("Breathe with the idle animation");
|
||||
}
|
||||
|
||||
public void L(Render2D render2D, float f, float g) {
|
||||
Crosshair crosshair1 = this;
|
||||
float h = crosshair1.L();
|
||||
float jx = (float)(System.nanoTime() - e) / 1.0E9F;
|
||||
crosshair1.L(h);
|
||||
fx = fx / 2.0F + crosshair1.d;
|
||||
g = g / 2.0F + crosshair1.M;
|
||||
h = crosshair1.pulse.isEnabled() ? crosshair1.d(jx) : 1.0F;
|
||||
h = crosshair1.size.getFloat() * h;
|
||||
float i = crosshair1.thickness.getFloat();
|
||||
int k = crosshair1.L(jx);
|
||||
render2D.L(fx, g, h, i, k);
|
||||
if (crosshair1.centerDot.isEnabled()) {
|
||||
render2D.circle(fx, g, Math.max(i * 0.9F, 0.75F), k);
|
||||
}
|
||||
}
|
||||
|
||||
private float L() {
|
||||
Crosshair crosshair1 = this;
|
||||
long lx = System.nanoTime();
|
||||
float fx = crosshair1.f == 0L ? 16.0F : Math.min((float)(lx - crosshair1.f) / 1000000.0F, 100.0F);
|
||||
crosshair1.f = lx;
|
||||
return fx;
|
||||
}
|
||||
|
||||
private float d(float f) {
|
||||
return 1.0F + 0.05F * (float)Math.sin(fx * 2.2F);
|
||||
}
|
||||
|
||||
public boolean I() {
|
||||
return this.isEnabled() && mc.thePlayer != null && mc.gameSettings.thirdPersonView == 0;
|
||||
}
|
||||
|
||||
private static float L(float f) {
|
||||
float g = fx;
|
||||
if ((fx = g % 360.0F) >= 180.0F) {
|
||||
fx -= 360.0F;
|
||||
}
|
||||
|
||||
if (fx < -180.0F) {
|
||||
fx += 360.0F;
|
||||
}
|
||||
|
||||
return fx;
|
||||
}
|
||||
|
||||
private void L(float f) {
|
||||
Crosshair crosshair1 = this;
|
||||
float g = mc.thePlayer.rotationYaw;
|
||||
float jx = mc.thePlayer.rotationPitch;
|
||||
if (!crosshair1.j) {
|
||||
crosshair1.j = true;
|
||||
crosshair1.I = g;
|
||||
crosshair1.l = jx;
|
||||
}
|
||||
|
||||
float h = L(g - crosshair1.I);
|
||||
float i = jx - crosshair1.l;
|
||||
crosshair1.I = g;
|
||||
crosshair1.l = jx;
|
||||
g = crosshair1.follow.getFloat() / 100.0F * 1.1F;
|
||||
float k = crosshair1.size.getFloat() * 2.0F;
|
||||
h = Math.clamp(-h * g, -k, k);
|
||||
g = Math.clamp(-i * g, -k, k);
|
||||
fx = 1.0F - (float)Math.exp(-fx / 70.0F);
|
||||
crosshair1.d = crosshair1.d + (h - crosshair1.d) * fx;
|
||||
crosshair1.M = crosshair1.M + (g - crosshair1.M) * fx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.history.DisplayNamed;
|
||||
|
||||
public enum CurveMode implements DisplayNamed {
|
||||
SQRT("Square root"),
|
||||
EASE_OUT("Ease out"),
|
||||
LINEAR("Linear"),
|
||||
SMOOTH("Smooth"),
|
||||
SIN("Sin");
|
||||
|
||||
private final String f;
|
||||
|
||||
private static CurveMode[] L() {
|
||||
CurveMode[] curveModes = new CurveMode[5];
|
||||
boolean bl = true;
|
||||
curveModes[0] = LINEAR;
|
||||
curveModes[1] = SMOOTH;
|
||||
curveModes[2] = EASE_OUT;
|
||||
curveModes[3] = SIN;
|
||||
curveModes[4] = SQRT;
|
||||
return curveModes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
CurveMode(String string1) {
|
||||
this.f = string1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
public enum DesignMode {
|
||||
CHEVRON,
|
||||
OUTLINE,
|
||||
SOLID;
|
||||
|
||||
private static DesignMode[] L() {
|
||||
DesignMode[] designModes = new DesignMode[3];
|
||||
boolean bl = true;
|
||||
designModes[0] = OUTLINE;
|
||||
designModes[1] = SOLID;
|
||||
designModes[2] = CHEVRON;
|
||||
return designModes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.history.DisplayNamed;
|
||||
|
||||
public enum DirectionMode implements DisplayNamed {
|
||||
UP("Bottom to top"),
|
||||
DOWN("Top to bottom");
|
||||
|
||||
private final String H;
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.H;
|
||||
}
|
||||
|
||||
private static DirectionMode[] L() {
|
||||
DirectionMode[] directionModes = new DirectionMode[2];
|
||||
boolean bl = true;
|
||||
directionModes[0] = DOWN;
|
||||
directionModes[1] = UP;
|
||||
return directionModes;
|
||||
}
|
||||
|
||||
DirectionMode(String string1) {
|
||||
this.H = string1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user