Skip to content

Commit c8d867a

Browse files
committed
- Fixes to Scoreboxes
- Changes/Fixes to Club Icons - Code Improvements - Update GUI Improvements - Backend analytics and tebex integration - Started working on HTSL Commit System (probably wont be done soon) - Most likely other bug fixes aswell
1 parent 7fedef7 commit c8d867a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1250
-838
lines changed

src/main/java/llc/redstone/hysentials/Hysentials.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public void init(FMLInitializationEvent event) {
206206
commands.add(new SetTextureCommand());
207207
commands.add(new HymojiCommand());
208208
commands.add(new ClaimCommand());
209-
commands.add(new GroupChatCommand());
209+
// commands.add(new GroupChatCommand());
210210

211211
for (ICommand command : commands) {
212212
ClientCommandHandler.instance.registerCommand(command);
@@ -216,12 +216,12 @@ public void init(FMLInitializationEvent event) {
216216
CommandManager.INSTANCE.registerCommand(new ClubCommand());
217217

218218

219-
if (Socket.cachedServerData.has("rpc") && Socket.cachedServerData.getBoolean("rpc")) {
220-
// DiscordCore.init();
219+
if (Socket.cachedServerData != null && Socket.cachedServerData.getRpc() != null && Socket.cachedServerData.getRpc()) {
221220
discordRPC = new DiscordRPC();
222221
}
223222

224223
Quest.registerQuests();
224+
HysentialsUtilsKt.init(VERSION);
225225
System.out.println("Hysentials has been initialized!");
226226
}
227227

@@ -402,16 +402,16 @@ private void registerHandlers() {
402402
SBBoxesEditor.initGUI();
403403
// general stuff
404404
eventBus.register(languageHandler);
405-
try {
406-
if (isChatting) {
407-
eventBus.register(new GroupChat());
408-
eventBus.register(new GlobalChat());
409-
}
410-
} catch (Exception e) {
411-
e.printStackTrace();
412-
isChatting = false;
413-
System.out.println("Failed to register GroupChat due to old version of Chatting mod. Please update Chatting to the latest version.");
414-
}
405+
// try {
406+
// if (isChatting) {
407+
// eventBus.register(new GroupChat());
408+
// eventBus.register(new GlobalChat());
409+
// }
410+
// } catch (Exception e) {
411+
// e.printStackTrace();
412+
// isChatting = false;
413+
// System.out.println("Failed to register GroupChat due to old version of Chatting mod. Please update Chatting to the latest version.");
414+
// }
415415
// chat
416416
eventBus.register(chatHandler);
417417

@@ -432,6 +432,7 @@ private void registerHandlers() {
432432
eventBus.register(new Queue());
433433
eventBus.register(new Navigator());
434434
eventBus.register(new ActionGUIHandler());
435+
eventBus.register(new CommitListener());
435436
eventBus.register(new FunctionsGUIHandler());
436437
eventBus.register(new Exporter());
437438
eventBus.register(new HousingMenuHandler());
@@ -460,7 +461,6 @@ private void registerHandlers() {
460461

461462
EventManager.INSTANCE.register(new BwRanks());
462463

463-
HysentialsUtilsKt.init(VERSION);
464464

465465
// Runtime.getRuntime().addShutdownHook(new Thread(() -> {
466466
// JSONArray array = new JSONArray();

src/main/java/llc/redstone/hysentials/capes/CapeHandler.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
package llc.redstone.hysentials.capes;
22

3-
import llc.redstone.hysentials.Hysentials;
4-
import llc.redstone.hysentials.cosmetic.CosmeticGui;
53
import llc.redstone.hysentials.cosmetic.CosmeticUtilsKt;
64
import llc.redstone.hysentials.schema.HysentialsSchema;
75
import llc.redstone.hysentials.websocket.Socket;
8-
import llc.redstone.hysentials.cosmetic.CosmeticGui;
9-
import llc.redstone.hysentials.schema.HysentialsSchema;
10-
import llc.redstone.hysentials.websocket.Socket;
116
import net.minecraft.client.Minecraft;
127
import net.minecraft.client.renderer.texture.DynamicTexture;
138
import net.minecraft.util.ResourceLocation;
149
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
1510
import net.minecraftforge.fml.common.gameevent.TickEvent;
16-
import org.json.JSONObject;
1711

1812
import java.awt.image.BufferedImage;
1913
import java.io.InputStream;
@@ -28,7 +22,7 @@ public class CapeHandler {
2822
public void onTickEvent(TickEvent.ClientTickEvent event) {
2923
if (event.phase != TickEvent.Phase.END) return;
3024
try {
31-
for (String id : Socket.cachedUsersNew.keySet()) {
25+
for (String id : Socket.cachedUsers.keySet()) {
3226
UUID uuid = UUID.fromString(id);
3327
boolean wearingCape = false;
3428
for (HysentialsSchema.Cosmetic cosmetic : CosmeticUtilsKt.getEquippedCosmetics(uuid)) {

src/main/java/llc/redstone/hysentials/command/ClaimCommand.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package llc.redstone.hysentials.command;
22

3+
import cc.polyfrost.oneconfig.libs.universal.UChat;
34
import llc.redstone.hysentials.config.HysentialsConfig;
4-
import llc.redstone.hysentials.util.BUtils;
55
import llc.redstone.hysentials.util.DuoVariable;
6-
import llc.redstone.hysentials.util.MUtils;
76
import llc.redstone.hysentials.websocket.Request;
87
import llc.redstone.hysentials.websocket.Socket;
98
import net.minecraft.client.Minecraft;
@@ -42,9 +41,9 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
4241
).toString()
4342
);
4443
Socket.awaiting.add(new DuoVariable<>("claim", (data) -> {
45-
if (data.has("success") && !(boolean) data.get("success")) {
44+
if (data.has("success") && !data.get("success").getAsBoolean()) {
4645
if (data.has("message")) {
47-
MUtils.chat(HysentialsConfig.chatPrefix + " " + data.get("message").toString());
46+
UChat.chat(HysentialsConfig.chatPrefix + " " + data.get("message").getAsString());
4847
}
4948
// Minecraft.getMinecraft().thePlayer.sendChatMessage("/claim");
5049
}

src/main/java/llc/redstone/hysentials/command/ClubCommand.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void create(@Greedy String name) {
9191
@SubCommand(aliases = {"join"}, description = "Join a club")
9292
public void join(String name) {
9393
if (!Socket.linked) {
94-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
94+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
9595
return;
9696
}
9797
Socket.CLIENT.sendText(new Request(
@@ -102,11 +102,11 @@ public void join(String name) {
102102
).toString());
103103
Socket.awaiting.add(
104104
new DuoVariable<>("clubAccept", (json) -> {
105-
if (json.getBoolean("success")) {
106-
MUtils.chat(HysentialsConfig.chatPrefix + " &aSuccessfully joined " + name + "!");
105+
if (json.get("success").getAsBoolean()) {
106+
UChat.chat(HysentialsConfig.chatPrefix + " &aSuccessfully joined " + name + "!");
107107
} else {
108-
MUtils.chat(HysentialsConfig.chatPrefix + " &cFailed to join " + name + "!");
109-
MUtils.chat(" - &c" + json.getString("message"));
108+
UChat.chat(HysentialsConfig.chatPrefix + " &cFailed to join " + name + "!");
109+
UChat.chat(" - &c" + json.get("message").getAsString());
110110
}
111111
})
112112
);
@@ -115,11 +115,11 @@ public void join(String name) {
115115
@SubCommand(aliases = {"house"})
116116
public void house(int index, @Greedy String args) {
117117
if (!Socket.linked) {
118-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
118+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
119119
return;
120120
}
121121
if (args.isEmpty()) {
122-
MUtils.chat("&cInvalid arguments, use /club house <index> <item|name|username|remove> [args]");
122+
UChat.chat("&cInvalid arguments, use /club house <index> <item|name|username|remove> [args]");
123123
return;
124124
}
125125
String command = args.split(" ")[0];
@@ -131,13 +131,13 @@ public void house(int index, @Greedy String args) {
131131
JSONObject jsonObject1 = new JSONObject();
132132
switch (command.toLowerCase()) {
133133
case "help": {
134-
MUtils.chat("&e/club house <index> <item|name|username|remove> [args]");
134+
UChat.chat("&e/club house <index> <item|name|username|remove> [args]");
135135
break;
136136
}
137137
case "item": {
138138
ItemStack item = Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem();
139139
if (item == null) {
140-
MUtils.chat("&cYou must be holding an item to use this command.");
140+
UChat.chat("&cYou must be holding an item to use this command.");
141141
return;
142142
}
143143
String nbt = item.serializeNBT().toString();
@@ -153,7 +153,7 @@ public void house(int index, @Greedy String args) {
153153
}
154154
case "name": {
155155
if (args.split(" ").length < 2) {
156-
MUtils.chat("&cInvalid arguments, use /club house <index> name <name>");
156+
UChat.chat("&cInvalid arguments, use /club house <index> name <name>");
157157
return;
158158
}
159159

@@ -167,7 +167,7 @@ public void house(int index, @Greedy String args) {
167167
}
168168
case "username": {
169169
if (args.split(" ").length < 2) {
170-
MUtils.chat("&cInvalid arguments, use /club house <index> username <username>");
170+
UChat.chat("&cInvalid arguments, use /club house <index> username <username>");
171171
return;
172172
}
173173

@@ -197,7 +197,7 @@ public void house(int index, @Greedy String args) {
197197
@SubCommand(aliases = {"list"})
198198
public void list() {
199199
if (!Socket.linked) {
200-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
200+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
201201
return;
202202
}
203203
try {
@@ -206,7 +206,7 @@ public void list() {
206206
+ "&key=" + Socket.serverId);
207207
JSONObject clubData = new JSONObject(s);
208208
if (!clubData.getBoolean("success")) {
209-
MUtils.chat(HysentialsConfig.chatPrefix + " &c" + clubData.getString("message"));
209+
UChat.chat(HysentialsConfig.chatPrefix + " &c" + clubData.getString("message"));
210210
return;
211211
}
212212
JSONObject club = clubData.getJSONObject("club");
@@ -219,11 +219,11 @@ public void list() {
219219
userMap.put(uuid, name);
220220
}
221221

222-
MUtils.chat(HysentialsConfig.chatPrefix + " &aClub Members:");
222+
UChat.chat(HysentialsConfig.chatPrefix + " &aClub Members:");
223223
for (Map.Entry<String, String> displayName : userMap.entrySet()) {
224224
String uuid = displayName.getKey();
225225
String name = displayName.getValue();
226-
MUtils.chat(" - &a" + name + (club.getString("owner").equals(uuid) ? " &8(Owner)" : ""));
226+
UChat.chat(" - &a" + name + (club.getString("owner").equals(uuid) ? " &8(Owner)" : ""));
227227
}
228228
});
229229
} catch (Exception e) {
@@ -234,7 +234,7 @@ public void list() {
234234
@SubCommand(aliases = {"invite"}, description = "Invite a player to your club.")
235235
public void invite(String name) {
236236
if (!Socket.linked) {
237-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
237+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
238238
return;
239239
}
240240
Multithreading.runAsync(() -> {
@@ -248,7 +248,7 @@ public void invite(String name) {
248248
@SubCommand(aliases = {"leave"}, description = "Leave a club.")
249249
public void leave() {
250250
if (!Socket.linked) {
251-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
251+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
252252
return;
253253
}
254254
Multithreading.runAsync(() -> {
@@ -262,7 +262,7 @@ public void leave() {
262262
@SubCommand(aliases = {"dashboard", "db"}, description = "Open the club dashboard.")
263263
public void dashboard() {
264264
if (!Socket.linked) {
265-
MUtils.chat("&cYou must be linked to a Discord account to use this feature.");
265+
UChat.chat("&cYou must be linked to a Discord account to use this feature.");
266266
return;
267267
}
268268
try {
@@ -271,7 +271,7 @@ public void dashboard() {
271271
+ "&key=" + Socket.serverId);
272272
JsonObject clubData = new JsonParser().parse(s).getAsJsonObject();
273273
if (!clubData.get("success").getAsBoolean()) {
274-
MUtils.chat(HysentialsConfig.chatPrefix + " &c" + clubData.get("message").getAsString());
274+
UChat.chat(HysentialsConfig.chatPrefix + " &c" + clubData.get("message").getAsString());
275275
return;
276276
}
277277
new ClubDashboard(clubData).open(Minecraft.getMinecraft().thePlayer);

src/main/java/llc/redstone/hysentials/command/GlobalChatCommand.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package llc.redstone.hysentials.command;
22

3+
import cc.polyfrost.oneconfig.libs.universal.UChat;
34
import llc.redstone.hysentials.Hysentials;
45
import llc.redstone.hysentials.config.hysentialMods.ChatConfig;
56
import llc.redstone.hysentials.util.BUtils;
6-
import llc.redstone.hysentials.util.MUtils;
77
import llc.redstone.hysentials.config.HysentialsConfig;
88
import llc.redstone.hysentials.websocket.Socket;
9-
import llc.redstone.hysentials.config.HysentialsConfig;
109
import net.minecraft.command.CommandBase;
1110
import net.minecraft.command.CommandException;
1211
import net.minecraft.command.ICommandSender;
@@ -40,15 +39,15 @@ public int getRequiredPermissionLevel() {
4039
@Override
4140
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
4241
if (!BUtils.isHypixelOrSBX()) {
43-
MUtils.chat(HysentialsConfig.chatPrefix + "&cYou are not on a Hypixel server!");
42+
UChat.chat(HysentialsConfig.chatPrefix + "&cYou are not on a Hypixel server!");
4443
return;
4544
}
4645
if (!ChatConfig.globalChat || !Hysentials.INSTANCE.getConfig().chatConfig.enabled) {
47-
MUtils.chat(HysentialsConfig.chatPrefix + "&cGlobal chat is disabled!");
46+
UChat.chat(HysentialsConfig.chatPrefix + "&cGlobal chat is disabled!");
4847
return;
4948
}
5049
if (args.length == 0) {
51-
MUtils.chat(HysentialsConfig.chatPrefix + "&cInvalid usage! /globalchat <message>");
50+
UChat.chat(HysentialsConfig.chatPrefix + "&cInvalid usage! /globalchat <message>");
5251
return;
5352
}
5453

src/main/java/llc/redstone/hysentials/command/GlowCommand.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package llc.redstone.hysentials.command;
22

3-
import llc.redstone.hysentials.util.MUtils;
3+
import cc.polyfrost.oneconfig.libs.universal.UChat;
44
import llc.redstone.hysentials.guis.container.GuiItem;
5-
import llc.redstone.hysentials.util.Material;
65
import net.minecraft.client.Minecraft;
7-
import net.minecraft.client.gui.inventory.GuiContainer;
8-
import net.minecraft.client.renderer.ItemRenderer;
96
import net.minecraft.command.CommandBase;
107
import net.minecraft.command.ICommandSender;
118
import net.minecraft.enchantment.Enchantment;
12-
import net.minecraft.item.Item;
139
import net.minecraft.item.ItemStack;
1410

1511
public class GlowCommand extends CommandBase {
@@ -32,18 +28,18 @@ public String getCommandUsage(ICommandSender sender) {
3228
public void processCommand(ICommandSender sender, String[] args) {
3329
ItemStack item = Minecraft.getMinecraft().thePlayer.getHeldItem();
3430
if (item == null || item.getItem() == null) {
35-
MUtils.chat("§cYou must be holding an item!");
31+
UChat.chat("§cYou must be holding an item!");
3632
return;
3733
}
3834
if (!Minecraft.getMinecraft().playerController.getCurrentGameType().isCreative()) {
39-
MUtils.chat("§cYou must be in creative mode!");
35+
UChat.chat("§cYou must be in creative mode!");
4036
return;
4137
}
4238
item = item.copy();
4339
item.addEnchantment(Enchantment.lure, 10);
4440
GuiItem.hideFlag(item, 1);
4541
GuiItem.setEnchanted(item, true);
4642
RenameCommand.setCreativeAction(item, Minecraft.getMinecraft().thePlayer.inventory.currentItem);
47-
MUtils.chat("§aAdded glow to the item successfully!");
43+
UChat.chat("§aAdded glow to the item successfully!");
4844
}
4945
}

src/main/java/llc/redstone/hysentials/command/HypixelChatCommand.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package llc.redstone.hysentials.command;
22

3+
import cc.polyfrost.oneconfig.libs.universal.UChat;
34
import llc.redstone.hysentials.config.hysentialMods.ChatConfig;
45
import llc.redstone.hysentials.handlers.chat.modules.bwranks.BWSReplace;
56
import llc.redstone.hysentials.util.BUtils;
6-
import llc.redstone.hysentials.util.MUtils;
7-
import cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils;
87
import llc.redstone.hysentials.Hysentials;
9-
import llc.redstone.hysentials.config.HysentialsConfig;
10-
import llc.redstone.hysentials.Hysentials;
11-
import llc.redstone.hysentials.handlers.chat.modules.bwranks.BWSReplace;
128
import net.minecraft.client.Minecraft;
139
import net.minecraft.command.CommandBase;
1410
import net.minecraft.command.CommandException;
@@ -44,8 +40,8 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
4440
return;
4541
}
4642
if (args.length == 0) {
47-
MUtils.chat("&cInvalid usage! /chat <channel>");
48-
MUtils.chat("&cValid channels: " + String.join(", ", chats));
43+
UChat.chat("&cInvalid usage! /chat <channel>");
44+
UChat.chat("&cValid channels: " + String.join(", ", chats));
4945
return;
5046
}
5147
boolean enabled = ChatConfig.globalChat && Hysentials.INSTANCE.getConfig().chatConfig.enabled;
@@ -57,16 +53,16 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
5753
if ((command.equals("global") || command.equals("gl")) && enabled) {
5854
if (isInGlobalChat) {
5955
BWSReplace.diagnostics.add("Already in Global Chat");
60-
MUtils.chat("&cYou're already in this channel!");
56+
UChat.chat("&cYou're already in this channel!");
6157
} else {
6258
isInGlobalChat = true;
6359
BWSReplace.diagnostics.add("Global Chat set to true");
64-
MUtils.chat("&aYou are now in the &6GLOBAL &achannel!");
60+
UChat.chat("&aYou are now in the &6GLOBAL &achannel!");
6561
}
6662
} else {
6763
String finalCommand = command;
6864
if (chats.stream().noneMatch(c -> c.toLowerCase().equals(finalCommand)) && !chatAliases.contains(command)) {
69-
MUtils.chat("&cInvalid Channel! Valid channels: " + String.join(", ", chats));
65+
UChat.chat("&cInvalid Channel! Valid channels: " + String.join(", ", chats));
7066
} else {
7167
if (isInGlobalChat) {
7268
if (chatAliases.contains(command)) {

0 commit comments

Comments
 (0)