Skip to content

Commit 1d2e7f7

Browse files
committed
v0.1
1 parent 1186c89 commit 1d2e7f7

18 files changed

+654
-186
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build
2020
# other
2121
eclipse
2222
run
23-
build - Copy.gradle
23+
versions
2424
.vscode
2525
.devauth
2626
.DS_STORE
@@ -30,7 +30,6 @@ build - Copy.gradle
3030
# Edit at https://www.toptal.com/developers/gitignore?templates=java,gradle,forgegradle,kotlin,macos,intellij,intellij+all,eclipse,visualstudiocode
3131

3232
### Eclipse ###
33-
.metadata
3433
bin/
3534
tmp/
3635
*.tmp
@@ -46,7 +45,6 @@ local.properties
4645
.externalToolBuilders/
4746

4847
# Locally stored "Eclipse launch configurations"
49-
*.launch
5048

5149
# PyDev specific (Python IDE for Eclipse)
5250
*.pydevproject

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
# MMCUtils
2-
Utilities for Minemen Club
1+
# StatsOverlay
32

4-
# Features
5-
- **Auto Practice** - Go straight into practice once joined.
6-
- **Auto Party Chat** - Enter party chat once joined practice.
7-
- **Height Overlay** - Make wools and terracottas darker at height limit.
8-
- **Height Overlay Darkness** - Adjust the darkness of height limit overlay.
9-
- **Height Overlay Distance HUD** - Shows how many blocks you are away from height limit.
3+
Stats overlay mod for Hypixel
104

115
Configurable in `OneConfig` menu
126

13-
# Requirements
14-
- OptiFine Smooth Lighting: On
15-

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ repositories {
9595
dependencies {
9696
// Adds the OneConfig library, so we can develop with it.
9797
modCompileOnly("cc.polyfrost:oneconfig-$platform:0.2.0-alpha+")
98-
implementation(files("libs/optifine-1.8.9.jar"))
98+
99+
implementation(files("libs/OverflowAnimations-2.0.1-b6-1.8.9.jar"))
100+
99101
// If we are building for legacy forge, includes the launch wrapper with `shade` as we configured earlier.
100102
if (platform.isLegacyForge) {
101103
compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT")

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# gradle.properties file -- CHANGE THE VALUES STARTING WITH `mod_*` AND REMOVE THIS COMMENT.
22

33
# Sets the name of your mod.
4-
mod_name=MMCUtils
4+
mod_name=StatsOverlay
55
# Sets the id of your mod that mod loaders use to recognize it.
6-
mod_id=mmcutils
6+
mod_id=statsoverlay
77
# Sets the version of your mod. Make sure to update this when you make changes according to semver.
8-
mod_version=1.0.5
8+
mod_version=0.1
99
# Sets the name of the jar file that you put in your 'mods' folder.
10-
mod_archives_name=MMCUtils
10+
mod_archives_name=StatsOverlay
1111

1212
# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
1313
polyfrost.defaults.loom=1

src/main/java/me/redth/mmcutils/Configuration.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/main/java/me/redth/mmcutils/HeightLimitHud.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/main/java/me/redth/mmcutils/MMCUtils.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/main/java/me/redth/mmcutils/mixin/BlockModelRendererMixin.java

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package me.redth.statsoverlay;
2+
3+
import cc.polyfrost.oneconfig.events.EventManager;
4+
import cc.polyfrost.oneconfig.events.event.LocrawEvent;
5+
import cc.polyfrost.oneconfig.events.event.ReceivePacketEvent;
6+
import cc.polyfrost.oneconfig.events.event.WorldLoadEvent;
7+
import cc.polyfrost.oneconfig.libs.eventbus.Subscribe;
8+
import cc.polyfrost.oneconfig.utils.hypixel.LocrawInfo;
9+
import me.redth.statsoverlay.config.OverlayConfig;
10+
import me.redth.statsoverlay.stat.DataList;
11+
import net.minecraft.client.Minecraft;
12+
import net.minecraft.client.network.NetworkPlayerInfo;
13+
import net.minecraft.network.play.server.S38PacketPlayerListItem;
14+
import net.minecraftforge.fml.common.Mod;
15+
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
16+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
17+
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
18+
19+
@Mod(modid = "@ID@", name = "@NAME@", version = "@VER@")
20+
public class StatsOverlay {
21+
private static final Minecraft mc = Minecraft.getMinecraft();
22+
public static OverlayConfig config;
23+
public static boolean inBW;
24+
25+
@Mod.EventHandler
26+
public void init(FMLInitializationEvent e) {
27+
config = new OverlayConfig();
28+
EventManager.INSTANCE.register(this);
29+
}
30+
31+
@Subscribe
32+
public void onPacketReceived(ReceivePacketEvent event) {
33+
if (!(event.packet instanceof S38PacketPlayerListItem)) return;
34+
if (!OverlayConfig.showAnyWhere && !inBW) return;
35+
36+
S38PacketPlayerListItem.Action action = ((S38PacketPlayerListItem) event.packet).getAction();
37+
if (action == S38PacketPlayerListItem.Action.ADD_PLAYER) {
38+
for (S38PacketPlayerListItem.AddPlayerData entry : ((S38PacketPlayerListItem) event.packet).getEntries()) {
39+
DataList.add(entry.getProfile());
40+
}
41+
} else if (action == S38PacketPlayerListItem.Action.REMOVE_PLAYER) {
42+
for (S38PacketPlayerListItem.AddPlayerData entry : ((S38PacketPlayerListItem) event.packet).getEntries()) {
43+
DataList.remove(entry.getProfile());
44+
}
45+
}
46+
}
47+
48+
@Subscribe
49+
public void onWorldLoad(WorldLoadEvent event) {
50+
DataList.clear();
51+
}
52+
53+
@SubscribeEvent
54+
public void onDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
55+
DataList.clear();
56+
}
57+
58+
@Subscribe
59+
public void onLocraw(LocrawEvent event) {
60+
if (OverlayConfig.showAnyWhere) return;
61+
inBW = event.info.getGameType() == LocrawInfo.GameType.BEDWARS && !"lobby".equals(event.info.getGameMode());
62+
if (inBW) {
63+
for (NetworkPlayerInfo networkPlayerInfo : mc.thePlayer.sendQueue.getPlayerInfoMap()) {
64+
DataList.add(networkPlayerInfo.getGameProfile());
65+
}
66+
}
67+
}
68+
69+
70+
// todo: align
71+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
package me.redth.statsoverlay.config;
2+
3+
import cc.polyfrost.oneconfig.config.Config;
4+
import cc.polyfrost.oneconfig.config.annotations.Checkbox;
5+
import cc.polyfrost.oneconfig.config.annotations.Dropdown;
6+
import cc.polyfrost.oneconfig.config.annotations.DualOption;
7+
import cc.polyfrost.oneconfig.config.annotations.HUD;
8+
import cc.polyfrost.oneconfig.config.annotations.HypixelKey;
9+
import cc.polyfrost.oneconfig.config.annotations.KeyBind;
10+
import cc.polyfrost.oneconfig.config.annotations.Switch;
11+
import cc.polyfrost.oneconfig.config.annotations.Text;
12+
import cc.polyfrost.oneconfig.config.core.OneKeyBind;
13+
import cc.polyfrost.oneconfig.config.data.Mod;
14+
import cc.polyfrost.oneconfig.config.data.ModType;
15+
import me.redth.statsoverlay.stat.DataList;
16+
import org.lwjgl.input.Keyboard;
17+
18+
public class OverlayConfig extends Config {
19+
20+
@KeyBind(name = "Overlay Key Bind")
21+
public static OneKeyBind keyBind = new OneKeyBind(Keyboard.KEY_TAB);
22+
23+
@DualOption(name = "Key Bind Mode", left = "Hold", right = "Toggle")
24+
public static boolean toggleKeyBind = false;
25+
26+
@DualOption(name = "Show in", left = "Only in Bedwars", right = "Any Server")
27+
public static boolean showAnyWhere = false;
28+
29+
@Dropdown(name = "Sorting", options = {"Stars", "Final Kills", "FKDR", "Wins", "WLR", "Beds Broken", "BBLR"})
30+
public static int sorting = 0;
31+
32+
@Text(name = "Self Name")
33+
public static String selfName = "§cYou";
34+
35+
@Switch(name = "Show Stars Before Name")
36+
public static boolean prefixStars = true;
37+
38+
@Checkbox(name = "Final Kills")
39+
public static boolean finalKills = true;
40+
41+
@Checkbox(name = "FKDR")
42+
public static boolean fkdr = true;
43+
44+
@Checkbox(name = "Wins")
45+
public static boolean wins = true;
46+
47+
@Checkbox(name = "WLR")
48+
public static boolean wlr = true;
49+
50+
@Checkbox(name = "Beds Broken")
51+
public static boolean bedsBroken = true;
52+
53+
@Checkbox(name = "BBLR")
54+
public static boolean bblr = true;
55+
56+
@HUD(name = "Overlay")
57+
public static OverlayHUD hud = new OverlayHUD();
58+
59+
@HypixelKey()
60+
@Text(name = "Hypixel API key", secure = true, category = "Hypixel API")
61+
public static String apiKey;
62+
63+
private static boolean keyBindToggled;
64+
private static boolean keyPressed;
65+
66+
public OverlayConfig() {
67+
super(new Mod("StatsOverlay", ModType.HYPIXEL), "statsoverlay.json");
68+
initialize();
69+
addListener("sorting", () -> DataList.altered = true);
70+
addListener("keyBindMode", () -> keyBindToggled = false);
71+
}
72+
73+
public static boolean isKeyPressed() {
74+
if (toggleKeyBind) {
75+
if (keyBind.isActive()) {
76+
if (!keyPressed) {
77+
keyPressed = true;
78+
keyBindToggled = !keyBindToggled;
79+
}
80+
} else {
81+
keyPressed = false;
82+
}
83+
return keyBindToggled;
84+
}
85+
86+
return keyBind.isActive();
87+
}
88+
}

0 commit comments

Comments
 (0)