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

Prepares #59 #60

Merged
merged 4 commits into from
Jan 25, 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
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ dependencies {
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")

// temporarily using 165 so that I can push this, revert back once fixed
compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha165')
compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+')
include('cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+')
compileOnly('org.spongepowered:mixin:0.7.11-SNAPSHOT')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package cc.woverflow.hytils.handlers.silent;

import cc.polyfrost.oneconfig.utils.Notifications;
import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
import cc.woverflow.hytils.HytilsReborn;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
Expand All @@ -35,6 +36,7 @@ public class SilentRemoval {

@SubscribeEvent(priority = EventPriority.HIGH)
public void onChat(ClientChatReceivedEvent event) {
if (!HypixelUtils.INSTANCE.isHypixel()) return;
final Matcher matcher = HytilsReborn.INSTANCE.getLanguageHandler().getCurrent().silentRemovalLeaveMessageRegex.matcher(EnumChatFormatting.getTextWithoutFormattingCodes(event.message.getUnformattedText()));

if (matcher.matches()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class GuiIngameForgeMixin_HideActionbar {
@Inject(method = "renderRecordOverlay", at = @At("HEAD"), cancellable = true)
private void cancelActionBar(int width, int height, float partialTicks, CallbackInfo ci) {
if (HypixelUtils.INSTANCE.isHypixel() && LocrawUtil.INSTANCE.getLocrawInfo() != null && (HytilsConfig.hideHousingActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.HOUSING) || HytilsConfig.hideDropperActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.DROPPER) ci.cancel();
if (HypixelUtils.INSTANCE.isHypixel() && LocrawUtil.INSTANCE.getLocrawInfo() != null && ((HytilsConfig.hideHousingActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameType() == LocrawInfo.GameType.HOUSING) || (HytilsConfig.hideDropperActionBar && LocrawUtil.INSTANCE.getLocrawInfo().getGameMode().equals("DROPPER"))))
ci.cancel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Arrays;

@Mixin(value = GuiIngameForge.class, remap = false)
public class GuiIngameForgeMixin_HideHotbar {
// currently doesn't account for admin abuse lobbies, duels lobby pvp, or housing pvp
Expand All @@ -41,49 +39,44 @@ public void cancelHealthbar(int width, int height, CallbackInfo ci) {
if (HytilsConfig.hideHudElements && locraw != null && HypixelUtils.INSTANCE.isHypixel()) {
if (HytilsReborn.INSTANCE.getLobbyChecker().playerIsInLobby()) {
// rudimentary check if player has engaged in pvp or something
if (Minecraft.getMinecraft().thePlayer.getHealth() < 20) {
return;
}
if (Minecraft.getMinecraft().thePlayer.getHealth() < 20) return;
ci.cancel();
return;
}

LocrawInfo.GameType gameType = locraw.getGameType();
String gameMode = locraw.getGameMode();
switch (gameType) {
case DROPPER:
case TNT_GAMES:
// break out of the switch if it's a duels game that has varying health
if (gameMode.contains("CAPTURE") || gameMode.contains("PVPRUN")) break;
case HOUSING:
// rudimentary check if player has engaged in pvp or something
if (Minecraft.getMinecraft().thePlayer.getHealth() < 20) {
break;
}
case MURDER_MYSTERY:
case BUILD_BATTLE:
case LIMBO:
case QUAKE:
case TNT_GAMES:
// break out of the switch if it's a duels game that has varying health
if (gameMode.contains("CAPTURE") || gameMode.contains("PVPRUN")) {
break;
}
case REPLAY:
// rudimentary check if player has engaged in pvp or something
if (Minecraft.getMinecraft().thePlayer.getHealth() < 20) break;
ci.cancel();
return;
}

Arrays.asList(
"DUELS_PARKOUR", // parkour (duels)
"DUELS_BOWSPLEEF_DUEL", // tnt games (duels)
"DUELS_BOXING_DUEL", // boxing (duels)
"PIXEL_PARTY", // pixel party (arcade)
"HOLE_IN_THE_WALL", // hole in the wall (arcade)
"SOCCER", // football (arcade)
"DRAW_THEIR_THING", // pixel painters (arcade)
"ENDER" // ender spleef (arcade)
).forEach((mode) -> {
if (gameMode.contains(mode)) {
switch (gameMode) {
case "DUELS_PARKOUR": // parkour (duels)
case "DUELS_BOWSPLEEF_DUEL": // tnt games (duels)
case "DUELS_BOXING_DUEL": // boxing (duels)
case "PIXEL_PARTY": // pixel party (arcade)
case "PIXEL_PARTY_HYPER": // pixel party (arcade)
case "HOLE_IN_THE_WALL": // hole in the wall (arcade)
case "SOCCER": // football (arcade)
case "DRAW_THEIR_THING": // pixel painters (arcade)
case "DROPPER":
// rudimentary check if player has engaged in pvp or something
if (Minecraft.getMinecraft().thePlayer.getHealth() < 20) break;
case "ENDER": // ender spleef (arcade)
ci.cancel();
}
});
}
}
}

Expand All @@ -99,45 +92,44 @@ public void cancelFood(int width, int height, CallbackInfo ci) {
LocrawInfo.GameType gameType = locraw.getGameType();
String gameMode = locraw.getGameMode();
switch (gameType) {
case BEDWARS:
case MURDER_MYSTERY:
case HOUSING:
case LIMBO:
case TNT_GAMES:
// break out of the switch if it's a duels game that has varying hunger
// break out of the switch if it's a tnt game that has varying hunger
if (gameMode.contains("CAPTURE")) {
break;
}
case CLASSIC_GAMES:
case BEDWARS:
case MURDER_MYSTERY:
case HOUSING:
case LIMBO:
case PAINTBALL:
case PIT:
case DROPPER:
case DUELS:
case BUILD_BATTLE:
case QUAKE:
case REPLAY:
case WOOL_WARS:
case VAMPIREZ:
ci.cancel();
}

Arrays.asList(
"PIXEL_PARTY", // pixel party (arcade)
"PVP_CTW", // capture the wool (arcade)
"ZOMBIES_", // zombies (arcade)
"HIDE_AND_SEEK_", // hide and seek (arcade)
"MINI_WALLS", // miniwalls (arcade)
"STARWARS", // galaxy wars (arcade)
"HOLE_IN_THE_WALL", // hole in the wall (arcade)
"SOCCER", // football (arcade)
"ONEINTHEQUIVER", // bounty hunters (arcade)
"DRAW_THEIR_THING", // pixel painters (arcade)
"DEFENDER", // wizards (tnt run)
"ENDER" // ender spleef (arcade)
).forEach((mode) -> {
if (gameMode.contains(mode)) {
switch (gameMode) {
case "PIXEL_PARTY": // pixel party (arcade)
case "PIXEL_PARTY_HYPER": // pixel party (arcade)
case "PVP_CTW": // capture the wool (arcade)
case "ZOMBIES_DEAD_END": // zombies (arcade)
case "ZOMBIES_BAD_BLOOD": // zombies (arcade)
case "ZOMBIES_ALIEN_ARCADIUM": // zombies (arcade)
case "HIDE_AND_SEEK_PROP_HUNT": // hide and seek (arcade)
case "HIDE_AND_SEEK_PARTY_POOPER": // hide and seek (arcade)
case "MINI_WALLS": // miniwalls (arcade)
case "STARWARS": // galaxy wars (arcade)
case "HOLE_IN_THE_WALL": // hole in the wall (arcade)
case "SOCCER": // football (arcade)
case "ONEINTHEQUIVER": // bounty hunters (arcade)
case "DRAW_THEIR_THING": // pixel painters (arcade)
case "ENDER": // ender spleef (arcade)
case "DROPPER":
ci.cancel();
}
});
}
}
}

Expand All @@ -158,26 +150,22 @@ public void cancelArmor(int width, int height, CallbackInfo ci) {
if (gameMode.contains("DUELS_SW_DUEL") || gameMode.contains("DUELS_UHC_MEETUP_DUEL")) {
break;
}
case DROPPER:
case REPLAY:
case MURDER_MYSTERY:
case BUILD_BATTLE:
case LIMBO:
case QUAKE:
case TNT_GAMES:
ci.cancel();
}

Arrays.asList(
"HOLE_IN_THE_WALL", // hole in the wall (arcade)
"SOCCER", // football (arcade)
"ONEINTHEQUIVER", // bounty hunters (arcade)
"DRAW_THEIR_THING", // pixel painters (arcade)
"ENDER" // ender spleef (arcade)
).forEach((mode) -> {
if (gameMode.contains(mode)) {
switch (gameMode) {
case "SOCCER": // football (arcade)
case "ONEINTHEQUIVER": // bounty hunters (arcade)
case "ENDER": // ender spleef (arcade)
case "DROPPER":
ci.cancel();
}
});
}
}
}

Expand Down