Upload files to "src/openonyx/features/render"
This commit is contained in:
1 parent
61620a8f25
commit
aca9e5708f
5 files changed
+199
No files matched your search
@@ -0,0 +1,27 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum SpawnAtMode implements DisplayNamed {
|
||||||
|
ATTACK("Attack"),
|
||||||
|
WALKING("Walking");
|
||||||
|
|
||||||
|
private final String H;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.H;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpawnAtMode(String string1) {
|
||||||
|
this.H = string1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SpawnAtMode[] L() {
|
||||||
|
SpawnAtMode[] spawnAtModes = new SpawnAtMode[2];
|
||||||
|
boolean bl = true;
|
||||||
|
spawnAtModes[0] = ATTACK;
|
||||||
|
spawnAtModes[1] = WALKING;
|
||||||
|
return spawnAtModes;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum StartMode implements DisplayNamed {
|
||||||
|
MIDDLE("Middle", 0.0F),
|
||||||
|
FEET("Feet", -90.0F),
|
||||||
|
HEAD("Head", 90.0F);
|
||||||
|
|
||||||
|
private final float H;
|
||||||
|
private final String e;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.e;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static StartMode[] L() {
|
||||||
|
StartMode[] startModes = new StartMode[3];
|
||||||
|
boolean bl = true;
|
||||||
|
startModes[0] = FEET;
|
||||||
|
startModes[1] = MIDDLE;
|
||||||
|
startModes[2] = HEAD;
|
||||||
|
return startModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
StartMode(String string1, float f) {
|
||||||
|
this.e = string1;
|
||||||
|
this.H = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float L() {
|
||||||
|
return this.H;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum Style implements DisplayNamed {
|
||||||
|
OUTLINE("Outline"),
|
||||||
|
FILLED("Outline + fill");
|
||||||
|
|
||||||
|
private final String e;
|
||||||
|
|
||||||
|
Style(String string1) {
|
||||||
|
this.e = string1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Style[] L() {
|
||||||
|
Style[] styles = new Style[2];
|
||||||
|
boolean bl = true;
|
||||||
|
styles[0] = OUTLINE;
|
||||||
|
styles[1] = FILLED;
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.e;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.history.SettingSection;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.EnumSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
|
||||||
|
public final class SwingAnimation extends SettingSection {
|
||||||
|
public final BooleanSetting swordsOnly = new BooleanSetting("Swords only", false);
|
||||||
|
public final NumberSetting positionX;
|
||||||
|
public final EnumSetting<CurveMode> curve;
|
||||||
|
public final NumberSetting rotationZ;
|
||||||
|
public final NumberSetting positionZ;
|
||||||
|
public final NumberSetting scaleZ;
|
||||||
|
public final NumberSetting scaleY;
|
||||||
|
public final NumberSetting strength;
|
||||||
|
public final NumberSetting positionY;
|
||||||
|
public final NumberSetting rotationX;
|
||||||
|
public final BooleanSetting matchVanilla;
|
||||||
|
public final NumberSetting rotationY;
|
||||||
|
public final NumberSetting scaleX;
|
||||||
|
public final NumberSetting speed;
|
||||||
|
public final BooleanSetting replaceVanillaSwing = new BooleanSetting("Replace vanilla swing", true);
|
||||||
|
|
||||||
|
private NumberSetting d(String string) {
|
||||||
|
return new NumberSetting(string, 1.0, 0.1, 3.0, 0.01);
|
||||||
|
}
|
||||||
|
|
||||||
|
private NumberSetting L(String string, double d) {
|
||||||
|
return new NumberSetting(string, d, -720.0, 720.0, 1.0).withSuffix("deg");
|
||||||
|
}
|
||||||
|
|
||||||
|
private SwingAnimation() {
|
||||||
|
super("Animation", true);
|
||||||
|
this.matchVanilla = new BooleanSetting("Match vanilla", false).describe("Uses vanilla's own swing motion instead of the curve below");
|
||||||
|
this.strength = new NumberSetting("Strength", 100.0, 0.0, 200.0, 5.0).withSuffix("%");
|
||||||
|
this.curve = new EnumSetting<>("Curve", CurveMode.SMOOTH);
|
||||||
|
this.speed = new NumberSetting("Speed", 1.0, 0.1, 5.0, 0.05).withSuffix("x");
|
||||||
|
this.positionX = this.describe("Animation X");
|
||||||
|
this.positionY = this.describe("Animation Y");
|
||||||
|
this.positionZ = this.describe("Animation Z");
|
||||||
|
this.rotationX = this.L("Animation rotation X", -51.0);
|
||||||
|
this.rotationY = this.L("Animation rotation Y", 0.0);
|
||||||
|
this.rotationZ = this.L("Animation rotation Z", 0.0);
|
||||||
|
this.scaleX = this.d("Animation scale X");
|
||||||
|
this.scaleY = this.d("Animation scale Y");
|
||||||
|
this.scaleZ = this.d("Animation scale Z");
|
||||||
|
}
|
||||||
|
|
||||||
|
private NumberSetting describe(String string) {
|
||||||
|
return new NumberSetting(string, 0.0, -2.0, 2.0, 0.01);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
final class SwingTimer {
|
||||||
|
private float d;
|
||||||
|
private long i;
|
||||||
|
private long f = -1L;
|
||||||
|
private static final float H = 1.0E-4F;
|
||||||
|
private long e;
|
||||||
|
|
||||||
|
private void d() {
|
||||||
|
this.f = -1L;
|
||||||
|
this.i = 300000000L;
|
||||||
|
this.d = 0.0F;
|
||||||
|
this.e = -1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SwingTimer() {
|
||||||
|
this.i = 300000000L;
|
||||||
|
this.e = -1L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(float f, long l) {
|
||||||
|
long m = System.nanoTime();
|
||||||
|
boolean bl = fx > 1.0E-4F && (this.d <= 1.0E-4F || fx + 1.0E-4F < this.d);
|
||||||
|
this.d = fx;
|
||||||
|
if (bl) {
|
||||||
|
this.f = m;
|
||||||
|
this.i = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.f < 0L) {
|
||||||
|
return 0.0F;
|
||||||
|
} else if ((fx = (float)(m - this.f) / (float)this.i) >= 1.0F) {
|
||||||
|
this.f = -1L;
|
||||||
|
return 0.0F;
|
||||||
|
} else {
|
||||||
|
return Math.clamp(fx, 0.0F, 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static long L(long l, float f) {
|
||||||
|
return Math.max(1L, (long)((float)l / Math.max(fx, 0.01F)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(long l) {
|
||||||
|
long m = System.nanoTime();
|
||||||
|
if (this.e < 0L) {
|
||||||
|
this.e = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (float)((m - this.e) % l) / (float)l;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L() {
|
||||||
|
this.e = -1L;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user