Upload files to "src/openonyx/features/render"
This commit is contained in:
1 parent
15165f8ba3
commit
4fcb9ccb3f
5 files changed
+283
No files matched your search
@@ -0,0 +1,32 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.events.TargetType;
|
||||||
|
|
||||||
|
// $VF: synthetic class
|
||||||
|
class ChamsPart2 {
|
||||||
|
static {
|
||||||
|
int[] i = new int[TargetType.values().length];
|
||||||
|
boolean bl = true;
|
||||||
|
e = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetType.SELF.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError3) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetType.ENEMY.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetType.TEAM.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetType.MOBS.ordinal()] = 4;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.events.TargetType;
|
||||||
|
import openonyx.history.TabbedSettingGroup;
|
||||||
|
|
||||||
|
public final class ChamsPart3 extends TabbedSettingGroup {
|
||||||
|
public final ChamsPart mobs;
|
||||||
|
public final ChamsPart team;
|
||||||
|
public final ChamsPart enemy;
|
||||||
|
public final ChamsPart self = new ChamsPart("Self", false, -2562832, true);
|
||||||
|
|
||||||
|
private ChamsPart3() {
|
||||||
|
super("Targets", TargetType.e);
|
||||||
|
this.enemy = new ChamsPart("Enemy", true, -3910337, true);
|
||||||
|
this.team = new ChamsPart("Team", false, -8585312, false);
|
||||||
|
this.mobs = new ChamsPart("Mobs", false, -3105793, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChamsPart L(TargetType targetType) {
|
||||||
|
switch (targetType) {
|
||||||
|
case SELF:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.self;
|
||||||
|
case ENEMY:
|
||||||
|
return this.enemy;
|
||||||
|
case TEAM:
|
||||||
|
return this.team;
|
||||||
|
case MOBS:
|
||||||
|
return this.mobs;
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import openonyx.events.MovementRotation;
|
||||||
|
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.group_i.ChinaHatRenderer;
|
||||||
|
import openonyx.render.group_i.ChinaHatStyle;
|
||||||
|
import openonyx.render.group_i.HatColorMode;
|
||||||
|
import openonyx.render.group_i.HatPose;
|
||||||
|
|
||||||
|
public final class ChinaHat extends Module {
|
||||||
|
private static final float A = 1.5F;
|
||||||
|
private final ChinaHatRenderer chinaHatRenderer;
|
||||||
|
public NumberSetting trailLength;
|
||||||
|
public NumberSetting offset;
|
||||||
|
private float J;
|
||||||
|
public ColorSetting secondColor;
|
||||||
|
private static final float c = 0.22F;
|
||||||
|
private long a;
|
||||||
|
public NumberSetting colorSpeed;
|
||||||
|
public NumberSetting height;
|
||||||
|
public BooleanSetting glow;
|
||||||
|
private float L;
|
||||||
|
public BooleanSetting throughWalls;
|
||||||
|
public ColorSetting color;
|
||||||
|
public NumberSetting tilt;
|
||||||
|
public NumberSetting opacity;
|
||||||
|
public NumberSetting radius = new NumberSetting("Radius", 0.65, 0.2, 3.0, 0.05).describe("How wide the brim sits");
|
||||||
|
public EnumSetting<HatColorMode> colors;
|
||||||
|
private static final float i = (float) (Math.PI * 2);
|
||||||
|
public BooleanSetting trail;
|
||||||
|
private final List<HatPose> hatPoses;
|
||||||
|
public NumberSetting spinSpeed;
|
||||||
|
|
||||||
|
private void h() {
|
||||||
|
ChinaHat chinaHat1 = this;
|
||||||
|
long l = System.nanoTime();
|
||||||
|
if (chinaHat1.a == 0L) {
|
||||||
|
chinaHat1.a = l;
|
||||||
|
} else {
|
||||||
|
float f = Math.min((float)(l - chinaHat1.a) / 1.0E9F, 0.25F);
|
||||||
|
chinaHat1.a = l;
|
||||||
|
chinaHat1.L = (chinaHat1.L + (float)Math.toRadians(chinaHat1.spinSpeed.getValue()) * f) % (float) (Math.PI * 2);
|
||||||
|
chinaHat1.J = (chinaHat1.J + (float)Math.toRadians(chinaHat1.colorSpeed.getValue()) * f) % (float) (Math.PI * 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChinaHat() {
|
||||||
|
super("ChinaHat", "Floats a conical hat over your head", ModuleCategory.RENDER);
|
||||||
|
this.height = new NumberSetting("Height", 0.35, 0.05, 1.5, 0.05).describe("How tall the cone stands");
|
||||||
|
this.offset = new NumberSetting("Offset", -0.02, -0.5, 1.5, 0.02).describe("How far above the head the brim sits");
|
||||||
|
this.tilt = new NumberSetting("Tilt", 100.0, 0.0, 100.0, 5.0).withSuffix("%").describe("How much of the head's pitch the hat takes on");
|
||||||
|
this.colors = new EnumSetting<>("Colors", HatColorMode.STATIC).describe("Hold one colour, blend two around the hat, or walk the hue right round it");
|
||||||
|
this.color = new ColorSetting("Color", -10178561).D();
|
||||||
|
this.secondColor = new ColorSetting("Second color", -4949761)
|
||||||
|
.visibleWhen(this.colors, hatColorMode -> hatColorMode == HatColorMode.GRADIENT)
|
||||||
|
.describe("The colour the first one blends into");
|
||||||
|
this.colorSpeed = new NumberSetting("Color speed", 40.0, 0.0, 360.0, 5.0)
|
||||||
|
.withSuffix("°/s")
|
||||||
|
.visibleWhen(this.colors, hatColorMode -> hatColorMode != HatColorMode.STATIC)
|
||||||
|
.describe("How fast the colours travel around the hat - zero holds them still");
|
||||||
|
this.opacity = new NumberSetting("Opacity", 90.0, 5.0, 100.0, 1.0).withSuffix("%").describe("Overall opacity of the hat");
|
||||||
|
this.spinSpeed = new NumberSetting("Spin speed", 65.0, 0.0, 360.0, 5.0).withSuffix("°/s").describe("How fast the line travels around the hat");
|
||||||
|
this.glow = new BooleanSetting("Glow", true).describe("Soft halo right on the rim");
|
||||||
|
this.trail = new BooleanSetting("Trail", true).describe("Line sweeping around the hat, and the fading wake behind it");
|
||||||
|
this.trailLength = new NumberSetting("Trail length", 350.0, 20.0, 360.0, 10.0)
|
||||||
|
.withSuffix("°")
|
||||||
|
.describe("How far back the wake reaches")
|
||||||
|
.visibleWhen(this.trail);
|
||||||
|
this.throughWalls = new BooleanSetting("Through walls", false);
|
||||||
|
this.chinaHatRenderer = new ChinaHatRenderer();
|
||||||
|
this.hatPoses = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void d(float f) {
|
||||||
|
if (this.isEnabled() && mc.theWorld != null && mc.thePlayer != null) {
|
||||||
|
this.h();
|
||||||
|
this.hatPoses.clear();
|
||||||
|
if (mc.gameSettings.thirdPersonView != 0 && mc.thePlayer.isEntityAlive()) {
|
||||||
|
this.L(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chinaHatRenderer.L(f, this.hatPoses, this.L());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ChinaHatStyle L() {
|
||||||
|
return new ChinaHatStyle(
|
||||||
|
this.radius.getFloat(),
|
||||||
|
this.height.getFloat(),
|
||||||
|
this.colors.getValue(),
|
||||||
|
this.color.getOpaque(),
|
||||||
|
this.secondColor.getOpaque(),
|
||||||
|
this.J,
|
||||||
|
this.opacity.getFloat() / 100.0F,
|
||||||
|
this.glow.isEnabled(),
|
||||||
|
this.trail.isEnabled(),
|
||||||
|
(float)Math.toRadians(this.trailLength.getValue()),
|
||||||
|
this.L,
|
||||||
|
this.throughWalls.isEnabled()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEnable() {
|
||||||
|
this.a = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float d(float f) {
|
||||||
|
return MovementRotation.L(mc.thePlayer)
|
||||||
|
? MovementRotation.d(f)
|
||||||
|
: mc.thePlayer.prevRotationYawHead + MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYawHead - mc.thePlayer.prevRotationYawHead) * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(float f) {
|
||||||
|
return MovementRotation.L(mc.thePlayer)
|
||||||
|
? MovementRotation.L(f)
|
||||||
|
: mc.thePlayer.prevRotationPitch + MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationPitch - mc.thePlayer.prevRotationPitch) * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(float f) {
|
||||||
|
ChinaHat chinaHat1 = this;
|
||||||
|
EntityPlayerSP entityPlayerSP = mc.thePlayer;
|
||||||
|
double d = mc.thePlayer.prevPosY + (entityPlayerSP.posY - entityPlayerSP.prevPosY) * f + 1.5;
|
||||||
|
if (entityPlayerSP.isSneaking()) {
|
||||||
|
d -= 0.22F;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vec3 vec3 = new Vec3(
|
||||||
|
entityPlayerSP.prevPosX + (entityPlayerSP.posX - entityPlayerSP.prevPosX) * f,
|
||||||
|
d,
|
||||||
|
entityPlayerSP.prevPosZ + (entityPlayerSP.posZ - entityPlayerSP.prevPosZ) * f
|
||||||
|
);
|
||||||
|
float g = entityPlayerSP.height + chinaHat1.offset.getFloat() - 1.5F;
|
||||||
|
chinaHat1.hatPoses.add(new HatPose(vec3, g, chinaHat1.d(f), chinaHat1.L(f) * (chinaHat1.tilt.getFloat() / 100.0F), 0.0F));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.hatPoses.clear();
|
||||||
|
this.chinaHatRenderer.d();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
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.NumberSetting;
|
||||||
|
import openonyx.theme.ThemeManager;
|
||||||
|
import openonyx.ui.ClickGuiScreen;
|
||||||
|
|
||||||
|
public class ClickGUI extends Module {
|
||||||
|
public ColorSetting accent = new ColorSetting("Accent", -10006364)
|
||||||
|
.d()
|
||||||
|
.describe("Seed colour the whole theme is generated from")
|
||||||
|
.onChange(ThemeManager::setAccentColor);
|
||||||
|
public NumberSetting backgroundTint = new NumberSetting("Background tint", 25.0, 0.0, 100.0, 5.0)
|
||||||
|
.withSuffix("%")
|
||||||
|
.describe("How much the accent colours the panel background")
|
||||||
|
.onChange(double_ -> ThemeManager.d(double_.floatValue() / 100.0F));
|
||||||
|
public NumberSetting scale = new NumberSetting("Scale", 1.0, 0.5, 1.5, 0.05)
|
||||||
|
.withSuffix("x")
|
||||||
|
.describe("Interface size")
|
||||||
|
.onChange(double_ -> ThemeManager.setUiScale(double_.floatValue()));
|
||||||
|
public BooleanSetting frostedGlass = new BooleanSetting("Frosted glass", true).describe("Blur the world behind the panel instead of the whole screen");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean D() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEnable() {
|
||||||
|
if (!(mc.currentScreen instanceof ClickGuiScreen)) {
|
||||||
|
mc.displayGuiScreen(new ClickGuiScreen(this, mc.currentScreen));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean i() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClickGUI() {
|
||||||
|
super("ClickGUI", "Opens click GUI", ModuleCategory.RENDER);
|
||||||
|
this.getBind().setValue(54);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
public enum ColorMode {
|
||||||
|
RAINBOW,
|
||||||
|
ACCENT,
|
||||||
|
CUSTOM;
|
||||||
|
|
||||||
|
private static ColorMode[] L() {
|
||||||
|
ColorMode[] colorModes = new ColorMode[3];
|
||||||
|
boolean bl = true;
|
||||||
|
colorModes[0] = RAINBOW;
|
||||||
|
colorModes[1] = ACCENT;
|
||||||
|
colorModes[2] = CUSTOM;
|
||||||
|
return colorModes;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user