Sounds Mod & Better Perspective

This commit is contained in:
kirillsaint 2023-12-31 17:07:54 +06:00
parent 635fa2ec83
commit 4b464f0a51
7 changed files with 115 additions and 5 deletions

View File

@ -235,6 +235,7 @@ public class Client {
} }
globalSettings.configsMigrated = true; globalSettings.configsMigrated = true;
globalSettings.save(); globalSettings.save();
new File(Minecraft.getMinecraft().mcDataDir, "SilentClient").delete();
} }
logger.info("STARTING > config-manager"); logger.info("STARTING > config-manager");
configManager = new ConfigManager(); configManager = new ConfigManager();

View File

@ -17,10 +17,7 @@ import net.silentclient.client.mods.staff.DebugNpcMod;
import net.silentclient.client.mods.staff.FPSSpoofer; import net.silentclient.client.mods.staff.FPSSpoofer;
import net.silentclient.client.mods.staff.HitDelayFixMod; import net.silentclient.client.mods.staff.HitDelayFixMod;
import net.silentclient.client.mods.staff.TestMod; import net.silentclient.client.mods.staff.TestMod;
import net.silentclient.client.mods.world.FullBrightMod; import net.silentclient.client.mods.world.*;
import net.silentclient.client.mods.world.PlayerCounterMod;
import net.silentclient.client.mods.world.TimeChangerMod;
import net.silentclient.client.mods.world.WeatherChangerMod;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -188,6 +185,8 @@ public class ModInstances {
mods.add(new DonationsAlertsMod()); mods.add(new DonationsAlertsMod());
} }
mods.add(new QuickPlayMod()); mods.add(new QuickPlayMod());
mods.add(new SoundsMod());
// mods.add(new ItemSizeMod());
} }
public void postInit() { public void postInit() {

View File

@ -7,6 +7,7 @@ import net.silentclient.client.event.EventTarget;
import net.silentclient.client.event.impl.ClientTickEvent; import net.silentclient.client.event.impl.ClientTickEvent;
import net.silentclient.client.event.impl.EventCameraRotation; import net.silentclient.client.event.impl.EventCameraRotation;
import net.silentclient.client.event.impl.EventPlayerHeadRotation; import net.silentclient.client.event.impl.EventPlayerHeadRotation;
import net.silentclient.client.event.impl.KeyEvent;
import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory; import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.util.Server; import net.silentclient.client.mods.util.Server;
@ -27,6 +28,8 @@ public class PerspectiveMod extends Mod {
public void setup() { public void setup() {
super.setup(); super.setup();
this.addKeybindSetting("Keybind", this, Keyboard.KEY_LMENU); this.addKeybindSetting("Keybind", this, Keyboard.KEY_LMENU);
this.addBooleanSetting("Smooth Camera", this, false);
this.addBooleanSetting("Toggle Perspective", this, false);
} }
@Override @Override
@ -39,17 +42,48 @@ public class PerspectiveMod extends Mod {
@EventTarget @EventTarget
public void updateEvent(ClientTickEvent event) { public void updateEvent(ClientTickEvent event) {
if(!isForceDisabled()) { if(!isForceDisabled() && !Client.getInstance().getSettingsManager().getSettingByName(this, "Toggle Perspective").getValBoolean()) {
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Keybind").isKeyDown()) { if(Client.getInstance().getSettingsManager().getSettingByName(this, "Keybind").isKeyDown()) {
start(); start();
mc.gameSettings.thirdPersonView = 3; mc.gameSettings.thirdPersonView = 3;
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) {
mc.gameSettings.smoothCamera = true;
}
} }
else { else {
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) {
mc.gameSettings.smoothCamera = false;
}
stop(); stop();
} }
} }
} }
boolean toggleAllowed = false;
@EventTarget
public void onKey(KeyEvent event) {
if(!isForceDisabled() && Client.getInstance().getSettingsManager().getSettingByName(this, "Toggle Perspective").getValBoolean()) {
if(event.getKey() == Client.getInstance().getSettingsManager().getSettingByName(this, "Keybind").getKeybind()) {
toggleAllowed = !toggleAllowed;
if(toggleAllowed) {
if(active) {
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) {
mc.gameSettings.smoothCamera = false;
}
stop();
} else {
start();
mc.gameSettings.thirdPersonView = 3;
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) {
mc.gameSettings.smoothCamera = true;
}
}
}
}
}
}
public boolean isActive() { public boolean isActive() {
return this.isEnabled() && !isForceDisabled() && active; return this.isEnabled() && !isForceDisabled() && active;
} }
@ -79,6 +113,7 @@ public class PerspectiveMod extends Mod {
private void start() { private void start() {
if(!active) { if(!active) {
Client.logger.info("perspective active");
active = true; active = true;
previousPerspective = mc.gameSettings.thirdPersonView; previousPerspective = mc.gameSettings.thirdPersonView;
mc.gameSettings.thirdPersonView = 3; mc.gameSettings.thirdPersonView = 3;
@ -90,6 +125,7 @@ public class PerspectiveMod extends Mod {
private void stop() { private void stop() {
if(active) { if(active) {
Client.logger.info("perspective deactive");
active = false; active = false;
mc.gameSettings.thirdPersonView = previousPerspective; mc.gameSettings.thirdPersonView = previousPerspective;
mc.renderGlobal.setDisplayListEntitiesDirty(); mc.renderGlobal.setDisplayListEntitiesDirty();

View File

@ -0,0 +1,17 @@
package net.silentclient.client.mods.render;
import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory;
public class ItemSizeMod extends Mod {
public ItemSizeMod() {
super("Item Size", ModCategory.MODS, "silentclient/icons/mods/itemsize.png");
}
@Override
public void setup() {
this.addSliderSetting("X", this, 0.75, -1, 1, false);
this.addSliderSetting("Y", this, -0.15, -1, 1, false);
this.addSliderSetting("Z", this, -1, -1, 1, false);
}
}

View File

@ -0,0 +1,57 @@
package net.silentclient.client.mods.world;
import net.silentclient.client.Client;
import net.silentclient.client.event.EventTarget;
import net.silentclient.client.event.impl.EventPlaySound;
import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory;
public class SoundsMod extends Mod {
public SoundsMod() {
super("Sounds", ModCategory.MODS, "silentclient/icons/mods/soundsmod.png");
}
@Override
public void setup() {
this.addSliderSetting("Note", this, 100, 0, 100, true);
this.addSliderSetting("Mobs", this, 100, 0, 100, true);
this.addSliderSetting("Portal", this, 100, 0, 100, true);
this.addSliderSetting("Records", this, 100, 0, 100, true);
this.addSliderSetting("Step", this, 100, 0, 100, true);
this.addSliderSetting("TNT", this, 100, 0, 100, true);
}
@EventTarget
public void onPlaySound(EventPlaySound event) {
float noteVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "Note").getValFloat();
float mobsVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "Mobs").getValFloat();
float recordsVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "Records").getValFloat();
float portalVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "Portal").getValFloat();
float stepVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "Step").getValFloat();
float tntVolume = Client.getInstance().getSettingsManager().getSettingByName(this, "TNT").getValFloat();
if(event.getSoundName().startsWith("note")) {
event.setVolume(noteVolume / 100F);
}
if(event.getSoundName().equals("game.tnt.primed") || event.getSoundName().equals("random.explode") || event.getSoundName().equals("creeper.primed")) {
event.setVolume(tntVolume / 100F);
}
if(event.getSoundName().contains("mob")) {
event.setVolume(mobsVolume / 100F);
}
if(event.getSoundName().startsWith("records")) {
event.setVolume(recordsVolume / 100F);
}
if(event.getSoundName().startsWith("step")) {
event.setVolume(stepVolume / 100F);
}
if(event.getSoundName().startsWith("portal")) {
event.setVolume(portalVolume / 100F);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB