Skip to content

Commit b0c6b38

Browse files
committed
Probably lots of things.
1 parent 4b0d346 commit b0c6b38

File tree

93 files changed

+2044
-1515
lines changed

Some content is hidden

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

93 files changed

+2044
-1515
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Hysentials
22

3+
// Now. I will make a command.

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ org.gradle.jvmargs=-Xmx8G
66

77
mod_name = Hysentials
88
mod_id = hysentials
9-
mod_version = 1.2.0-beta4
10-
dev_version = 1.2.0-dev
9+
mod_version = 1.2.1-beta1
10+
dev_version = 1.2.1-dev
1111

12-
dev = true
12+
dev = false
1313

1414
loom.platform = forge
1515

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ else if (renderExperiance)
188188
GlStateManager.disableLighting();
189189
GlStateManager.enableAlpha();
190190

191-
if (HysentialsConfig.macroWheelKeyBind.isActive() && mc.currentScreen == null) {
191+
if (HysentialsConfig.macroWheelKeyBind.isActive() && mc.currentScreen == null && cooldown < System.currentTimeMillis()) {
192192
if (!MacroWheelOverlayKt.getStopped()) {
193193
MacroWheelOverlay overlay = MacroWheelOverlay.Companion.newI();
194194
InputHandler inputHandler = new InputHandler();
@@ -215,11 +215,13 @@ else if (renderExperiance)
215215
if (Minecraft.getMinecraft().currentScreen == null) {
216216
Minecraft.getMinecraft().mouseHelper.grabMouseCursor();
217217
}
218+
cooldown = System.currentTimeMillis() + 1000;
218219
}
219220

220221
post(ALL);
221222
}
222223

224+
public static long cooldown = System.currentTimeMillis();
223225
public static boolean wasMacroWheelActive = false;
224226

225227
public void drawMacroWheel(MacroWheelOverlay overlay, float partialTicks, InputHandler inputHandler) {

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

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import cc.polyfrost.oneconfig.libs.universal.UChat;
77
import llc.redstone.hysentials.capes.CapeHandler;
88
import llc.redstone.hysentials.config.hysentialMods.FormattingConfig;
9+
import llc.redstone.hysentials.config.hysentialMods.IconsConfig;
10+
import llc.redstone.hysentials.config.hysentialMods.icons.IconStuff;
911
import llc.redstone.hysentials.cosmetic.CosmeticManager;
1012
import llc.redstone.hysentials.cosmetics.backpack.BackpackCosmetic;
1113
import llc.redstone.hysentials.cosmetics.hamster.HamsterCompanion;
@@ -21,6 +23,7 @@
2123
import llc.redstone.hysentials.handlers.chat.modules.misc.Limit256;
2224
import llc.redstone.hysentials.handlers.guis.GuiScreenPost;
2325
import llc.redstone.hysentials.handlers.htsl.*;
26+
import llc.redstone.hysentials.handlers.misc.HousingJoinHandler;
2427
import llc.redstone.hysentials.handlers.misc.QuestHandler;
2528
import llc.redstone.hysentials.handlers.redworks.FormatPlayerName;
2629
import llc.redstone.hysentials.macrowheel.MacroWheelData;
@@ -54,6 +57,7 @@
5457
import net.minecraft.client.gui.GuiMainMenu;
5558
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
5659
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
60+
import net.minecraft.command.ICommand;
5761
import net.minecraft.util.ResourceLocation;
5862
import net.minecraftforge.client.ClientCommandHandler;
5963
import net.minecraftforge.common.MinecraftForge;
@@ -77,6 +81,8 @@
7781
import java.net.URL;
7882
import java.nio.charset.Charset;
7983
import java.nio.charset.StandardCharsets;
84+
import java.util.ArrayList;
85+
import java.util.List;
8086

8187
@Mod(
8288
modid = Hysentials.MOD_ID,
@@ -106,6 +112,7 @@ public class Hysentials {
106112

107113
public final GuiDisplayHandler guiDisplayHandler = new GuiDisplayHandler();
108114
public final CosmeticManager cosmeticManager = new CosmeticManager();
115+
public static List<ICommand> commands;
109116

110117
public ImageIconRenderer imageIconRenderer;
111118
public JsonData sbBoxes;
@@ -140,7 +147,9 @@ public void onFMLPreInitialization(FMLPreInitializationEvent event) {
140147

141148
@Mod.EventHandler
142149
public void init(FMLInitializationEvent event) {
150+
registerImages();
143151
config = new HysentialsConfig();
152+
updateAndAdd();
144153
File file = new File(modDir, "./config/hysentials");
145154
if (!file.exists() && !file.mkdirs()) {
146155
throw new RuntimeException("Failed to create config directory! Please report this to sinender on Discord");
@@ -172,22 +181,27 @@ public void init(FMLInitializationEvent event) {
172181
Socket.createSocket();
173182

174183
CommandManager.INSTANCE.registerCommand(new GroupChatCommand());
175-
ClientCommandHandler.instance.registerCommand(new HysentialsCommand());
176-
ClientCommandHandler.instance.registerCommand(new GlobalChatCommand());
177-
ClientCommandHandler.instance.registerCommand(new HypixelChatCommand());
178-
ClientCommandHandler.instance.registerCommand(new VisitCommand());
179-
ClientCommandHandler.instance.registerCommand(new VisitPlayerCommand());
180-
ClientCommandHandler.instance.registerCommand(new RemoveGlowCommand());
181-
ClientCommandHandler.instance.registerCommand(new GlowCommand());
182-
ClientCommandHandler.instance.registerCommand(new SetLoreLineCommand());
183-
ClientCommandHandler.instance.registerCommand(new RenameCommand());
184-
ClientCommandHandler.instance.registerCommand(new RemoveNameCommand());
185-
ClientCommandHandler.instance.registerCommand(new InsertLoreLineCommand());
186-
ClientCommandHandler.instance.registerCommand(new RemoveLoreLineCommand());
187-
ClientCommandHandler.instance.registerCommand(new OpenInvCommand());
188-
ClientCommandHandler.instance.registerCommand(new SetTextureCommand());
189-
ClientCommandHandler.instance.registerCommand(new HymojiCommand());
190-
ClientCommandHandler.instance.registerCommand(new ClaimCommand());
184+
commands = new ArrayList<>();
185+
commands.add(new HysentialsCommand());
186+
commands.add(new GlobalChatCommand());
187+
commands.add(new HypixelChatCommand());
188+
commands.add(new VisitCommand());
189+
commands.add(new VisitPlayerCommand());
190+
commands.add(new RemoveGlowCommand());
191+
commands.add(new QwestiiTestCommand());
192+
commands.add(new GlowCommand());
193+
commands.add(new SetLoreLineCommand());
194+
commands.add(new RenameCommand());
195+
commands.add(new RemoveNameCommand());
196+
commands.add(new InsertLoreLineCommand());
197+
commands.add(new RemoveLoreLineCommand());
198+
commands.add(new OpenInvCommand());
199+
commands.add(new SetTextureCommand());
200+
commands.add(new HymojiCommand());
201+
commands.add(new ClaimCommand());
202+
for (ICommand command : commands) {
203+
ClientCommandHandler.instance.registerCommand(command);
204+
}
191205
CommandManager.INSTANCE.registerCommand(new SBBoxesCommand());
192206
CommandManager.INSTANCE.registerCommand(new ActionLibraryCommand());
193207
CommandManager.INSTANCE.registerCommand(new ClubCommand());
@@ -209,7 +223,12 @@ public void postInit(FMLPostInitializationEvent event) {
209223
isHytils = Loader.isModLoaded("hytils-reborn");
210224
chatHandler.init();
211225

212-
registerImages();
226+
imageIconRenderer = new ImageIconRenderer();
227+
minecraftFont = Minecraft.getMinecraft().fontRendererObj;
228+
if (FormattingConfig.fancyRendering()) {
229+
Minecraft.getMinecraft().fontRendererObj = imageIconRenderer;
230+
}
231+
213232
llc.redstone.hysentials.htsl.Loader.registerLoaders();
214233
Cluster.registerClusters();
215234

@@ -218,6 +237,10 @@ public void postInit(FMLPostInitializationEvent event) {
218237

219238
LayerArmorBase armorBase;
220239
LayerBipedArmor bipedArmor;
240+
241+
if (config.macroWheelHud.position.getX() == 0 && config.macroWheelHud.position.getY() == 0) {
242+
config.macroWheelHud.position.setPosition((Renderer.screen.getWidth() / 2f) - (34*5f) / 2, (Renderer.screen.getHeight() / 2f) - (34*5f) / 2);
243+
}
221244
}
222245

223246
@Mod.EventHandler
@@ -226,6 +249,26 @@ public void finishedStarting(FMLLoadCompleteEvent event) {
226249
}
227250

228251
public static FontRenderer minecraftFont;
252+
253+
public static void updateAndAdd() {
254+
try {
255+
for (ImageIcon icon : ImageIcon.imageIcons.values()) {
256+
icon.handleImageIcon();
257+
}
258+
} catch (Exception e) {
259+
throw new RuntimeException(e);
260+
}
261+
262+
for (IconStuff icon : Hysentials.INSTANCE.config.iconsConfig.icons) {
263+
if (icon.custom) {
264+
if (icon.localPath == null || icon.name.isEmpty() || ImageIcon.imageIcons.containsKey(icon.name)) continue;
265+
ImageIcon icon1 = new ImageIcon(icon.name, null, false);
266+
icon1.width = icon.width;
267+
icon1.height = icon.height;
268+
}
269+
}
270+
}
271+
229272
private void registerImages() {
230273
new ImageIcon("front", new ResourceLocation("textures/icons/front.png"));
231274
new ImageIcon("back", new ResourceLocation("textures/icons/back.png"));
@@ -323,11 +366,6 @@ private void registerImages() {
323366
for (int i = 0; i < 10; i++) {
324367
new ImageIcon(String.valueOf(i), new ResourceLocation("textures/icons/" + i + ".png"));
325368
}
326-
imageIconRenderer = new ImageIconRenderer();
327-
minecraftFont = Minecraft.getMinecraft().fontRendererObj;
328-
if (FormattingConfig.fancyRendering()) {
329-
Minecraft.getMinecraft().fontRendererObj = imageIconRenderer;
330-
}
331369
}
332370

333371
private void registerHandlers() {
@@ -352,6 +390,7 @@ private void registerHandlers() {
352390
eventBus.register(new SbbRenderer());
353391
eventBus.register(new llc.redstone.hysentials.handlers.SbbRenderer());
354392
eventBus.register(new GuiScreenPost());
393+
eventBus.register(new HousingJoinHandler());
355394

356395

357396
eventBus.register(new Actionbar());

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import llc.redstone.hysentials.Hysentials;
44
import llc.redstone.hysentials.cosmetic.CosmeticGui;
5+
import llc.redstone.hysentials.cosmetic.CosmeticUtilsKt;
56
import llc.redstone.hysentials.schema.HysentialsSchema;
67
import llc.redstone.hysentials.websocket.Socket;
78
import llc.redstone.hysentials.cosmetic.CosmeticGui;
@@ -30,11 +31,11 @@ public void onTickEvent(TickEvent.ClientTickEvent event) {
3031
for (String id : Socket.cachedUsersNew.keySet()) {
3132
UUID uuid = UUID.fromString(id);
3233
boolean wearingCape = false;
33-
for (HysentialsSchema.Cosmetic cosmetic : CosmeticGui.Companion.getEquippedCosmetics(uuid)) {
34+
for (HysentialsSchema.Cosmetic cosmetic : CosmeticUtilsKt.getEquippedCosmetics(uuid)) {
3435
if (cosmetic.getSubType() != null && cosmetic.getSubType().equals("cape")) {
3536
wearingCape = true;
3637
String name = cosmetic.getName();
37-
if (CosmeticGui.Companion.hasCosmetic(uuid, name)) {
38+
if (CosmeticUtilsKt.hasCosmetic(uuid, name)) {
3839
ResourceLocation location = new ResourceLocation(cosmetic.getResource());
3940
resourceMap.put(uuid, cosmetic.getResource());
4041
try {

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

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

33
import llc.redstone.hysentials.config.HysentialsConfig;
4+
import llc.redstone.hysentials.config.hysentialMods.CosmeticConfig;
45
import llc.redstone.hysentials.cosmetic.CosmeticGui;
56
import llc.redstone.hysentials.util.BlockWAPIUtils;
67
import llc.redstone.hysentials.config.HysentialsConfig;
@@ -51,9 +52,9 @@ public void doRenderLayer(AbstractClientPlayer abstractClientPlayer, float param
5152

5253
if (!abstractClientPlayer.hasPlayerInfo() || abstractClientPlayer.isInvisible()
5354
|| !abstractClientPlayer.isWearing(EnumPlayerModelParts.CAPE)
55+
|| (BlockWAPIUtils.isWearingType(abstractClientPlayer.getUniqueID(), "backpack"))
5456
|| abstractClientPlayer.getLocationCape() == null
55-
|| BlockWAPIUtils.isWearingType(abstractClientPlayer.getUniqueID(), "backpack")
56-
|| HysentialsConfig.disableCustomCapes) {
57+
|| CosmeticConfig.disableCustomCapes) {
5758
return;
5859
}
5960

@@ -67,7 +68,7 @@ public void doRenderLayer(AbstractClientPlayer abstractClientPlayer, float param
6768
GlStateManager.bindTexture(CapeHandler.textureMap.get(abstractClientPlayer.getUniqueID()).getGlTextureId());
6869
}
6970

70-
if (HysentialsConfig.blockyCapes == 1) {
71+
if (CosmeticConfig.blockyCapes == 1) {
7172
smoothCapeRenderer.renderSmoothCape(this, abstractClientPlayer, deltaTick);
7273
} else {
7374
ModelRenderer[] parts = customCape;
@@ -166,7 +167,7 @@ void modifyPoseStackVanilla(AbstractClientPlayer abstractClientPlayer, float h,
166167
}
167168

168169
float getNatrualWindSwing(int part) {
169-
if (HysentialsConfig.windEffect) {
170+
if (CosmeticConfig.windEffect) {
170171
long highlightedPart = (System.currentTimeMillis() / 3) % 360;
171172
float relativePart = (float) (part + 1) / partCount;
172173
return (float) (Math.sin(Math.toRadians((relativePart) * 360 - (highlightedPart))) * 3);

0 commit comments

Comments
 (0)