diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index dbc247d..4f8f9c1 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -235,6 +235,7 @@ public class Client { } globalSettings.configsMigrated = true; globalSettings.save(); + new File(Minecraft.getMinecraft().mcDataDir, "SilentClient").delete(); } logger.info("STARTING > config-manager"); configManager = new ConfigManager(); diff --git a/src/main/java/net/silentclient/client/mods/ModInstances.java b/src/main/java/net/silentclient/client/mods/ModInstances.java index 16b47f3..f59c718 100644 --- a/src/main/java/net/silentclient/client/mods/ModInstances.java +++ b/src/main/java/net/silentclient/client/mods/ModInstances.java @@ -17,10 +17,7 @@ import net.silentclient.client.mods.staff.DebugNpcMod; import net.silentclient.client.mods.staff.FPSSpoofer; import net.silentclient.client.mods.staff.HitDelayFixMod; import net.silentclient.client.mods.staff.TestMod; -import net.silentclient.client.mods.world.FullBrightMod; -import net.silentclient.client.mods.world.PlayerCounterMod; -import net.silentclient.client.mods.world.TimeChangerMod; -import net.silentclient.client.mods.world.WeatherChangerMod; +import net.silentclient.client.mods.world.*; import java.util.ArrayList; import java.util.Collections; @@ -188,6 +185,8 @@ public class ModInstances { mods.add(new DonationsAlertsMod()); } mods.add(new QuickPlayMod()); + mods.add(new SoundsMod()); +// mods.add(new ItemSizeMod()); } public void postInit() { diff --git a/src/main/java/net/silentclient/client/mods/player/PerspectiveMod.java b/src/main/java/net/silentclient/client/mods/player/PerspectiveMod.java index 2587c8a..a9bbd20 100644 --- a/src/main/java/net/silentclient/client/mods/player/PerspectiveMod.java +++ b/src/main/java/net/silentclient/client/mods/player/PerspectiveMod.java @@ -7,6 +7,7 @@ import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.ClientTickEvent; import net.silentclient.client.event.impl.EventCameraRotation; 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.ModCategory; import net.silentclient.client.mods.util.Server; @@ -27,6 +28,8 @@ public class PerspectiveMod extends Mod { public void setup() { super.setup(); this.addKeybindSetting("Keybind", this, Keyboard.KEY_LMENU); + this.addBooleanSetting("Smooth Camera", this, false); + this.addBooleanSetting("Toggle Perspective", this, false); } @Override @@ -39,16 +42,47 @@ public class PerspectiveMod extends Mod { @EventTarget 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()) { start(); mc.gameSettings.thirdPersonView = 3; + if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) { + mc.gameSettings.smoothCamera = true; + } } else { + if(Client.getInstance().getSettingsManager().getSettingByName(this, "Smooth Camera").getValBoolean()) { + mc.gameSettings.smoothCamera = false; + } 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() { return this.isEnabled() && !isForceDisabled() && active; @@ -79,6 +113,7 @@ public class PerspectiveMod extends Mod { private void start() { if(!active) { + Client.logger.info("perspective active"); active = true; previousPerspective = mc.gameSettings.thirdPersonView; mc.gameSettings.thirdPersonView = 3; @@ -90,6 +125,7 @@ public class PerspectiveMod extends Mod { private void stop() { if(active) { + Client.logger.info("perspective deactive"); active = false; mc.gameSettings.thirdPersonView = previousPerspective; mc.renderGlobal.setDisplayListEntitiesDirty(); diff --git a/src/main/java/net/silentclient/client/mods/render/ItemSizeMod.java b/src/main/java/net/silentclient/client/mods/render/ItemSizeMod.java new file mode 100644 index 0000000..255ac99 --- /dev/null +++ b/src/main/java/net/silentclient/client/mods/render/ItemSizeMod.java @@ -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); + } +} diff --git a/src/main/java/net/silentclient/client/mods/world/SoundsMod.java b/src/main/java/net/silentclient/client/mods/world/SoundsMod.java new file mode 100644 index 0000000..3b0cad6 --- /dev/null +++ b/src/main/java/net/silentclient/client/mods/world/SoundsMod.java @@ -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); + } + } +} diff --git a/src/main/resources/assets/minecraft/silentclient/icons/mods/itemsize.png b/src/main/resources/assets/minecraft/silentclient/icons/mods/itemsize.png new file mode 100755 index 0000000..efd1059 Binary files /dev/null and b/src/main/resources/assets/minecraft/silentclient/icons/mods/itemsize.png differ diff --git a/src/main/resources/assets/minecraft/silentclient/icons/mods/soundsmod.png b/src/main/resources/assets/minecraft/silentclient/icons/mods/soundsmod.png new file mode 100755 index 0000000..3c50cea Binary files /dev/null and b/src/main/resources/assets/minecraft/silentclient/icons/mods/soundsmod.png differ