Skip to content

Commit 4b0d346

Browse files
committed
Macrowheel, Config updates, sbb fixes, team icons, container utils, bug fixes, crash fixes
1 parent 381a0a8 commit 4b0d346

File tree

76 files changed

+1836
-475
lines changed

Some content is hidden

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

76 files changed

+1836
-475
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ group = "net.sinender"
1919
archivesBaseName = mod_name
2020

2121
blossom {
22-
String className = "src/main/java/cc/woverflow/hysentials/Hysentials.java"
22+
String className = "src/main/java/llc/redstone/hysentials/Hysentials.java"
2323
replaceToken("@VER@", project.version, className)
2424
replaceToken("@NAME@", mod_name, className)
2525
replaceToken("@ID@", mod_id, className)

gradle.properties

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

77
mod_name = Hysentials
88
mod_id = hysentials
9-
mod_version = 1.2.0-beta3
9+
mod_version = 1.2.0-beta4
1010
dev_version = 1.2.0-dev
1111

1212
dev = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package cc.polyfrost.oneconfig.internal.hud;
2+
3+
public class HudCore {
4+
public static boolean editing = false;
5+
}

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

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
import java.util.ArrayList;
77
import java.util.List;
88

9+
import cc.polyfrost.oneconfig.libs.universal.UResolution;
10+
import cc.polyfrost.oneconfig.renderer.NanoVGHelper;
11+
import cc.polyfrost.oneconfig.utils.InputHandler;
912
import llc.redstone.hysentials.config.HysentialsConfig;
1013
import llc.redstone.hysentials.guis.hsplayerlist.GuiOnlineList;
1114
import llc.redstone.hysentials.config.HysentialsConfig;
15+
import llc.redstone.hysentials.macrowheel.overlay.MacroWheelOverlay;
16+
import llc.redstone.hysentials.macrowheel.overlay.MacroWheelOverlayKt;
17+
import llc.redstone.hysentials.util.Input;
1218
import net.minecraft.block.material.Material;
1319
import net.minecraft.client.Minecraft;
1420
import net.minecraft.client.gui.FontRenderer;
@@ -17,6 +23,7 @@
1723
import net.minecraft.client.gui.GuiOverlayDebug;
1824
import net.minecraft.client.gui.ScaledResolution;
1925
import net.minecraft.client.network.NetHandlerPlayClient;
26+
import net.minecraft.client.renderer.EntityRenderer;
2027
import net.minecraft.client.renderer.GlStateManager;
2128
import net.minecraft.client.renderer.OpenGlHelper;
2229
import net.minecraft.client.resources.I18n;
@@ -32,17 +39,15 @@
3239
import net.minecraft.scoreboard.ScoreObjective;
3340
import net.minecraft.scoreboard.ScorePlayerTeam;
3441
import net.minecraft.scoreboard.Scoreboard;
35-
import net.minecraft.util.EnumChatFormatting;
36-
import net.minecraft.util.FoodStats;
37-
import net.minecraft.util.MathHelper;
38-
import net.minecraft.util.ResourceLocation;
39-
import net.minecraft.util.StringUtils;
42+
import net.minecraft.util.*;
4043
import net.minecraftforge.client.GuiIngameForge;
44+
import net.minecraftforge.client.event.GuiScreenEvent;
4145
import net.minecraftforge.client.event.RenderGameOverlayEvent;
4246
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
4347
import net.minecraftforge.common.ForgeHooks;
4448
import net.minecraftforge.common.MinecraftForge;
4549

50+
import org.lwjgl.input.Mouse;
4651
import org.lwjgl.opengl.GL11;
4752

4853
public class GuiIngameHysentials extends GuiIngame
@@ -183,9 +188,50 @@ else if (renderExperiance)
183188
GlStateManager.disableLighting();
184189
GlStateManager.enableAlpha();
185190

191+
if (HysentialsConfig.macroWheelKeyBind.isActive() && mc.currentScreen == null) {
192+
if (!MacroWheelOverlayKt.getStopped()) {
193+
MacroWheelOverlay overlay = MacroWheelOverlay.Companion.newI();
194+
InputHandler inputHandler = new InputHandler();
195+
inputHandler.scale(UResolution.getScaleFactor(), UResolution.getScaleFactor());
196+
if (!wasMacroWheelActive) {
197+
Minecraft.getMinecraft().mouseHelper.ungrabMouseCursor();
198+
Minecraft.getMinecraft().mouseHelper.deltaX = 0;
199+
Minecraft.getMinecraft().mouseHelper.deltaY = 0;
200+
wasMacroWheelActive = true;
201+
}
202+
drawMacroWheel(overlay, partialTicks, inputHandler);
203+
final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
204+
int i1 = scaledresolution.getScaledWidth();
205+
int j1 = scaledresolution.getScaledHeight();
206+
final int k1 = Mouse.getX() * i1 / this.mc.displayWidth;
207+
final int l1 = j1 - Mouse.getY() * j1 / this.mc.displayHeight - 1;
208+
drawPostMacroWheel(overlay, new GuiScreenEvent.DrawScreenEvent.Post(
209+
null, k1, l1, partialTicks
210+
), inputHandler);
211+
}
212+
} else if (wasMacroWheelActive || MacroWheelOverlayKt.getStopped()) {
213+
MacroWheelOverlayKt.setStopped(false);
214+
wasMacroWheelActive = false;
215+
if (Minecraft.getMinecraft().currentScreen == null) {
216+
Minecraft.getMinecraft().mouseHelper.grabMouseCursor();
217+
}
218+
}
219+
186220
post(ALL);
187221
}
188222

223+
public static boolean wasMacroWheelActive = false;
224+
225+
public void drawMacroWheel(MacroWheelOverlay overlay, float partialTicks, InputHandler inputHandler) {
226+
NanoVGHelper.INSTANCE.setupAndDraw(true, (vg) -> {
227+
overlay.draw(vg, partialTicks, inputHandler);
228+
});
229+
}
230+
231+
public void drawPostMacroWheel(MacroWheelOverlay overlay, GuiScreenEvent.DrawScreenEvent.Post event, InputHandler inputHandler) {
232+
overlay.drawPost(event, inputHandler);
233+
}
234+
189235
public ScaledResolution getResolution()
190236
{
191237
return res;
@@ -798,7 +844,7 @@ protected void renderPlayerList(int width, int height)
798844

799845
protected boolean renderHysentialsPlayerList(int width, int height)
800846
{
801-
if (HysentialsConfig.onlinePlayersKeyBind.isActive()) {
847+
if (HysentialsConfig.onlinePlayersKeyBind.isActive() && Minecraft.getMinecraft().currentScreen == null) {
802848
hysentialsOnlineList.updatePlayerList(true);
803849
ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft());
804850
hysentialsOnlineList.renderPlayerlist(res.getScaledWidth());

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

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

33
import cc.polyfrost.oneconfig.events.EventManager;
4+
import cc.polyfrost.oneconfig.internal.hud.HudCore;
45
import cc.polyfrost.oneconfig.libs.universal.ChatColor;
56
import cc.polyfrost.oneconfig.libs.universal.UChat;
67
import llc.redstone.hysentials.capes.CapeHandler;
@@ -9,7 +10,6 @@
910
import llc.redstone.hysentials.cosmetics.backpack.BackpackCosmetic;
1011
import llc.redstone.hysentials.cosmetics.hamster.HamsterCompanion;
1112
import llc.redstone.hysentials.cosmetics.hats.blackcat.BlackCat;
12-
import llc.redstone.hysentials.cosmetics.hats.blackcat.BlackCatModel;
1313
import llc.redstone.hysentials.cosmetics.hats.blackcat.LayerBlackCatHat;
1414
import llc.redstone.hysentials.cosmetics.hats.cat.CatHat;
1515
import llc.redstone.hysentials.cosmetics.kzero.KzeroBundle;
@@ -18,9 +18,8 @@
1818
import llc.redstone.hysentials.cosmetics.hats.technocrown.TechnoCrown;
1919
import llc.redstone.hysentials.guis.club.ClubDashboardHandler;
2020
import llc.redstone.hysentials.guis.container.ContainerHandler;
21-
import llc.redstone.hysentials.guis.hsplayerlist.GuiOnlineList;
22-
import llc.redstone.hysentials.guis.utils.SBBoxes;
2321
import llc.redstone.hysentials.handlers.chat.modules.misc.Limit256;
22+
import llc.redstone.hysentials.handlers.guis.GuiScreenPost;
2423
import llc.redstone.hysentials.handlers.htsl.*;
2524
import llc.redstone.hysentials.handlers.misc.QuestHandler;
2625
import llc.redstone.hysentials.handlers.redworks.FormatPlayerName;
@@ -40,7 +39,6 @@
4039
import llc.redstone.hysentials.handlers.chat.modules.bwranks.BWSReplace;
4140
import llc.redstone.hysentials.handlers.display.GuiDisplayHandler;
4241
import llc.redstone.hysentials.handlers.guis.GameMenuOpen;
43-
import llc.redstone.hysentials.handlers.htsl.*;
4442
import llc.redstone.hysentials.handlers.imageicons.ImageIcon;
4543
import llc.redstone.hysentials.handlers.language.LanguageHandler;
4644
import llc.redstone.hysentials.handlers.lobby.HousingLagReducer;
@@ -49,20 +47,8 @@
4947
import llc.redstone.hysentials.handlers.sbb.SbbRenderer;
5048
import llc.redstone.hysentials.htsl.Cluster;
5149
import llc.redstone.hysentials.cosmetics.cubit.CubitCompanion;
52-
import llc.redstone.hysentials.util.*;
5350
import llc.redstone.hysentials.util.blockw.OnlineCache;
5451
import llc.redstone.hysentials.websocket.Socket;
55-
import llc.redstone.hysentials.command.*;
56-
import llc.redstone.hysentials.config.HysentialsConfig;
57-
import llc.redstone.hysentials.cosmetics.hats.cat.CatHat;
58-
import llc.redstone.hysentials.cosmetics.hats.technocrown.TechnoCrown;
59-
import llc.redstone.hysentials.guis.ResolutionUtil;
60-
import llc.redstone.hysentials.guis.club.ClubDashboardHandler;
61-
import llc.redstone.hysentials.guis.misc.PlayerInvHandler;
62-
import llc.redstone.hysentials.handlers.imageicons.ImageIcon;
63-
import llc.redstone.hysentials.handlers.language.LanguageHandler;
64-
import llc.redstone.hysentials.handlers.redworks.BwRanks;
65-
import llc.redstone.hysentials.htsl.Cluster;
6652
import net.minecraft.client.Minecraft;
6753
import net.minecraft.client.gui.FontRenderer;
6854
import net.minecraft.client.gui.GuiMainMenu;
@@ -106,11 +92,12 @@ public class Hysentials {
10692
public static Hysentials INSTANCE;
10793
public static GuiMainMenu guiMainMenu;
10894
public static File jarFile;
95+
public static String lastMessage = "";
10996

11097
public static String modDir = "./config/hysentials";
11198

11299
private HysentialsConfig config;
113-
private final Logger logger = LogManager.getLogger("Hysentials");
100+
public static final Logger logger = LogManager.getLogger("Hysentials");
114101

115102
private final LanguageHandler languageHandler = new LanguageHandler();
116103
private final OnlineCache onlineCache = new OnlineCache();
@@ -257,6 +244,15 @@ private void registerImages() {
257244
new ImageIcon("legendary", new ResourceLocation("textures/icons/legendary.png"));
258245
new ImageIcon("exclusive", new ResourceLocation("textures/icons/exclusive.png"));
259246

247+
new ImageIcon("gray", new ResourceLocation("textures/icons/gray.png"));
248+
new ImageIcon("yellow", new ResourceLocation("textures/icons/yellow.png"));
249+
new ImageIcon("white", new ResourceLocation("textures/icons/white.png"));
250+
new ImageIcon("green", new ResourceLocation("textures/icons/green.png"));
251+
new ImageIcon("red", new ResourceLocation("textures/icons/red.png"));
252+
new ImageIcon("pink", new ResourceLocation("textures/icons/pink.png"));
253+
new ImageIcon("blue", new ResourceLocation("textures/icons/blue.png"));
254+
new ImageIcon("aqua", new ResourceLocation("textures/icons/aqua.png"));
255+
260256
new ImageIcon("moan", new ResourceLocation("textures/emoji/1005491490027487333.png"), true);
261257
new ImageIcon("super_neutral", new ResourceLocation("textures/emoji/1013063272473317377.png"), true);
262258
new ImageIcon("neutral", new ResourceLocation("textures/emoji/1013063271143714866.png"), true);
@@ -339,7 +335,6 @@ private void registerHandlers() {
339335
final llc.redstone.hysentials.event.EventBus hyBus = llc.redstone.hysentials.event.EventBus.INSTANCE;
340336
RevampedGameMenu.initGUI();
341337
SBBoxesEditor.initGUI();
342-
343338
// general stuff
344339
eventBus.register(languageHandler);
345340
// if (isChatting) {
@@ -356,6 +351,7 @@ private void registerHandlers() {
356351
eventBus.register(new GameMenuOpen());
357352
eventBus.register(new SbbRenderer());
358353
eventBus.register(new llc.redstone.hysentials.handlers.SbbRenderer());
354+
eventBus.register(new GuiScreenPost());
359355

360356

361357
eventBus.register(new Actionbar());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
4646
if (data.has("message")) {
4747
MUtils.chat(HysentialsConfig.chatPrefix + " " + data.get("message").toString());
4848
}
49-
Minecraft.getMinecraft().thePlayer.sendChatMessage("/claim");
49+
// Minecraft.getMinecraft().thePlayer.sendChatMessage("/claim");
5050
}
5151
}));
5252
}

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
120120
break;
121121
}
122122

123+
case "macrowheel": {
124+
new MacroWheelSelector().open();
125+
break;
126+
}
127+
123128
case "config": {
124129
Hysentials.INSTANCE.getConfig().openGui();
125130
break;
@@ -274,6 +279,7 @@ public void helpPage(int page) {
274279
text.appendText(pageS);
275280
text.appendText("&e/hysentials help <page> &b- &bShows this help page.\n");
276281
text.appendText("&e/hysentials config &b- &bOpens the Hysentials config.\n");
282+
text.appendText("&e/hysentials macrowheel &7- &bOpens the Macro Wheel Editor.\n");
277283
text.appendText("&e/hysentials reload &7- &bReloads the configs.\n");
278284
text.appendText("&e/hysentials reconnect &7- &bReconnects to the websocket.\n");
279285
text.appendText("&e/hysentials link &7- &bAccept a link request from discord.\n");
@@ -282,13 +288,13 @@ public void helpPage(int page) {
282288
text.appendText("&e/hysentials menu &7- &bOpens the Hysentials menu.\n");
283289
text.appendText("&e/hysentials discord &7- &bShows the discord invite link.\n");
284290
text.appendText("&e/hysentials editor <file> &7- &bOpens the HTSL code editor.\n");
285-
text.appendText("&e/hysentials import <file> &7- &bImports a HTSL action.\n");
286291
text.appendText("§9&m-----------------------------------------------------");
287292
break;
288293
}
289294
case 2: {
290295
String pageS = ChatLib.getCenteredText("&6Hysentials (Page 2/" + maxPage + ")\n");
291296
text.appendText(pageS);
297+
text.appendText("&e/hysentials import <file> &7- &bImports a HTSL action.\n");
292298
text.appendText("&e/globalchat <message> &7- &bSends a message to global chat.\n");
293299
text.appendText("&e/hysentials quests &7- &bOpens the Quests menu.\n");
294300
text.appendText("&e/sbboxes editor &7- &bOpens the Scoreboard Boxes editor.\n");
@@ -299,13 +305,13 @@ public void helpPage(int page) {
299305
text.appendText("&e/club join <name> &7- &bUsed to accept a club invite\n");
300306
text.appendText("&e/club leave &7- &bLeave your current club\n");
301307
text.appendText("&e/club dashboard &7- &bOpen the club dashboard\n");
302-
text.appendText("&e/club list &7- &bList all players in your club\n");
303308
text.appendText("§9&m-----------------------------------------------------");
304309
break;
305310
}
306311
case 3: {
307312
String pageS = ChatLib.getCenteredText("&6Hysentials (Page 3/" + maxPage + ")\n");
308313
text.appendText(pageS);
314+
text.appendText("&e/club list &7- &bList all players in your club\n");
309315
text.appendText("&e/glow &7- &bToggles the enchant glint on held item.\n");
310316
text.appendText("&e/removeglow &7- &bRemoves the enchant glint on held item.\n");
311317
text.appendText("&e/ill <line> <value> &7- &bInsert lore line.\n");
@@ -314,7 +320,7 @@ public void helpPage(int page) {
314320
text.appendText("&e/sll <line> <value> &7- &bSet lore line.\n");
315321
text.appendText("&e/rename <name> &7- &bSet name on held item.\n");
316322
text.appendText("&e/openinv <player> &7- &bView the held item and armor of a player.\n");
317-
//3 more can be added here
323+
//2 more can be added here
318324
text.appendText("§9&m-----------------------------------------------------");
319325
}
320326
}
@@ -325,7 +331,22 @@ public void helpPage(int page) {
325331
private static void handleTest(String command, String args) {
326332
if (Minecraft.getMinecraft().thePlayer.getName().equals("EndKloon") || Minecraft.getMinecraft().thePlayer.getName().equals("Sin_ender")) {
327333
switch (command.toLowerCase()) {
328-
334+
case "switch": {
335+
boolean isCurrentlyLocal = HysentialsUtilsKt.getHYSENTIALS_API().equals("http://localhost:8080/api");
336+
if (HysentialsUtilsKt.isLocalOn()) {
337+
HysentialsUtilsKt.setHYSENTIALS_API(!isCurrentlyLocal ? "ws://localhost:8080/ws" : "ws://backend.redstone.llc/ws");
338+
HysentialsUtilsKt.setWEBSOCKET(!isCurrentlyLocal ? "ws://localhost:8080/ws" : "ws://backend.redstone.llc/ws");
339+
Socket.CLIENT.sendClose();
340+
Socket.createSocket();
341+
} else if (isCurrentlyLocal) {
342+
HysentialsUtilsKt.setHYSENTIALS_API("http://backend.redstone.llc/api");
343+
HysentialsUtilsKt.setWEBSOCKET("ws://backend.redstone.llc/ws");
344+
Socket.CLIENT.sendClose();
345+
Socket.createSocket();
346+
} else {
347+
Hysentials.INSTANCE.sendMessage("&cLocal is not on and you are already on the main server!");
348+
}
349+
}
329350
case "doorbell": {
330351
Socket.CLIENT.sendText(
331352
new Request(

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

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

33
import cc.polyfrost.oneconfig.libs.universal.UChat;
4+
import llc.redstone.hysentials.Hysentials;
45
import llc.redstone.hysentials.guis.container.GuiItem;
56
import llc.redstone.hysentials.util.BUtils;
67
import llc.redstone.hysentials.util.C;
@@ -35,9 +36,22 @@ public List<String> getCommandAliases() {
3536
return Arrays.asList("insertll", "ill");
3637
}
3738

39+
public static boolean processRedirect(CommandBase commandBase, String[] args) {
40+
if (Hysentials.lastMessage != null && Hysentials.lastMessage.startsWith("/")) {
41+
String alias = Hysentials.lastMessage.split(" ")[0];
42+
if (alias.startsWith("/")) alias = alias.substring(1);
43+
if (alias.equals(commandBase.getCommandName()) || commandBase.getCommandAliases().contains(alias)) {
44+
Minecraft.getMinecraft().thePlayer.sendChatMessage("/" + alias + " " + String.join(" ", args));
45+
return true;
46+
}
47+
}
48+
return false;
49+
}
50+
3851
@Override
3952
public void processCommand(ICommandSender sender, String[] args) {
4053
if (!Minecraft.getMinecraft().playerController.getCurrentGameType().isCreative() || BUtils.isSBX()) {
54+
if (processRedirect(this, args)) return;
4155
Minecraft.getMinecraft().thePlayer.sendChatMessage("/insertloreline " + String.join(" ", args));
4256
return;
4357
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.util.Collections;
1818
import java.util.List;
1919

20+
import static llc.redstone.hysentials.command.InsertLoreLineCommand.processRedirect;
21+
2022
public class OpenInvCommand extends CommandBase {
2123
@Override
2224
public int getRequiredPermissionLevel() {
@@ -41,6 +43,7 @@ public List<String> getCommandAliases() {
4143
@Override
4244
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
4345
if (SbbRenderer.housingScoreboard.getHousingName() == null) {
46+
if (processRedirect(this, args)) return;
4447
Minecraft.getMinecraft().thePlayer.sendChatMessage("/openinv " + String.join(" ", args));
4548
return;
4649
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.util.HashMap;
2020
import java.util.List;
2121

22+
import static llc.redstone.hysentials.command.InsertLoreLineCommand.processRedirect;
23+
2224
public class RemoveGlowCommand extends CommandBase {
2325
@Override
2426
public int getRequiredPermissionLevel() {

0 commit comments

Comments
 (0)