scroll zoom, no hurt cam

This commit is contained in:
kone 2023-04-16 17:10:48 -04:00
parent 21ebcbaaec
commit ac507f39a7
7 changed files with 29960 additions and 29867 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -27,8 +27,10 @@ import dev.resent.module.impl.misc.DynamicFOV;
import dev.resent.module.impl.misc.FPSOptions; import dev.resent.module.impl.misc.FPSOptions;
import dev.resent.module.impl.misc.Fullbright; import dev.resent.module.impl.misc.Fullbright;
import dev.resent.module.impl.misc.HUD; import dev.resent.module.impl.misc.HUD;
import dev.resent.module.impl.misc.NoHurtCam;
import dev.resent.module.impl.misc.ParticleMultiplier; import dev.resent.module.impl.misc.ParticleMultiplier;
import dev.resent.module.impl.misc.Scoreboard; import dev.resent.module.impl.misc.Scoreboard;
import dev.resent.module.impl.misc.ScrollZoom;
import dev.resent.module.impl.misc.Sprint; import dev.resent.module.impl.misc.Sprint;
import dev.resent.module.impl.misc.TabSettings; import dev.resent.module.impl.misc.TabSettings;
import dev.resent.module.impl.setting.Animations; import dev.resent.module.impl.setting.Animations;
@ -82,7 +84,9 @@ public class ModManager {
public static AdminSpawner adminSpawner = new AdminSpawner(); public static AdminSpawner adminSpawner = new AdminSpawner();
public static ParticleMultiplier particleMultiplier = new ParticleMultiplier(); public static ParticleMultiplier particleMultiplier = new ParticleMultiplier();
public static Hand hand; public static Hand hand;
private static TabSettings tabSettings; public static TabSettings tabSettings;
public static ScrollZoom scrollZoom = new ScrollZoom();
public static NoHurtCam noHurtCam = new NoHurtCam();
//public static Crosshair crosshair = new Crosshair(); //public static Crosshair crosshair = new Crosshair();
@ -111,6 +115,8 @@ public class ModManager {
register(coordinate = new Info()); register(coordinate = new Info());
register(fps = new FPS()); register(fps = new FPS());
register(potCounter = new PotCounter()); register(potCounter = new PotCounter());
register(scrollZoom);
register(noHurtCam);
//Mechanic //Mechanic
register(particleMultiplier); register(particleMultiplier);

View File

@ -0,0 +1,12 @@
package dev.resent.module.impl.misc;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
@Module(name = "No Hurt Cam", category = Category.MISC, description = "Camera doesn't shake when you get hurt.")
public class NoHurtCam extends Mod {
}

View File

@ -0,0 +1,17 @@
package dev.resent.module.impl.misc;
import dev.resent.annotation.Module;
import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.util.MathHelper;
@Module(name = "Scroll Zoom", category = Category.MISC)
public class ScrollZoom extends Mod {
}

View File

@ -9,6 +9,7 @@ import com.google.common.base.Predicate;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import dev.resent.visual.crosshair.CrosshairManager; import dev.resent.visual.crosshair.CrosshairManager;

View File

@ -28,6 +28,7 @@ import dev.resent.client.Resent;
import dev.resent.module.base.ModManager; import dev.resent.module.base.ModManager;
import dev.resent.module.base.RenderMod; import dev.resent.module.base.RenderMod;
import dev.resent.module.impl.misc.FPSOptions; import dev.resent.module.impl.misc.FPSOptions;
import dev.resent.module.impl.misc.ScrollZoom;
import dev.resent.util.misc.W; import dev.resent.util.misc.W;
import java.util.List; import java.util.List;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
@ -35,6 +36,8 @@ import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.HString;
import net.lax1dude.eaglercraft.v1_8.Mouse; import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer; import net.lax1dude.eaglercraft.v1_8.internal.buffer.FloatBuffer;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
@ -394,6 +397,9 @@ public class EntityRenderer implements IResourceManagerReloadListener {
* Changes the field of view of the player depending on if they * Changes the field of view of the player depending on if they
* are underwater or not * are underwater or not
*/ */
double zoomLevel = 1.0;
private float getFOVModifier(float partialTicks, boolean parFlag) { private float getFOVModifier(float partialTicks, boolean parFlag) {
if (this.debugView) { if (this.debugView) {
return 90.0F; return 90.0F;
@ -402,6 +408,38 @@ public class EntityRenderer implements IResourceManagerReloadListener {
float f = 70.0F; float f = 70.0F;
if (parFlag) { if (parFlag) {
f = this.mc.gameSettings.keyBindZoomCamera.isKeyDown() ? 17.0f : this.mc.gameSettings.fovSetting; f = this.mc.gameSettings.keyBindZoomCamera.isKeyDown() ? 17.0f : this.mc.gameSettings.fovSetting;
if (ModManager.scrollZoom.isEnabled() && this.mc.gameSettings.keyBindZoomCamera.isKeyDown()) {
if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) {
zoomLevel += Mouse.getDWheel() * 0.01;
}
else {
zoomLevel += Mouse.getDWheel();
}
if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) {
zoomLevel = Math.max(-15, Math.min(30, zoomLevel));
} else {
zoomLevel = Math.max(-30, Math.min(15.0, zoomLevel));
}
System.out.println(zoomLevel);
if (PlatformRuntime.getPlatformType() == EnumPlatformType.JAVASCRIPT) {
f += zoomLevel;
}
else {
f -= zoomLevel;
}
if (f < 0) {
f = 0.1f;
}
if (f > 180) {
f = 179.9f;
}
}
else {
zoomLevel = 1.0;
}
f = f * (this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * partialTicks); f = f * (this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * partialTicks);
} }
@ -420,6 +458,8 @@ public class EntityRenderer implements IResourceManagerReloadListener {
} }
private void hurtCameraEffect(float partialTicks) { private void hurtCameraEffect(float partialTicks) {
if (ModManager.noHurtCam.isEnabled())
return;
if (this.mc.getRenderViewEntity() instanceof EntityLivingBase) { if (this.mc.getRenderViewEntity() instanceof EntityLivingBase) {
EntityLivingBase entitylivingbase = (EntityLivingBase) this.mc.getRenderViewEntity(); EntityLivingBase entitylivingbase = (EntityLivingBase) this.mc.getRenderViewEntity();
float f = (float) entitylivingbase.hurtTime - partialTicks; float f = (float) entitylivingbase.hurtTime - partialTicks;