Skip to content

Commit 10021f7

Browse files
committed
Update Checker fixes
New cosmetics Redid system for sbb Added emojis Added Set texture menu Quests Hyphone
1 parent a939e86 commit 10021f7

File tree

238 files changed

+7123
-1620
lines changed

Some content is hidden

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

238 files changed

+7123
-1620
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Hysentials
2-
Uses Hytils Reborn as a dependency/base
2+

build.gradle

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,10 @@ dependencies {
7878
}
7979
include('com.github.JnCrMx:discord-game-sdk4j:v0.5.5')
8080
include('com.neovisionaries:nv-websocket-client:2.14')
81-
compileOnly("gg.essential:elementa-1.8.9-forge:590") {
82-
exclude module: "asm"
83-
exclude module: "asm-commons"
84-
exclude module: "asm-tree"
85-
exclude module: "gson"
86-
}
81+
include('com.github.MinnDevelopment:java-discord-rpc:v2.0.2')
8782

8883
compileOnly('org.spongepowered:mixin:0.7.11-SNAPSHOT')
8984

90-
91-
compileOnly(files('libs/Hytils-Reborn-1.6.0-beta4.jar'))
9285
compileOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0")
9386
}
9487

@@ -142,6 +135,7 @@ jar {
142135
}
143136

144137
remapJar {
138+
archiveFileName.set("${mod_name}-${mod_version}.jar")
145139
destinationDirectory = file("C:\\Users\\griff\\Desktop\\games\\MultiMC\\instances\\1.8.9\\.minecraft\\mods")
146140
}
147141

gradle.properties

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

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

1212
dev = false

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

Lines changed: 99 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@
33
import cc.polyfrost.oneconfig.events.EventManager;
44
import cc.polyfrost.oneconfig.libs.universal.ChatColor;
55
import cc.polyfrost.oneconfig.libs.universal.UChat;
6+
import cc.woverflow.hysentials.capes.CapeHandler;
67
import cc.woverflow.hysentials.cosmetic.CosmeticManager;
7-
import cc.woverflow.hysentials.gui.UpdateChecker;
8+
import cc.woverflow.hysentials.cosmetics.hamster.HamsterCompanion;
9+
import cc.woverflow.hysentials.cosmetics.hats.cat.CatHat;
10+
import cc.woverflow.hysentials.cosmetics.pepper.PepperCompanion;
11+
import cc.woverflow.hysentials.cosmetics.hats.technocrown.TechnoCrown;
812
import cc.woverflow.hysentials.guis.club.ClubDashboardHandler;
913
import cc.woverflow.hysentials.guis.container.ContainerHandler;
14+
import cc.woverflow.hysentials.guis.utils.SBBoxes;
1015
import cc.woverflow.hysentials.handlers.chat.modules.misc.Limit256;
16+
import cc.woverflow.hysentials.handlers.misc.QuestHandler;
17+
import cc.woverflow.hysentials.quest.Quest;
1118
import cc.woverflow.hysentials.util.MUtils;
1219
import cc.polyfrost.oneconfig.utils.commands.CommandManager;
1320
import cc.woverflow.hysentials.command.*;
1421
import cc.woverflow.hysentials.config.HysentialsConfig;
1522
import cc.woverflow.hysentials.event.events.HysentialsLoadedEvent;
1623
import cc.woverflow.hysentials.guis.ResolutionUtil;
1724
import cc.woverflow.hysentials.guis.actionLibrary.ActionLibrary;
18-
import cc.woverflow.hysentials.guis.club.ClubDashboard;
1925
import cc.woverflow.hysentials.guis.gameMenu.RevampedGameMenu;
2026
import cc.woverflow.hysentials.guis.misc.PlayerInvHandler;
2127
import cc.woverflow.hysentials.guis.sbBoxes.SBBoxesEditor;
@@ -31,18 +37,15 @@
3137
import cc.woverflow.hysentials.handlers.lobby.LobbyChecker;
3238
import cc.woverflow.hysentials.handlers.npc.QuestNPC;
3339
import cc.woverflow.hysentials.handlers.redworks.BwRanks;
34-
import cc.woverflow.hysentials.handlers.redworks.NeighborInstall;
3540
import cc.woverflow.hysentials.handlers.sbb.Actionbar;
3641
import cc.woverflow.hysentials.handlers.sbb.SbbRenderer;
3742
import cc.woverflow.hysentials.htsl.Cluster;
38-
import cc.woverflow.hysentials.pets.cubit.CubitCompanion;
43+
import cc.woverflow.hysentials.cosmetics.cubit.CubitCompanion;
3944
import cc.woverflow.hysentials.util.*;
4045
import cc.woverflow.hysentials.util.blockw.OnlineCache;
4146
import cc.woverflow.hysentials.websocket.Socket;
42-
import cc.woverflow.hytils.util.friends.FriendCache;
4347
import net.minecraft.client.Minecraft;
4448
import net.minecraft.client.gui.FontRenderer;
45-
import net.minecraft.client.settings.KeyBinding;
4649
import net.minecraft.util.ResourceLocation;
4750
import net.minecraftforge.client.ClientCommandHandler;
4851
import net.minecraftforge.common.MinecraftForge;
@@ -108,6 +111,9 @@ public class Hysentials {
108111
public String rank;
109112

110113
public CubitCompanion cubitCompanion;
114+
public PepperCompanion pepperCompanion;
115+
public HamsterCompanion hamsterCompanion;
116+
public TechnoCrown technoCrown;
111117

112118

113119

@@ -126,8 +132,8 @@ public void init(FMLInitializationEvent event) {
126132
if (!file.exists() && !file.mkdirs()) {
127133
throw new RuntimeException("Failed to create config directory! Please report this to sinender on Discord");
128134
}
129-
sbBoxes = new JsonData("./config/hysentials/lines.json", new JSONObject().put("lines", new JSONArray()));
130-
rankColors = new JsonData("/assets/minecraft/textures/icons/colors.json", "./config/hysentials/color.jsonn", true);
135+
sbBoxes = new SBBJsonData("./config/hysentials/lines.json", new JSONObject().put("lines", new JSONArray()));
136+
rankColors = new JsonData("/assets/minecraft/textures/icons/colors.json", "./config/hysentials/color.json", true);
131137

132138
try {
133139
System.setProperty("file.encoding", "UTF-8");
@@ -150,8 +156,8 @@ public void init(FMLInitializationEvent event) {
150156

151157
Socket.createSocket();
152158

153-
CommandManager.INSTANCE.registerCommand(new HysentialsCommand());
154159
CommandManager.INSTANCE.registerCommand(new GroupChatCommand());
160+
ClientCommandHandler.instance.registerCommand(new HysentialsCommand());
155161
ClientCommandHandler.instance.registerCommand(new GlobalChatCommand());
156162
ClientCommandHandler.instance.registerCommand(new HypixelChatCommand());
157163
ClientCommandHandler.instance.registerCommand(new VisitCommand());
@@ -163,22 +169,22 @@ public void init(FMLInitializationEvent event) {
163169
ClientCommandHandler.instance.registerCommand(new InsertLoreLineCommand());
164170
ClientCommandHandler.instance.registerCommand(new RemoveLoreLineCommand());
165171
ClientCommandHandler.instance.registerCommand(new OpenInvCommand());
172+
ClientCommandHandler.instance.registerCommand(new SetTextureCommand());
173+
ClientCommandHandler.instance.registerCommand(new HymojiCommand());
166174
CommandManager.INSTANCE.registerCommand(new SBBoxesCommand());
167175
CommandManager.INSTANCE.registerCommand(new ActionLibraryCommand());
168176
CommandManager.INSTANCE.registerCommand(new ClubCommand());
169177

178+
170179
if (Socket.cachedServerData.has("rpc") && Socket.cachedServerData.getBoolean("rpc")) {
171-
try {
172-
DiscordCore.init();
173-
discordRPC = new DiscordRPC();
174-
} catch (IOException e) {
175-
throw new RuntimeException(e);
176-
}
180+
// DiscordCore.init();
181+
discordRPC = new DiscordRPC();
177182
}
178183

179184
HeightHandler.INSTANCE.initialize();
180185

181186
registerHandlers();
187+
Quest.registerQuests();
182188
}
183189

184190
@Mod.EventHandler
@@ -208,7 +214,7 @@ private void registerImages() {
208214
new ImageIcon("globalchat", new ResourceLocation("textures/icons/globalchat.png"));
209215
new ImageIcon("creator", new ResourceLocation("textures/icons/creator.png"));
210216
new ImageIcon("guild", new ResourceLocation("textures/icons/guild.png"));
211-
new ImageIcon("party", new ResourceLocation("textures/icons/party.png"));
217+
new ImageIcon("partyprefix", new ResourceLocation("textures/icons/party.png"));
212218
new ImageIcon("to", new ResourceLocation("textures/icons/to.png"));
213219
new ImageIcon("from", new ResourceLocation("textures/icons/from.png"));
214220
new ImageIcon("team", new ResourceLocation("textures/icons/team.png"));
@@ -220,6 +226,66 @@ private void registerImages() {
220226
new ImageIcon("legendary", new ResourceLocation("textures/icons/legendary.png"));
221227
new ImageIcon("exclusive", new ResourceLocation("textures/icons/exclusive.png"));
222228

229+
new ImageIcon("moan", new ResourceLocation("textures/emoji/1005491490027487333.png"), true);
230+
new ImageIcon("super_neutral", new ResourceLocation("textures/emoji/1013063272473317377.png"), true);
231+
new ImageIcon("neutral", new ResourceLocation("textures/emoji/1013063271143714866.png"), true);
232+
new ImageIcon("creeper", new ResourceLocation("textures/emoji/1013063267964432494.png"), true);
233+
new ImageIcon("speechless", new ResourceLocation("textures/emoji/1013063269688283186.png"), true);
234+
new ImageIcon("yawn", new ResourceLocation("textures/emoji/1013063264667697263.png"), true);
235+
new ImageIcon("weary", new ResourceLocation("textures/emoji/1005491488739827752.png"), true);
236+
new ImageIcon("plead", new ResourceLocation("textures/emoji/1005491491294167111.png"), true);
237+
new ImageIcon("hehe", new ResourceLocation("textures/emoji/1013063262868348958.png"), true);
238+
new ImageIcon("foggy", new ResourceLocation("textures/emoji/1013063247819186267.png"), true);
239+
new ImageIcon("mind_blown", new ResourceLocation("textures/emoji/1013063244480512050.png"), true);
240+
new ImageIcon("curse", new ResourceLocation("textures/emoji/1013063242970566696.png"), true);
241+
new ImageIcon("mad", new ResourceLocation("textures/emoji/1013063241280266292.png"), true);
242+
new ImageIcon("angry", new ResourceLocation("textures/emoji/1013063239967449128.png"), true);
243+
new ImageIcon("cool", new ResourceLocation("textures/emoji/1005491469244698666.png"), true);
244+
new ImageIcon("drool", new ResourceLocation("textures/emoji/1005491492699254886.png"), true);
245+
new ImageIcon("phew", new ResourceLocation("textures/emoji/1005491497254264912.png"), true);
246+
new ImageIcon("huff", new ResourceLocation("textures/emoji/1005491495689785464.png"), true);
247+
new ImageIcon("sob", new ResourceLocation("textures/emoji/1005491494066602188.png"), true);
248+
new ImageIcon("thinking", new ResourceLocation("textures/emoji/1013063261396156477.png"), true);
249+
new ImageIcon("hugs", new ResourceLocation("textures/emoji/1013063259789733989.png"), true);
250+
new ImageIcon("big_frown", new ResourceLocation("textures/emoji/1013063256908234782.png"), true);
251+
new ImageIcon("worried", new ResourceLocation("textures/emoji/1013063255406673970.png"), true);
252+
new ImageIcon("scared", new ResourceLocation("textures/emoji/1013063253338894347.png"), true);
253+
new ImageIcon("scream", new ResourceLocation("textures/emoji/1013063252101570570.png"), true);
254+
new ImageIcon("cold", new ResourceLocation("textures/emoji/1013063250734235708.png"), true);
255+
new ImageIcon("party", new ResourceLocation("textures/emoji/1005491471455096935.png"), true);
256+
new ImageIcon("star_eyes", new ResourceLocation("textures/emoji/1005491470486208632.png"), true);
257+
new ImageIcon("nerd", new ResourceLocation("textures/emoji/1005491467990614107.png"), true);
258+
new ImageIcon("hmm", new ResourceLocation("textures/emoji/1005491466736500817.png"), true);
259+
new ImageIcon("raised_eyebrow", new ResourceLocation("textures/emoji/1005491463179747429.png"), true);
260+
new ImageIcon("crazy", new ResourceLocation("textures/emoji/1005491460352774255.png"), true);
261+
new ImageIcon("wink_silly", new ResourceLocation("textures/emoji/1005491459165782097.png"), true);
262+
new ImageIcon("extremely_silly", new ResourceLocation("textures/emoji/1005491457982996635.png"), true);
263+
new ImageIcon("silly", new ResourceLocation("textures/emoji/1005491456611467285.png"), true);
264+
new ImageIcon("yum", new ResourceLocation("textures/emoji/1005491455344783370.png"), true);
265+
new ImageIcon("blush_kiss", new ResourceLocation("textures/emoji/1005491454115852378.png"), true);
266+
new ImageIcon("kiss", new ResourceLocation("textures/emoji/1005491451846721718.png"), true);
267+
new ImageIcon("kiss_wink", new ResourceLocation("textures/emoji/1005491450668134620.png"), true);
268+
new ImageIcon("love", new ResourceLocation("textures/emoji/1005491448982012096.png"), true);
269+
new ImageIcon("heart_eyes", new ResourceLocation("textures/emoji/1005491448138973264.png"), true);
270+
new ImageIcon("uhoh", new ResourceLocation("textures/emoji/1005491446842929152.png"), true);
271+
new ImageIcon("relief", new ResourceLocation("textures/emoji/1005491445337161829.png"), true);
272+
new ImageIcon("wink", new ResourceLocation("textures/emoji/1005491444208906340.png"), true);
273+
new ImageIcon("downwards_smile", new ResourceLocation("textures/emoji/1005491443101618227.png"), true);
274+
new ImageIcon("slight_smile", new ResourceLocation("textures/emoji/1005491441881075752.png"), true);
275+
new ImageIcon("angel", new ResourceLocation("textures/emoji/1005491440253685821.png"), true);
276+
new ImageIcon("blush", new ResourceLocation("textures/emoji/1005491439574196224.png"), true);
277+
new ImageIcon("rofl", new ResourceLocation("textures/emoji/1005491437124714536.png"), true);
278+
new ImageIcon("roy", new ResourceLocation("textures/emoji/1005491435899998338.png"), true);
279+
new ImageIcon("guilty", new ResourceLocation("textures/emoji/1005491434566189176.png"), true);
280+
new ImageIcon("lol", new ResourceLocation("textures/emoji/1005491428278935664.png"), true);
281+
new ImageIcon("cheer", new ResourceLocation("textures/emoji/1005491425275822152.png"), true);
282+
new ImageIcon("smile", new ResourceLocation("textures/emoji/1005491424495685673.png"), true);
283+
new ImageIcon("happy", new ResourceLocation("textures/emoji/1005491423170285638.png"), true);
284+
new ImageIcon("downvote", new ResourceLocation("textures/emoji/downvote.png"), true);
285+
new ImageIcon("upvote", new ResourceLocation("textures/emoji/upvote.png"), true);
286+
new ImageIcon("left", new ResourceLocation("textures/emoji/left.png"), true);
287+
new ImageIcon("right", new ResourceLocation("textures/emoji/right.png"), true);
288+
223289
for (HypixelRanks rank : HypixelRanks.values()) {
224290
try {
225291
new ImageIcon(rank.getIconName(), new ResourceLocation("textures/icons/" + rank.getIconName() + ".png"));
@@ -257,6 +323,9 @@ private void registerHandlers() {
257323
eventBus.register(new BwRanks());
258324
eventBus.register(new GameMenuOpen());
259325
eventBus.register(new SbbRenderer());
326+
eventBus.register(new cc.woverflow.hysentials.handlers.SbbRenderer());
327+
328+
260329
eventBus.register(new Actionbar());
261330
eventBus.register(new ActionLibrary());
262331
eventBus.register(new Queue());
@@ -271,7 +340,13 @@ private void registerHandlers() {
271340
eventBus.register(new QuestNPC());
272341
eventBus.register(new MUtils());
273342
eventBus.register(new Limit256());
343+
eventBus.register(new QuestHandler());
344+
eventBus.register(new CapeHandler());
274345
eventBus.register(cubitCompanion = new CubitCompanion());
346+
eventBus.register(pepperCompanion = new PepperCompanion());
347+
eventBus.register(hamsterCompanion = new HamsterCompanion());
348+
eventBus.register(technoCrown = new TechnoCrown());
349+
CatHat.loadCatHats();
275350
eventBus.register(new ContainerHandler());
276351

277352
new Renderer();
@@ -281,11 +356,18 @@ private void registerHandlers() {
281356
EventManager.INSTANCE.register(new BwRanks());
282357

283358
eventBus.register(new HypixelAPIUtils());
284-
eventBus.register(new NeighborInstall());
359+
// eventBus.register(new NeighborInstall());
285360

286361
HysentialsKt.Companion.init();
287362

288363
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
364+
JSONArray array = new JSONArray();
365+
for (SBBoxes box : SBBoxes.boxes) {
366+
array.put(box.save());
367+
}
368+
JSONObject object = new JSONObject();
369+
object.put("lines", array);
370+
sbBoxes.jsonObject = object;
289371
sbBoxes.save();
290372
}));
291373
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package cc.woverflow.hysentials.capes;
2+
3+
import cc.woverflow.hysentials.Hysentials;
4+
import cc.woverflow.hysentials.cosmetic.CosmeticGui;
5+
import net.minecraft.client.Minecraft;
6+
import net.minecraft.client.renderer.texture.DynamicTexture;
7+
import net.minecraft.util.ResourceLocation;
8+
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
9+
import net.minecraftforge.fml.common.gameevent.TickEvent;
10+
import org.json.JSONObject;
11+
12+
import java.awt.image.BufferedImage;
13+
import java.io.InputStream;
14+
import java.util.HashMap;
15+
import java.util.UUID;
16+
17+
public class CapeHandler {
18+
public static HashMap<UUID, Integer> tickMap = new HashMap<>();
19+
public static HashMap<UUID, DynamicTexture> textureMap = new HashMap<>();
20+
public static HashMap<UUID, String> resourceMap = new HashMap<>();
21+
@SubscribeEvent
22+
public void onTickEvent(TickEvent.ClientTickEvent event) {
23+
if (event.phase != TickEvent.Phase.END) return;
24+
for (UUID uuid : Hysentials.INSTANCE.getOnlineCache().onlinePlayers.keySet()) {
25+
boolean wearingCape = false;
26+
for (JSONObject cosmetic : CosmeticGui.Companion.getEquippedCosmetics(uuid)) {
27+
if (cosmetic.getString("type").equals("cape")) {
28+
wearingCape = true;
29+
String name = cosmetic.getString("name");
30+
if (CosmeticGui.Companion.hasCosmetic(uuid, name)) {
31+
ResourceLocation location = new ResourceLocation(cosmetic.getString("resource"));
32+
resourceMap.put(uuid, cosmetic.getString("resource"));
33+
try {
34+
InputStream stream = Minecraft.getMinecraft().mcDefaultResourcePack.getInputStream(location);
35+
if (stream == null) {
36+
throw new RuntimeException("ImageIcon " + name + " does not exist in the resource pack!");
37+
}
38+
BufferedImage image = javax.imageio.ImageIO.read(stream);
39+
int frames = image.getHeight() / 32;
40+
int tick = tickMap.getOrDefault(uuid, 0);
41+
int timePerTick = 20/(cosmetic.has("framerate") ? cosmetic.getInt("framerate") : 4);
42+
if (++tick >= frames*timePerTick) {
43+
tick = 0;
44+
}
45+
int frame = tick / timePerTick;
46+
if (frame >= frames) {
47+
frame = 0;
48+
}
49+
tickMap.put(uuid, tick);
50+
BufferedImage frameImage = image.getSubimage(0, frame*32, 64, 32);
51+
DynamicTexture texture = new DynamicTexture(frameImage);
52+
textureMap.put(uuid, texture);
53+
stream.close();
54+
} catch (Exception e) {
55+
e.printStackTrace();
56+
}
57+
}
58+
}
59+
}
60+
if (!wearingCape) {
61+
tickMap.remove(uuid);
62+
textureMap.remove(uuid);
63+
resourceMap.remove(uuid);
64+
}
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)