Upload files to "src/openonyx/features/render"
This commit is contained in:
1 parent
965e8c6340
commit
f51d2e6eb9
5 files changed
+330
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.history.DisplayNamed;
|
||||
|
||||
public enum NameDetailsMode implements DisplayNamed {
|
||||
RANK("Server rank"),
|
||||
HEALTH("Health"),
|
||||
PING("Ping");
|
||||
|
||||
private final String f;
|
||||
|
||||
private static NameDetailsMode[] L() {
|
||||
NameDetailsMode[] nameDetailsModes = new NameDetailsMode[3];
|
||||
boolean bl = true;
|
||||
nameDetailsModes[0] = HEALTH;
|
||||
nameDetailsModes[1] = RANK;
|
||||
nameDetailsModes[2] = PING;
|
||||
return nameDetailsModes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
NameDetailsMode(String string1) {
|
||||
this.f = string1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.features.Module;
|
||||
import openonyx.features.ModuleCategory;
|
||||
import openonyx.history.internal.BooleanSetting;
|
||||
|
||||
public final class NoRender extends Module {
|
||||
public final BooleanSetting badEffects;
|
||||
public final BooleanSetting handBob;
|
||||
public final BooleanSetting hurtCamera;
|
||||
public final BooleanSetting bossBar;
|
||||
public final BooleanSetting fire = new BooleanSetting("Fire", true);
|
||||
public final BooleanSetting scoreboard;
|
||||
|
||||
public boolean L(BooleanSetting booleanSetting) {
|
||||
return this.isEnabled() && booleanSetting.isEnabled();
|
||||
}
|
||||
|
||||
public NoRender() {
|
||||
super("NoRender", "Hides selected vanilla visual effects", ModuleCategory.RENDER);
|
||||
this.hurtCamera = new BooleanSetting("Hurt camera", true);
|
||||
this.handBob = new BooleanSetting("Hand bob", false);
|
||||
this.bossBar = new BooleanSetting("Boss bar", false);
|
||||
this.badEffects = new BooleanSetting("Bad effects", true);
|
||||
this.scoreboard = new BooleanSetting("Scoreboard", false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import openonyx.events.HypixelUtils;
|
||||
import openonyx.features.Module;
|
||||
import openonyx.features.ModuleCategory;
|
||||
import openonyx.history.internal.NumberSetting;
|
||||
|
||||
public final class ParticleLimiter extends Module {
|
||||
public final NumberSetting keep = new NumberSetting("Keep", 5.0, 5.0, 100.0, 5.0).withSuffix("%");
|
||||
|
||||
public ParticleLimiter() {
|
||||
super("Particle Limiter", "Thins vanilla particles in the Hypixel Bed Wars lobby", ModuleCategory.RENDER);
|
||||
}
|
||||
|
||||
public boolean I() {
|
||||
return this.isEnabled() && HypixelUtils.L() ? ThreadLocalRandom.current().nextInt(100) >= this.keep.getInt() : false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import openonyx.configuration.internal.AttackEvent;
|
||||
import openonyx.configuration.internal.TickEndEvent;
|
||||
import openonyx.configuration.internal.WorldChangeEvent;
|
||||
import openonyx.features.Module;
|
||||
import openonyx.features.ModuleCategory;
|
||||
import openonyx.history.internal.BooleanSetting;
|
||||
import openonyx.history.internal.MultiSelectSetting;
|
||||
import openonyx.history.internal.NumberSetting;
|
||||
import openonyx.render.group_j.ParticleMath;
|
||||
import openonyx.render.group_j.WorldParticle;
|
||||
import openonyx.render.group_j.WorldParticleMode;
|
||||
import openonyx.theme.ThemeManager;
|
||||
import openonyx.theme.internal.ColorUtils;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public final class Particles extends Module {
|
||||
private final List<WorldParticle> worldParticles;
|
||||
public final BooleanSetting randomColor;
|
||||
private static final ResourceLocation RESOURCE_LOCATION = new ResourceLocation("onyx", "textures/particle/firefly.png");
|
||||
public final NumberSetting size;
|
||||
public final NumberSetting particlesWhileWalking;
|
||||
public final MultiSelectSetting<SpawnAtMode> spawnAt;
|
||||
public final NumberSetting particlesOnHit;
|
||||
public final BooleanSetting physics;
|
||||
private int d;
|
||||
public final NumberSetting physicsSpeed;
|
||||
public final NumberSetting duration;
|
||||
private final Random random;
|
||||
private int e;
|
||||
|
||||
private void l() {
|
||||
this.worldParticles.removeIf(worldParticle -> !worldParticle.L());
|
||||
}
|
||||
|
||||
private void h() {
|
||||
Particles particles1 = this;
|
||||
|
||||
for (Iterator iterator1 = iterator = particles1.worldParticles.iterator(); iterator1.hasNext(); iterator1 = iterator) {
|
||||
((WorldParticle)iterator.next()).L();
|
||||
}
|
||||
|
||||
particles1.worldParticles.clear();
|
||||
particles1.d = 0;
|
||||
particles1.e = 0;
|
||||
}
|
||||
|
||||
private void L(Vec3 vec3, Vec3 vec31, WorldParticleMode worldParticleMode, int i) {
|
||||
if (mc.theWorld != null) {
|
||||
this.worldParticles.add(new WorldParticle(this, mc.theWorld, worldParticleMode, i, this.L(), vec3, vec31));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onAttack(AttackEvent attackEvent) {
|
||||
if (this.spawnAt.contains(SpawnAtMode.ATTACK) && attackEvent.getEntityPlayer() == mc.thePlayer) {
|
||||
Entity entity;
|
||||
if ((entity = attackEvent.getEntity()) != null) {
|
||||
int i;
|
||||
for (int j = i = 0; j < this.particlesOnHit.getInt(); j = i) {
|
||||
Vec3 vec3 = new Vec3(entity.posX, entity.posY + this.random.nextDouble() * entity.height, entity.posZ);
|
||||
Vec3 vec31 = new Vec3(this.L(-2.0, 2.0), 0.0, this.L(-2.0, 2.0));
|
||||
WorldParticleMode worldParticleMode = WorldParticleMode.ATTACK;
|
||||
int k = this.d;
|
||||
i++;
|
||||
this.d++;
|
||||
this.L(vec3, vec31, worldParticleMode, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Particles() {
|
||||
super("Particles", "Glowing fireflies on attacks and while walking", ModuleCategory.RENDER);
|
||||
SpawnAtMode[] spawnAtModes = new SpawnAtMode[2];
|
||||
boolean bl = true;
|
||||
spawnAtModes[0] = SpawnAtMode.ATTACK;
|
||||
spawnAtModes[1] = SpawnAtMode.WALKING;
|
||||
this.spawnAt = new MultiSelectSetting<>("Spawn at", SpawnAtMode.class, spawnAtModes);
|
||||
this.particlesOnHit = new NumberSetting("Particles on hit", 3.0, 1.0, 25.0, 1.0)
|
||||
.visibleWhen(this.spawnAt, enumSet -> enumSet.contains(SpawnAtMode.ATTACK));
|
||||
this.particlesWhileWalking = new NumberSetting("Particles while walking", 2.0, 1.0, 15.0, 1.0)
|
||||
.visibleWhen(this.spawnAt, enumSet -> enumSet.contains(SpawnAtMode.WALKING));
|
||||
this.randomColor = new BooleanSetting("Random color", false);
|
||||
this.size = new NumberSetting("Size", 1.0, 0.5, 2.5, 0.05).withSuffix("x");
|
||||
this.duration = new NumberSetting("Duration", 1.0, 0.25, 3.0, 0.05).withSuffix("x");
|
||||
this.physics = new BooleanSetting("Physics", true);
|
||||
this.physicsSpeed = new NumberSetting("Physics speed", 1.0, 0.25, 3.0, 0.05).withSuffix("x").visibleWhen(this.physics);
|
||||
this.worldParticles = new ArrayList<>();
|
||||
this.random = new Random();
|
||||
}
|
||||
|
||||
public int L(int i, int j) {
|
||||
return this.randomColor.isEnabled()
|
||||
? j
|
||||
: ParticleMath.L(ThemeManager.getPalette().primary(), ThemeManager.getPalette().tertiary(), i, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEnable() {
|
||||
this.h();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onWorldChange(WorldChangeEvent worldChangeEvent) {
|
||||
this.h();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDisable() {
|
||||
this.h();
|
||||
}
|
||||
|
||||
private double L(double d, double e) {
|
||||
return dx + this.random.nextDouble() * (ex - dx);
|
||||
}
|
||||
|
||||
private int L() {
|
||||
return ColorUtils.hsvToArgb(this.random.nextFloat() * 360.0F, 0.75F + this.random.nextFloat() * 0.25F, 0.75F + this.random.nextFloat() * 0.25F, 255);
|
||||
}
|
||||
|
||||
public void L(float f) {
|
||||
Particles particles1 = this;
|
||||
if (particles1.isEnabled()) {
|
||||
particles1.l();
|
||||
Iterator iterator1;
|
||||
Iterator iterator3 = iterator1 = particles1.worldParticles.iterator();
|
||||
|
||||
while (iterator3.hasNext()) {
|
||||
WorldParticle worldParticle = (WorldParticle)iterator1.next();
|
||||
iterator3 = iterator1;
|
||||
worldParticle.d();
|
||||
}
|
||||
|
||||
particles1.l();
|
||||
if (!particles1.worldParticles.isEmpty()) {
|
||||
Entity entity;
|
||||
if ((entity = mc.getRenderViewEntity()) != null) {
|
||||
Vec3 vec3 = new Vec3(
|
||||
entity.prevPosX + (entity.posX - entity.prevPosX) * f,
|
||||
entity.prevPosY + (entity.posY - entity.prevPosY) * f,
|
||||
entity.prevPosZ + (entity.posZ - entity.prevPosZ) * f
|
||||
);
|
||||
f = ActiveRenderInfo.getRotationX();
|
||||
float j = ActiveRenderInfo.getRotationXZ();
|
||||
float g = ActiveRenderInfo.getRotationZ();
|
||||
float h = ActiveRenderInfo.getRotationYZ();
|
||||
float i = ActiveRenderInfo.getRotationXY();
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(770, 1);
|
||||
GlStateManager.depthMask(false);
|
||||
GlStateManager.disableCull();
|
||||
GlStateManager.disableAlpha();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(RESOURCE_LOCATION);
|
||||
GL11.glTexParameteri(3553, 10241, 9729);
|
||||
GL11.glTexParameteri(3553, 10240, 9729);
|
||||
Tessellator tessellator;
|
||||
WorldRenderer worldRenderer = (tessellator = Tessellator.getInstance()).getWorldRenderer();
|
||||
worldRenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
|
||||
Iterator iterator;
|
||||
for (Iterator iterator2 = iterator = particles1.worldParticles.iterator(); iterator2.hasNext(); iterator2 = iterator) {
|
||||
((WorldParticle)iterator.next()).L(worldRenderer, vec3, f, j, g, h, i);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onTickEnd(TickEndEvent tickEndEvent) {
|
||||
Particles particles1 = this;
|
||||
particles1.l();
|
||||
if (particles1.spawnAt.contains(SpawnAtMode.WALKING) && mc.thePlayer != null && mc.theWorld != null) {
|
||||
if (mc.gameSettings.thirdPersonView != 0) {
|
||||
if (mc.thePlayer.prevPosX != mc.thePlayer.posX || mc.thePlayer.prevPosY != mc.thePlayer.posY || mc.thePlayer.prevPosZ != mc.thePlayer.posZ) {
|
||||
for (int j = i = 0; j < particles1.particlesWhileWalking.getInt(); j = i) {
|
||||
Vec3 vec3 = new Vec3(
|
||||
mc.thePlayer.posX + particles1.L(-0.5, 0.5),
|
||||
mc.thePlayer.posY + particles1.random.nextDouble() * mc.thePlayer.height,
|
||||
mc.thePlayer.posZ + particles1.L(-0.5, 0.5)
|
||||
);
|
||||
double dx = 2.0 * (1.0 + particles1.random.nextDouble());
|
||||
Vec3 vec31 = new Vec3(mc.thePlayer.motionX + particles1.L(-0.1, 0.1), 0.0, mc.thePlayer.motionZ + particles1.L(-0.1, 0.1)).scale(dx);
|
||||
WorldParticleMode worldParticleMode = WorldParticleMode.WALKING;
|
||||
int k = particles1.e;
|
||||
i++;
|
||||
particles1.e++;
|
||||
particles1.L(vec3, vec31, worldParticleMode, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package openonyx.features.render;
|
||||
|
||||
import openonyx.history.DisplayNamed;
|
||||
|
||||
public enum PerspectiveMode implements DisplayNamed {
|
||||
BACK("Behind", 1),
|
||||
FRONT("In front", 2);
|
||||
|
||||
private final int d;
|
||||
private final String H;
|
||||
|
||||
PerspectiveMode(String string1, int j) {
|
||||
this.H = string1;
|
||||
this.d = j;
|
||||
}
|
||||
|
||||
public int L() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return this.H;
|
||||
}
|
||||
|
||||
private static PerspectiveMode[] L() {
|
||||
PerspectiveMode[] perspectiveModes = new PerspectiveMode[2];
|
||||
boolean bl = true;
|
||||
perspectiveModes[0] = BACK;
|
||||
perspectiveModes[1] = FRONT;
|
||||
return perspectiveModes;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user