Skip to content

Commit 7cad165

Browse files
committed
beta2
1 parent 9aa01fd commit 7cad165

File tree

160 files changed

+3522
-2376
lines changed

Some content is hidden

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

160 files changed

+3522
-2376
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ org.gradle.jvmargs=-Xmx2G
66

77
mod_name = Hysentials
88
mod_id = hysentials
9-
mod_version = 1.1.0-beta1
9+
mod_version = 1.1.0-beta2
1010

1111
loom.platform = forge

src/dummy/java/cc/woverflow/chatting/chat/ChatTab.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*/
18-
19-
package cc.woverflow.chatting.chat;
17+
*/package cc.woverflow.chatting.chat;
2018

2119
import java.util.List;
2220

src/dummy/java/cc/woverflow/chatting/chat/ChatTabs.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*/
18-
19-
package cc.woverflow.chatting.chat;
17+
*/package cc.woverflow.chatting.chat;
2018

2119
import java.util.ArrayList;
2220

src/dummy/java/cc/woverflow/chatting/config/ChattingConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*/
18-
19-
package cc.woverflow.chatting.config;
17+
*/package cc.woverflow.chatting.config;
2018

2119
public class ChattingConfig {
2220
public static ChattingConfig INSTANCE = new ChattingConfig();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package cc.woverflow.hytils;
2+
3+
import cc.woverflow.hytils.config.HytilsConfig;
4+
5+
public class HytilsReborn {
6+
public static HytilsReborn INSTANCE = new HytilsReborn();
7+
8+
public HytilsConfig getConfig() {
9+
return null;
10+
}
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package cc.woverflow.hytils.config;
2+
3+
public class HytilsConfig {
4+
public void openGui() {
5+
throw new RuntimeException("Stub!");
6+
}
7+
}

src/dummy/java/net/optifine/render/RenderEnv.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*/
18-
19-
package net.optifine.render;
17+
*/package net.optifine.render;
2018

2119
public class RenderEnv {
2220
}

src/main/java/cc/woverflow/hysentials/Hysentials.java

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
/*
2-
* Hytils Reborn - Hypixel focused Quality of Life mod.
3-
* Copyright (C) 2022 W-OVERFLOW
4-
*
5-
* This program is free software: you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License as published by
7-
* the Free Software Foundation, either version 3 of the License, or
8-
* (at your option) any later version.
9-
*
10-
* This program is distributed in the hope that it will be useful,
11-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
* GNU General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
*/
18-
191
package cc.woverflow.hysentials;
202

213
import cc.polyfrost.oneconfig.events.EventManager;
224
import cc.polyfrost.oneconfig.libs.universal.ChatColor;
235
import cc.polyfrost.oneconfig.libs.universal.UChat;
6+
import cc.woverflow.hysentials.guis.club.ClubDashboardHandler;
7+
import cc.woverflow.hysentials.handlers.chat.modules.misc.Limit256;
8+
import cc.woverflow.hysentials.util.MUtils;
249
import cc.polyfrost.oneconfig.utils.commands.CommandManager;
2510
import cc.woverflow.hysentials.command.*;
2611
import cc.woverflow.hysentials.config.HysentialsConfig;
@@ -30,29 +15,31 @@
3015
import cc.woverflow.hysentials.guis.club.ClubDashboard;
3116
import cc.woverflow.hysentials.guis.gameMenu.RevampedGameMenu;
3217
import cc.woverflow.hysentials.guis.misc.PlayerInvHandler;
33-
import cc.woverflow.hysentials.guis.misc.PlayerInventory;
3418
import cc.woverflow.hysentials.guis.sbBoxes.SBBoxesEditor;
3519
import cc.woverflow.hysentials.handlers.cache.HeightHandler;
3620
import cc.woverflow.hysentials.handlers.chat.ChatHandler;
21+
import cc.woverflow.hysentials.handlers.chat.modules.bwranks.BWSReplace;
3722
import cc.woverflow.hysentials.handlers.display.GuiDisplayHandler;
3823
import cc.woverflow.hysentials.handlers.guis.GameMenuOpen;
3924
import cc.woverflow.hysentials.handlers.htsl.*;
4025
import cc.woverflow.hysentials.handlers.imageicons.ImageIcon;
4126
import cc.woverflow.hysentials.handlers.language.LanguageHandler;
4227
import cc.woverflow.hysentials.handlers.lobby.HousingLagReducer;
4328
import cc.woverflow.hysentials.handlers.lobby.LobbyChecker;
29+
import cc.woverflow.hysentials.handlers.npc.QuestNPC;
4430
import cc.woverflow.hysentials.handlers.redworks.BwRanks;
4531
import cc.woverflow.hysentials.handlers.redworks.NeighborInstall;
4632
import cc.woverflow.hysentials.handlers.sbb.Actionbar;
4733
import cc.woverflow.hysentials.handlers.sbb.SbbRenderer;
34+
import cc.woverflow.hysentials.htsl.Cluster;
4835
import cc.woverflow.hysentials.pets.cubit.CubitCompanion;
4936
import cc.woverflow.hysentials.pets.hamster.HamsterCompanion;
5037
import cc.woverflow.hysentials.util.*;
5138
import cc.woverflow.hysentials.util.blockw.OnlineCache;
52-
import cc.woverflow.hysentials.util.friends.FriendCache;
53-
import cc.woverflow.hysentials.util.skyblock.SkyblockChecker;
5439
import cc.woverflow.hysentials.websocket.Socket;
40+
import cc.woverflow.hytils.util.friends.FriendCache;
5541
import net.minecraft.client.Minecraft;
42+
import net.minecraft.client.gui.FontRenderer;
5643
import net.minecraft.util.ResourceLocation;
5744
import net.minecraftforge.client.ClientCommandHandler;
5845
import net.minecraftforge.common.MinecraftForge;
@@ -71,8 +58,10 @@
7158
import javax.net.ssl.HttpsURLConnection;
7259
import javax.net.ssl.SSLContext;
7360
import java.io.*;
61+
import java.lang.reflect.Field;
7462
import java.net.HttpURLConnection;
7563
import java.net.URL;
64+
import java.nio.charset.Charset;
7665
import java.nio.charset.StandardCharsets;
7766

7867
@Mod(
@@ -91,11 +80,9 @@ public class Hysentials {
9180
public File modDir = new File("OVERFLOW", MOD_NAME);
9281

9382
private HysentialsConfig config;
94-
private final Logger logger = LogManager.getLogger("Hytils Reborn");
83+
private final Logger logger = LogManager.getLogger("Hysentials");
9584

9685
private final LanguageHandler languageHandler = new LanguageHandler();
97-
private final SkyblockChecker skyblockChecker = new SkyblockChecker();
98-
private final FriendCache friendCache = new FriendCache();
9986
private final OnlineCache onlineCache = new OnlineCache();
10087

10188
private final LobbyChecker lobbyChecker = new LobbyChecker();
@@ -108,6 +95,7 @@ public class Hysentials {
10895
public JsonData rankColors;
10996
public boolean isPatcher;
11097
public boolean isChatting;
98+
public boolean isHytils;
11199
private boolean loadedCall;
112100

113101
public DiscordRPC discordRPC;
@@ -128,8 +116,22 @@ public void onFMLPreInitialization(FMLPreInitializationEvent event) {
128116
@Mod.EventHandler
129117
public void init(FMLInitializationEvent event) {
130118
config = new HysentialsConfig();
119+
File file = new File(modDir, "./config/hysentials");
120+
if (!file.exists() && !file.mkdirs()) {
121+
throw new RuntimeException("Failed to create config directory! Please report this to sinender on Discord");
122+
}
131123
sbBoxes = new JsonData("./config/hysentials/lines.json", new JSONObject().put("lines", new JSONArray()));
132124
rankColors = new JsonData("/assets/minecraft/textures/icons/colors.json", "./config/hysentials/color.jsonn", true);
125+
126+
try {
127+
System.setProperty("file.encoding", "UTF-8");
128+
Field charset = Charset.class.getDeclaredField("defaultCharset");
129+
charset.setAccessible(true);
130+
charset.set(null, null);
131+
} catch (Exception e) {
132+
e.printStackTrace();
133+
}
134+
133135
try {
134136
SSLStore store = new SSLStore();
135137
store.load("/ssl/hysentials.der");
@@ -158,11 +160,13 @@ public void init(FMLInitializationEvent event) {
158160
CommandManager.INSTANCE.registerCommand(new ActionLibraryCommand());
159161
CommandManager.INSTANCE.registerCommand(new ClubCommand());
160162

161-
try {
162-
DiscordCore.init();
163-
discordRPC = new DiscordRPC();
164-
} catch (IOException e) {
165-
throw new RuntimeException(e);
163+
if (Socket.cachedServerData.has("rpc") && Socket.cachedServerData.getBoolean("rpc")) {
164+
try {
165+
DiscordCore.init();
166+
discordRPC = new DiscordRPC();
167+
} catch (IOException e) {
168+
throw new RuntimeException(e);
169+
}
166170
}
167171

168172
HeightHandler.INSTANCE.initialize();
@@ -174,15 +178,13 @@ public void init(FMLInitializationEvent event) {
174178
public void postInit(FMLPostInitializationEvent event) {
175179
isPatcher = Loader.isModLoaded("patcher");
176180
isChatting = Loader.isModLoaded("chatting");
181+
isHytils = Loader.isModLoaded("hytils-reborn");
177182
chatHandler.init();
178183

179-
rank = HypixelAPIUtils.getRank(Minecraft.getMinecraft().getSession().getUsername());
180-
181184
Socket.createSocket();
182185
registerImages();
183186
cc.woverflow.hysentials.htsl.Loader.registerLoaders();
184-
185-
// doorbellBot = new DoorbellBot();
187+
Cluster.registerClusters();
186188

187189
MinecraftForge.EVENT_BUS.post(new HysentialsLoadedEvent());
188190
}
@@ -192,7 +194,7 @@ public void finishedStarting(FMLLoadCompleteEvent event) {
192194
this.loadedCall = true;
193195
}
194196

195-
197+
public static FontRenderer minecraftFont;
196198
private void registerImages() {
197199
new ImageIcon("front", new ResourceLocation("textures/icons/front.png"));
198200
new ImageIcon("back", new ResourceLocation("textures/icons/back.png"));
@@ -202,6 +204,8 @@ private void registerImages() {
202204
new ImageIcon("party", new ResourceLocation("textures/icons/party.png"));
203205
new ImageIcon("to", new ResourceLocation("textures/icons/to.png"));
204206
new ImageIcon("from", new ResourceLocation("textures/icons/from.png"));
207+
new ImageIcon("team", new ResourceLocation("textures/icons/team.png"));
208+
new ImageIcon("friend", new ResourceLocation("textures/icons/friend.png"));
205209

206210
for (HypixelRanks rank : HypixelRanks.values()) {
207211
try {
@@ -214,6 +218,7 @@ private void registerImages() {
214218
new ImageIcon(String.valueOf(i), new ResourceLocation("textures/icons/" + i + ".png"));
215219
}
216220
imageIconRenderer = new ImageIconRenderer();
221+
minecraftFont = Minecraft.getMinecraft().fontRendererObj;
217222
Minecraft.getMinecraft().fontRendererObj = imageIconRenderer;
218223
}
219224

@@ -244,10 +249,17 @@ private void registerHandlers() {
244249
eventBus.register(new Queue());
245250
eventBus.register(new Navigator());
246251
eventBus.register(new ActionGUIHandler());
252+
eventBus.register(new FunctionsGUIHandler());
247253
eventBus.register(new Exporter());
248254
eventBus.register(new HousingMenuHandler());
249-
eventBus.register(new ClubDashboard());
255+
eventBus.register(new ClubDashboardHandler());
250256
eventBus.register(new PlayerInvHandler());
257+
eventBus.register(new BWSReplace());
258+
eventBus.register(new QuestNPC());
259+
eventBus.register(new MUtils());
260+
eventBus.register(new Limit256());
261+
eventBus.register(cubitCompanion = new CubitCompanion());
262+
new Renderer();
251263

252264
// height overlay
253265
EventManager.INSTANCE.register(HeightHandler.INSTANCE);
@@ -262,7 +274,7 @@ private void registerHandlers() {
262274
}
263275

264276
public void sendMessage(String message) {
265-
UChat.chat(ChatColor.GOLD + "[" + MOD_NAME + "] " + ChatColor.Companion.translateAlternateColorCodes('&', message));
277+
UChat.chat(HysentialsConfig.chatPrefix + " " + ChatColor.Companion.translateAlternateColorCodes('&', message));
266278
}
267279

268280
public HysentialsConfig getConfig() {
@@ -293,14 +305,6 @@ public Logger getLogger() {
293305
return logger;
294306
}
295307

296-
public SkyblockChecker getSkyblockChecker() {
297-
return skyblockChecker;
298-
}
299-
300-
public FriendCache getFriendCache() {
301-
return friendCache;
302-
}
303-
304308
public OnlineCache getOnlineCache() {
305309
return onlineCache;
306310
}

0 commit comments

Comments
 (0)