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 Arcade Cosmetics and add simple block command #57

Merged
merged 7 commits into from
Jan 22, 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
1 change: 1 addition & 0 deletions src/main/java/cc/woverflow/hytils/HytilsReborn.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void onFMLPreInitialization(FMLPreInitializationEvent event) {
public void init(FMLInitializationEvent event) {
config = new HytilsConfig();

CommandManager.INSTANCE.registerCommand(new BlockCommand());
CommandManager.INSTANCE.registerCommand(new HousingVisitCommand());
CommandManager.INSTANCE.registerCommand(new HytilsCommand());
CommandManager.INSTANCE.registerCommand(new IgnoreTemporaryCommand());
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/cc/woverflow/hytils/command/BlockCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.command;

import cc.polyfrost.oneconfig.libs.universal.ChatColor;
import cc.polyfrost.oneconfig.libs.universal.UChat;
import cc.polyfrost.oneconfig.utils.commands.annotations.Command;
import cc.polyfrost.oneconfig.utils.commands.annotations.Main;
import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
import cc.woverflow.hytils.HytilsReborn;
import com.mojang.authlib.GameProfile;

@Command("block")
public class BlockCommand {

@Main
public void handle() {
UChat.chat(ChatColor.RED + "Usage: /block <player>");
}

@Main(description = "Adds a player to the ignore list.")
private void main(GameProfile player) {
if (HypixelUtils.INSTANCE.isHypixel()) {
String name = player.getName();
HytilsReborn.INSTANCE.getCommandQueue().queue("/ignore add " + name);
}
}
}
14 changes: 10 additions & 4 deletions src/main/java/cc/woverflow/hytils/command/SilentRemoveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public class SilentRemoveCommand {

@Main
public void handle() {
UChat.chat(ChatColor.RED + "Usage: /silentremove <add/list> <player>");
UChat.chat(ChatColor.RED + "Usage: /silentremove <add/remove> <player>");
UChat.chat(ChatColor.RED + " or: /silentremove <player>");
}

@Main(description = "Adds or removes a player from the silent list")
@Main(description = "Adds or removes a player from the silent list.")
private void player(GameProfile player) {
String name = player.getName();
final Set<String> silentUsers = HytilsReborn.INSTANCE.getSilentRemoval().getSilentUsers();
Expand All @@ -51,18 +51,24 @@ private void player(GameProfile player) {
HytilsReborn.INSTANCE.sendMessage("&aAdded &e" + name + " &ato the removal queue.");
}

@SubCommand(description = "Adds a player to the silent list")
@SubCommand(description = "Adds a player to the silent list.")
private void add(GameProfile entityPlayer) {
player(entityPlayer);
}

@SubCommand(description = "Removes a player from the silent list.")
private void remove(GameProfile entityPlayer) {
player(entityPlayer);
}

@SubCommand(description = "Clears the silent removal queue.")
private void clear() {
final Set<String> silentUsers = HytilsReborn.INSTANCE.getSilentRemoval().getSilentUsers();
if (silentUsers.isEmpty()) {
HytilsReborn.INSTANCE.sendMessage("&cSilent Removal list is already empty.");
HytilsReborn.INSTANCE.sendMessage("&cSilent removal list is already empty.");
return;
}
silentUsers.clear();
HytilsReborn.INSTANCE.sendMessage("&aCleared the silent removal list.");
}
}
Loading