Upload files to "src/openonyx/features/render"
This commit is contained in:
1 parent
841c7ed6de
commit
b8d038597f
4 files changed
+286
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
enum TrajectoriesMode {
|
||||||
|
POTION(0.5F, 0.05, -20.0F),
|
||||||
|
PEARL(1.5F, 0.03, 0.0F),
|
||||||
|
ARROW(0.0F, 0.05, 0.0F),
|
||||||
|
SNOWBALL(1.5F, 0.03, 0.0F);
|
||||||
|
|
||||||
|
private final double l;
|
||||||
|
private final float f;
|
||||||
|
private final float H;
|
||||||
|
|
||||||
|
float d() {
|
||||||
|
return this.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
double L() {
|
||||||
|
return this.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TrajectoriesMode[] L() {
|
||||||
|
TrajectoriesMode[] trajectoriesModes = new TrajectoriesMode[4];
|
||||||
|
boolean bl = true;
|
||||||
|
trajectoriesModes[0] = PEARL;
|
||||||
|
trajectoriesModes[1] = SNOWBALL;
|
||||||
|
trajectoriesModes[2] = POTION;
|
||||||
|
trajectoriesModes[3] = ARROW;
|
||||||
|
return trajectoriesModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
TrajectoriesMode(float f, double d, float g) {
|
||||||
|
this.f = fx;
|
||||||
|
this.l = d;
|
||||||
|
this.H = g;
|
||||||
|
}
|
||||||
|
|
||||||
|
float L() {
|
||||||
|
return this.H;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.history.SettingGroup;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
|
||||||
|
public final class TrajectoriesPart extends SettingGroup {
|
||||||
|
public final BooleanSetting splashPotions;
|
||||||
|
public final BooleanSetting snowballsAndEggs;
|
||||||
|
public final BooleanSetting bows;
|
||||||
|
public final BooleanSetting stopAtEntities;
|
||||||
|
public final BooleanSetting enderPearls = new BooleanSetting("Ender pearls", true);
|
||||||
|
|
||||||
|
private TrajectoriesPart() {
|
||||||
|
super("Projectiles");
|
||||||
|
this.snowballsAndEggs = new BooleanSetting("Snowballs and eggs", true);
|
||||||
|
this.splashPotions = new BooleanSetting("Splash potions", true);
|
||||||
|
this.bows = new BooleanSetting("Bows", true);
|
||||||
|
this.stopAtEntities = new BooleanSetting("Stop at entities", true).describe("End the path where it would hit a player or mob");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
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.MultiSelectSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.render.internal.RenderSupport_174;
|
||||||
|
import openonyx.render.internal.WingInstance;
|
||||||
|
import openonyx.render.internal.WingStyle;
|
||||||
|
import openonyx.render.internal.WingsRenderer;
|
||||||
|
import openonyx.render.internal.WingsStyle;
|
||||||
|
|
||||||
|
public final class Wings extends Module {
|
||||||
|
private final List<WingInstance> wingInstances;
|
||||||
|
public NumberSetting angle;
|
||||||
|
public EnumSetting<FillMode> fill;
|
||||||
|
private static final float k = 1.5F;
|
||||||
|
public ColorSetting color;
|
||||||
|
public NumberSetting height;
|
||||||
|
public EnumSetting<WingStyle> wingType = new EnumSetting<>("Wing type", WingStyle.INSTANCE8).describe("Silhouette the wings are cut from");
|
||||||
|
public NumberSetting flapSpeed;
|
||||||
|
public MultiSelectSetting<TargetsMode> targets;
|
||||||
|
public NumberSetting depth;
|
||||||
|
public BooleanSetting throughWalls;
|
||||||
|
public NumberSetting scale;
|
||||||
|
private final WingsRenderer wingsRenderer;
|
||||||
|
public BooleanSetting flapping;
|
||||||
|
public NumberSetting opacity;
|
||||||
|
public NumberSetting flapStrength;
|
||||||
|
private static final float e = 0.15F;
|
||||||
|
|
||||||
|
private float L(EntityPlayer entityPlayer, float f) {
|
||||||
|
return entityPlayer == mc.thePlayer && MovementRotation.L(entityPlayer)
|
||||||
|
? MovementRotation.D(f)
|
||||||
|
: entityPlayer.prevRenderYawOffset + MathHelper.wrapAngleTo180_float(entityPlayer.renderYawOffset - entityPlayer.prevRenderYawOffset) * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Wings() {
|
||||||
|
super("Wings", "Draws a pair of wings on player backs", ModuleCategory.RENDER);
|
||||||
|
this.fill = new EnumSetting<>("Fill", FillMode.SHADER).describe("Flat colour, or an animated aurora inside the membrane");
|
||||||
|
TargetsMode[] targetsModes = new TargetsMode[1];
|
||||||
|
boolean bl = true;
|
||||||
|
targetsModes[0] = TargetsMode.SELF;
|
||||||
|
this.targets = new MultiSelectSetting<>("Targets", TargetsMode.class, targetsModes).describe("Who the wings are drawn on");
|
||||||
|
this.scale = new NumberSetting("Scale", 1.0, 0.3, 3.0, 0.1).withSuffix("x");
|
||||||
|
this.angle = new NumberSetting("Angle", 20.0, 0.0, 90.0, 1.0).withSuffix("°").describe("How far the wings sweep back from the shoulders");
|
||||||
|
this.height = new NumberSetting("Height", 1.5, 0.8, 2.5, 0.05).describe("How high on the back the wings sit");
|
||||||
|
this.depth = new NumberSetting("Depth", 0.15F, 0.0, 0.5, 0.01).describe("How far the wings stand off the back");
|
||||||
|
this.flapping = new BooleanSetting("Flapping", true);
|
||||||
|
this.flapStrength = new NumberSetting("Flap strength", 30.0, 5.0, 60.0, 1.0).describe("How far the wings swing on every beat").visibleWhen(this.flapping);
|
||||||
|
this.flapSpeed = new NumberSetting("Flap speed", 3.0, 0.5, 8.0, 0.5).describe("How quickly the wings beat").visibleWhen(this.flapping);
|
||||||
|
this.throughWalls = new BooleanSetting("Through walls", false);
|
||||||
|
this.color = new ColorSetting("Color", -1).D();
|
||||||
|
this.opacity = new NumberSetting("Opacity", 100.0, 5.0, 100.0, 1.0).withSuffix("%").describe("Overall opacity of the wings");
|
||||||
|
this.wingsRenderer = new WingsRenderer();
|
||||||
|
this.wingInstances = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(EntityPlayer entityPlayer, float f) {
|
||||||
|
RenderSupport_174 renderSupport_174;
|
||||||
|
if ((renderSupport_174 = this.d(entityPlayer)) != null) {
|
||||||
|
Vec3 vec3 = new Vec3(
|
||||||
|
entityPlayer.prevPosX + (entityPlayer.posX - entityPlayer.prevPosX) * f,
|
||||||
|
entityPlayer.prevPosY + (entityPlayer.posY - entityPlayer.prevPosY) * f,
|
||||||
|
entityPlayer.prevPosZ + (entityPlayer.posZ - entityPlayer.prevPosZ) * f
|
||||||
|
);
|
||||||
|
this.wingInstances
|
||||||
|
.add(new WingInstance(vec3, this.L(entityPlayer, f), this.L(entityPlayer, renderSupport_174, f), this.wingType.getValue(), renderSupport_174));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private WingsStyle L() {
|
||||||
|
return new WingsStyle(
|
||||||
|
this.fill.is(FillMode.SHADER),
|
||||||
|
this.scale.getFloat(),
|
||||||
|
this.height.getFloat() - 1.5F,
|
||||||
|
this.depth.getFloat() - 0.15F,
|
||||||
|
this.throughWalls.isEnabled(),
|
||||||
|
this.color.getOpaque(),
|
||||||
|
this.opacity.getFloat() / 100.0F
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private RenderSupport_174 d(EntityPlayer entityPlayer) {
|
||||||
|
return entityPlayer.isInWater() ? null : this.L(entityPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private RenderSupport_174 L(EntityPlayer entityPlayer) {
|
||||||
|
return entityPlayer.isSneaking()
|
||||||
|
? new RenderSupport_174(0.0F, 0.0F, 0.96F, 0.1F, 18.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.18F, 4.5F, 0.06F, 0.02F, -11.0F, -4.0F, 0.12F)
|
||||||
|
: new RenderSupport_174(0.0F, 0.0F, 1.38F, 0.1F, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.18F, 4.5F, 0.06F, 0.02F, -11.0F, -4.0F, 0.12F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void L(float f) {
|
||||||
|
Wings wings1 = this;
|
||||||
|
if (wings1.isEnabled() && mc.theWorld != null && mc.thePlayer != null) {
|
||||||
|
wings1.wingInstances.clear();
|
||||||
|
if (wings1.targets.contains(TargetsMode.SELF) && mc.gameSettings.thirdPersonView != 0 && mc.thePlayer.isEntityAlive()) {
|
||||||
|
wings1.L(mc.thePlayer, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wings1.targets.contains(TargetsMode.PLAYERS)) {
|
||||||
|
Iterator iterator = mc.theWorld.playerEntities.iterator();
|
||||||
|
|
||||||
|
label33:
|
||||||
|
while (true) {
|
||||||
|
Iterator iterator1 = iterator;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
if (!iterator1.hasNext()) {
|
||||||
|
break label33;
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityPlayer entityPlayer;
|
||||||
|
if ((entityPlayer = (EntityPlayer)iterator.next()) == mc.thePlayer) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!entityPlayer.isEntityAlive()) {
|
||||||
|
iterator1 = iterator;
|
||||||
|
} else {
|
||||||
|
wings1.L(entityPlayer, f);
|
||||||
|
iterator1 = iterator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wings1.wingsRenderer.L(f, wings1.wingInstances, wings1.L());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.wingInstances.clear();
|
||||||
|
this.wingsRenderer.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(EntityPlayer entityPlayer, RenderSupport_174 renderSupport_174, float f) {
|
||||||
|
float g = 0.0F;
|
||||||
|
if (this.flapping.isEnabled()) {
|
||||||
|
float h = renderSupport_174.flapSpeed() * (this.flapSpeed.getFloat() / 3.0F);
|
||||||
|
float i = renderSupport_174.flapAmplitude() * (this.flapStrength.getFloat() / 30.0F);
|
||||||
|
g = (float)Math.sin((entityPlayer.ticksExisted + f) * h) * i;
|
||||||
|
}
|
||||||
|
|
||||||
|
float j = Math.clamp((float)Math.sqrt(entityPlayer.motionX * entityPlayer.motionX + entityPlayer.motionZ * entityPlayer.motionZ) * 10.0F, 0.0F, 1.0F);
|
||||||
|
return (g + j * renderSupport_174.motionSpreadBoost() - this.angle.getFloat()) * renderSupport_174.openMultiplier();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package openonyx.features.render;
|
||||||
|
|
||||||
|
import openonyx.features.Module;
|
||||||
|
import openonyx.features.ModuleCategory;
|
||||||
|
import openonyx.history.internal.KeybindSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
|
||||||
|
public final class Zoom extends Module {
|
||||||
|
public KeybindSetting zoomKey = new KeybindSetting("Zoom Key", 47);
|
||||||
|
private float i;
|
||||||
|
public NumberSetting animation;
|
||||||
|
public NumberSetting distance = new NumberSetting("Distance", 4.0, 1.5, 12.0, 0.5).withSuffix("x");
|
||||||
|
private long e;
|
||||||
|
|
||||||
|
public Zoom() {
|
||||||
|
super("Zoom", "Smooth hold-to-zoom camera", ModuleCategory.RENDER);
|
||||||
|
this.animation = new NumberSetting("Animation", 180.0, 0.0, 500.0, 10.0).withSuffix(" ms");
|
||||||
|
}
|
||||||
|
|
||||||
|
public float d(float f) {
|
||||||
|
Zoom zoom1 = this;
|
||||||
|
long l = System.nanoTime();
|
||||||
|
float h = zoom1.e == 0L ? 0.0F : Math.min((float)(l - zoom1.e) / 1000000.0F, 100.0F);
|
||||||
|
zoom1.e = l;
|
||||||
|
boolean bl = zoom1.isEnabled() && zoom1.zoomKey.isBound() && mc.currentScreen == null && zoom1.zoomKey.isPressed();
|
||||||
|
float ix = bl ? 1.0F : 0.0F;
|
||||||
|
float g;
|
||||||
|
float m;
|
||||||
|
if ((g = zoom1.animation.getFloat()) <= 0.0F) {
|
||||||
|
m = f;
|
||||||
|
zoom1.i = ix;
|
||||||
|
} else {
|
||||||
|
if (h > 0.0F) {
|
||||||
|
float j = Math.clamp(h / g, 0.0F, 1.0F);
|
||||||
|
float k = 1.0F - (float)Math.pow(1.0F - j, 3.0);
|
||||||
|
zoom1.i = zoom1.i + (ix - zoom1.i) * k;
|
||||||
|
if (Math.abs(ix - zoom1.i) < 0.001F) {
|
||||||
|
zoom1.i = ix;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return f + (m / zoom1.distance.getFloat() - f) * L(zoom1.i);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float L(float f) {
|
||||||
|
float g;
|
||||||
|
float h = g = Math.clamp(f, 0.0F, 1.0F);
|
||||||
|
return h * h * (3.0F - 2.0F * g);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.e = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean I() {
|
||||||
|
return this.isEnabled() && this.i > 0.02F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float L() {
|
||||||
|
return this.isEnabled() ? this.i : 0.0F;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user