Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new: hide dropper hurt sounds #79

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/cc/woverflow/hytils/HytilsReborn.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import cc.woverflow.hytils.handlers.chat.modules.events.LevelupEvent;
import cc.woverflow.hytils.handlers.chat.modules.triggers.AutoQueue;
import cc.woverflow.hytils.handlers.chat.modules.triggers.SilentRemoval;
import cc.woverflow.hytils.handlers.game.dropper.DropperHurtSound;
import cc.woverflow.hytils.handlers.game.duels.SumoRenderDistance;
import cc.woverflow.hytils.handlers.game.hardcore.HardcoreStatus;
import cc.woverflow.hytils.handlers.game.housing.HousingMusic;
Expand Down Expand Up @@ -182,6 +183,7 @@ private void registerHandlers() {
eventBus.register(new SumoRenderDistance());
eventBus.register(new MiddleBeaconMiniWalls());
eventBus.register(new MiddleWaypointUHC());
eventBus.register(new DropperHurtSound());

// height overlay
EventManager.INSTANCE.register(HeightHandler.INSTANCE);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/cc/woverflow/hytils/config/HytilsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,13 @@ public class HytilsConfig extends Config {
)
public static boolean hideDropperActionBar;

@Switch(
name = "Mute Hurt Sounds in Dropper",
description = "Mute the sounds of other players failing in Dropper.",
category = "Game", subcategory = "Dropper"
)
public static boolean muteDropperHurtSound;

@Switch(
name = "Lower Render Distance in Sumo",
description = "Lowers render distance to your desired value in Sumo Duels.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Hytils Reborn - Hypixel focused Quality of Life mod.
* Copyright (C) 2020, 2021, 2022, 2023 Polyfrost, Sk1er LLC and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package cc.woverflow.hytils.handlers.game.dropper;

import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
import cc.polyfrost.oneconfig.utils.hypixel.LocrawInfo;
import cc.polyfrost.oneconfig.utils.hypixel.LocrawUtil;
import cc.woverflow.hytils.config.HytilsConfig;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

public class DropperHurtSound {

@SubscribeEvent
public void onSound(PlaySoundEvent event) {
LocrawInfo locraw = LocrawUtil.INSTANCE.getLocrawInfo();
if (HytilsConfig.muteDropperHurtSound && HypixelUtils.INSTANCE.isHypixel() && locraw != null && locraw.getGameMode().equalsIgnoreCase("dropper") && event.name.equals("game.player.hurt")) {
event.result = null;
}
}
}
Loading