Skip to content

Commit f1301ff

Browse files
committed
Fixes to stuff and updater fixes
1 parent 9d3398e commit f1301ff

37 files changed

+458
-260
lines changed

build.gradle

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ plugins {
99
id "net.kyori.blossom" version "1.3.0"
1010
id "java"
1111
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.10'
12+
id 'maven-publish'
1213
}
1314

14-
version = mod_version
15+
long time = System.currentTimeSeconds()
16+
boolean dev = dev == "true"
17+
version = (dev ? dev_version + time : mod_version)
1518
group = "net.sinender"
1619
archivesBaseName = mod_name
1720

@@ -86,7 +89,13 @@ dependencies {
8689
exclude module: 'lwjgl'
8790
}
8891
include('com.github.JnCrMx:discord-game-sdk4j:v0.5.5')
89-
include("gg.essential:elementa-1.8.9-forge:590")
92+
include('com.neovisionaries:nv-websocket-client:2.14')
93+
compileOnly("gg.essential:elementa-1.8.9-forge:590") {
94+
exclude module: "asm"
95+
exclude module: "asm-commons"
96+
exclude module: "asm-tree"
97+
exclude module: "gson"
98+
}
9099

91100
compileOnly('org.spongepowered:mixin:0.7.11-SNAPSHOT')
92101

@@ -104,16 +113,16 @@ dependencies {
104113
include(ktorClient("content-negotiation", null))
105114
include(ktorClient("encoding", null))
106115

107-
include(ktorServer("core", null))
108-
include(ktorServer("cio", null))
109-
include(ktorServer("content-negotiation", null))
110-
include(ktorServer("compression", null))
111-
include(ktorServer("cors", null))
112-
include(ktorServer("conditional-headers", null))
113-
include(ktorServer("auto-head-response", null))
114-
include(ktorServer("default-headers", null))
115-
include(ktorServer("host-common", null))
116-
include(ktorServer("auth", null))
116+
// include(ktorServer("core", null))
117+
// include(ktorServer("cio", null))
118+
// include(ktorServer("content-negotiation", null))
119+
// include(ktorServer("compression", null))
120+
// include(ktorServer("cors", null))
121+
// include(ktorServer("conditional-headers", null))
122+
// include(ktorServer("auto-head-response", null))
123+
// include(ktorServer("default-headers", null))
124+
// include(ktorServer("host-common", null))
125+
// include(ktorServer("auth", null))
117126

118127
}
119128

@@ -176,3 +185,35 @@ compileKotlin {
176185
freeCompilerArgs = ['-Xjvm-default=compatibility']
177186
}
178187
}
188+
189+
publishing {
190+
repositories {
191+
if (dev) {
192+
maven {
193+
name = "devRepo"
194+
url = "https://repo.redstone.llc/dev"
195+
credentials(PasswordCredentials)
196+
authentication {
197+
basic(BasicAuthentication)
198+
}
199+
}
200+
} else {
201+
maven {
202+
name = "betaRepo"
203+
url = "https://repo.redstone.llc/beta"
204+
credentials(PasswordCredentials)
205+
authentication {
206+
basic(BasicAuthentication)
207+
}
208+
}
209+
}
210+
}
211+
publications {
212+
maven(MavenPublication) {
213+
groupId = "llc.redstone"
214+
artifactId = mod_name
215+
version = version
216+
from components.java
217+
}
218+
}
219+
}

gradle.properties

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

77
mod_name = Hysentials
88
mod_id = hysentials
9-
mod_version = 1.1.0-beta2
9+
mod_version = 1.1.0-beta3
10+
dev_version = 1.1.0-dev
11+
12+
dev = false
1013

1114
loom.platform = forge
1215

13-
redsoneRepositoryUsername={token}
14-
redsoneRepositoryPassword={secret}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ public void init(FMLInitializationEvent event) {
127127
sbBoxes = new JsonData("./config/hysentials/lines.json", new JSONObject().put("lines", new JSONArray()));
128128
rankColors = new JsonData("/assets/minecraft/textures/icons/colors.json", "./config/hysentials/color.jsonn", true);
129129

130-
HysentialsKt.Companion.init();
131-
132130
try {
133131
System.setProperty("file.encoding", "UTF-8");
134132
Field charset = Charset.class.getDeclaredField("defaultCharset");
@@ -141,14 +139,14 @@ public void init(FMLInitializationEvent event) {
141139
try {
142140
SSLStore store = new SSLStore();
143141
store.load("/ssl/hysentials.der");
144-
store.load("/ssl/socket.der");
145142
SSLContext context = store.finish();
146143
SSLContext.setDefault(context);
147144
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
148145
} catch (Exception e) {
149146
throw new RuntimeException(e);
150147
}
151148

149+
Socket.createSocket();
152150

153151
CommandManager.INSTANCE.registerCommand(new HysentialsCommand());
154152
CommandManager.INSTANCE.registerCommand(new GroupChatCommand());
@@ -188,12 +186,12 @@ public void postInit(FMLPostInitializationEvent event) {
188186
isHytils = Loader.isModLoaded("hytils-reborn");
189187
chatHandler.init();
190188

191-
Socket.createSocket();
192189
registerImages();
193190
cc.woverflow.hysentials.htsl.Loader.registerLoaders();
194191
Cluster.registerClusters();
195192

196193
MinecraftForge.EVENT_BUS.post(new HysentialsLoadedEvent());
194+
HysentialsKt.Companion.postInit();
197195
}
198196

199197
@Mod.EventHandler
@@ -275,6 +273,8 @@ private void registerHandlers() {
275273
eventBus.register(new HypixelAPIUtils());
276274
eventBus.register(new NeighborInstall());
277275

276+
HysentialsKt.Companion.init();
277+
278278
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
279279
sbBoxes.save();
280280
}));

src/main/java/cc/woverflow/hysentials/command/ClubCommand.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cc.woverflow.hysentials.command;
22

3+
import cc.polyfrost.oneconfig.libs.universal.UChat;
34
import cc.woverflow.hysentials.util.MUtils;
45
import cc.polyfrost.oneconfig.utils.Multithreading;
56
import cc.polyfrost.oneconfig.utils.NetworkUtils;
@@ -44,7 +45,7 @@ public class ClubCommand {
4445
@SubCommand(aliases = {"create"}, description = "Create a club")
4546
public void create(String name) {
4647
if (!Socket.linked) {
47-
MUtils.chat("&cYou must be linked to a discord account to use this feature.");
48+
UChat.chat("&cYou must be linked to a discord account to use this feature.");
4849
return;
4950
}
5051
Multithreading.runAsync(() -> {
@@ -60,10 +61,10 @@ public void create(String name) {
6061
String s = IOUtils.toString(input);
6162
JSONObject object = new JSONObject(s);
6263
if (object.getBoolean("success")) {
63-
MUtils.chat(HysentialsConfig.chatPrefix + " &aClub successfully created!");
64+
UChat.chat(HysentialsConfig.chatPrefix + " &aClub successfully created!");
6465
} else {
65-
MUtils.chat(HysentialsConfig.chatPrefix + " &cClub failed to create!");
66-
MUtils.chat(" - &c" + object.getString("message"));
66+
UChat.chat(HysentialsConfig.chatPrefix + " &cClub failed to create!");
67+
UChat.chat(" - &c" + object.getString("message"));
6768
}
6869
} catch (Exception e) {
6970
e.printStackTrace();
@@ -77,7 +78,7 @@ public void join(String name) {
7778
MUtils.chat("&cYou must be linked to a discord account to use this feature.");
7879
return;
7980
}
80-
Socket.CLIENT.send(new Request(
81+
Socket.CLIENT.sendText(new Request(
8182
"method", "clubAccept",
8283
"club", name,
8384
"uuid", Minecraft.getMinecraft().getSession().getProfile().getId(),

src/main/java/cc/woverflow/hysentials/command/GlobalChatCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE
5959
json.put("displayName", sender.getDisplayName().getFormattedText()); //This gets overwritten by the server lol!
6060
json.put("key", Socket.serverId);
6161

62-
Socket.CLIENT.send(json.toString());
62+
Socket.CLIENT.sendText(json.toString());
6363
}
6464

6565
}

src/main/java/cc/woverflow/hysentials/command/GroupChatCommand.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
public class GroupChatCommand {
3636
@SubCommand(description = "Join a group chat", aliases = "join")
3737
public void join(String name) {
38-
Socket.CLIENT.send(new Request(
38+
Socket.CLIENT.sendText(new Request(
3939
"method", "groupJoin",
4040
"name", name,
4141
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -45,7 +45,7 @@ public void join(String name) {
4545

4646
@SubCommand(description = "Chat in a group chat", aliases = "chat")
4747
public void chat(String group, @Greedy String message) {
48-
Socket.CLIENT.send(new Request(
48+
Socket.CLIENT.sendText(new Request(
4949
"method", "groupChat",
5050
"name", group,
5151
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -60,7 +60,7 @@ public void chat(String group, @Greedy String message) {
6060

6161
@SubCommand(description = "Create a group chat", aliases = "create")
6262
public void create(String name) {
63-
Socket.CLIENT.send(new Request(
63+
Socket.CLIENT.sendText(new Request(
6464
"method", "groupCreate",
6565
"name", name,
6666
"owner", Minecraft.getMinecraft().thePlayer.getName(),
@@ -73,7 +73,7 @@ public void create(String name) {
7373

7474
@SubCommand(description = "Set the settings of the group", aliases = {"settings", "s"})
7575
public void settings( String name, @Description(autoCompletesTo = {"allInvite", "silence", "filter", "private"}) String setting, @Description(autoCompletesTo = {"true", "false"}) String value) {
76-
Socket.CLIENT.send(new Request(
76+
Socket.CLIENT.sendText(new Request(
7777
"method", "groupSettings",
7878
"name", name,
7979
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -88,7 +88,7 @@ public void settings( String name, @Description(autoCompletesTo = {"allInvite",
8888

8989
@SubCommand(description = "Demote a player in the group", aliases = {"demote", "d"})
9090
public void demote(String name, String player) {
91-
Socket.CLIENT.send(new Request(
91+
Socket.CLIENT.sendText(new Request(
9292
"method", "groupDemote",
9393
"name", name,
9494
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -102,7 +102,7 @@ public void demote(String name, String player) {
102102

103103
@SubCommand(description = "Disband a group", aliases = {"disband", "dis"})
104104
public void disband(String name) {
105-
Socket.CLIENT.send(new Request(
105+
Socket.CLIENT.sendText(new Request(
106106
"method", "groupDisband",
107107
"name", name,
108108
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -115,7 +115,7 @@ public void disband(String name) {
115115

116116
@SubCommand(description = "Invite a player to a group chat", aliases = {"invite", "i"})
117117
public void invite(String name, String player) {
118-
Socket.CLIENT.send(new Request(
118+
Socket.CLIENT.sendText(new Request(
119119
"method", "groupInvite",
120120
"name", name,
121121
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -129,7 +129,7 @@ public void invite(String name, String player) {
129129

130130
@SubCommand(description = "Kick a player from a group chat", aliases = {"kick", "k"})
131131
public void kick(String name, String player, String reason) {
132-
Socket.CLIENT.send(new Request(
132+
Socket.CLIENT.sendText(new Request(
133133
"method", "groupKick",
134134
"name", name,
135135
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -144,7 +144,7 @@ public void kick(String name, String player, String reason) {
144144

145145
@SubCommand(description = "Leave a group chat", aliases = {"leave", "l"})
146146
public void leave(String name) {
147-
Socket.CLIENT.send(new Request(
147+
Socket.CLIENT.sendText(new Request(
148148
"method", "groupLeave",
149149
"name", name,
150150
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -157,7 +157,7 @@ public void leave(String name) {
157157

158158
@SubCommand(description = "Promote a player in the group", aliases = {"promote", "p"})
159159
public void promote(String name, String player) {
160-
Socket.CLIENT.send(new Request(
160+
Socket.CLIENT.sendText(new Request(
161161
"method", "groupPromote",
162162
"name", name,
163163
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -171,7 +171,7 @@ public void promote(String name, String player) {
171171

172172
@SubCommand(description = "Display online players in a group", aliases = {"online", "o"})
173173
public void online(String name) {
174-
Socket.CLIENT.send(new Request(
174+
Socket.CLIENT.sendText(new Request(
175175
"method", "groupOnline",
176176
"name", name,
177177
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -184,7 +184,7 @@ public void online(String name) {
184184

185185
@SubCommand(description = "Renames a group", aliases = {"rename", "r"})
186186
public void rename(String name, String newName) {
187-
Socket.CLIENT.send(new Request(
187+
Socket.CLIENT.sendText(new Request(
188188
"method", "groupRename",
189189
"name", name,
190190
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -198,7 +198,7 @@ public void rename(String name, String newName) {
198198

199199
@SubCommand(aliases = {"transfer", "t"})
200200
public void transfer(String name, String player) {
201-
Socket.CLIENT.send(new Request(
201+
Socket.CLIENT.sendText(new Request(
202202
"method", "groupTransfer",
203203
"name", name,
204204
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -212,7 +212,7 @@ public void transfer(String name, String player) {
212212

213213
@SubCommand(aliases = {"hide", "h"})
214214
public void hide(String name) {
215-
Socket.CLIENT.send(new Request(
215+
Socket.CLIENT.sendText(new Request(
216216
"method", "groupHide",
217217
"name", name,
218218
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -228,7 +228,7 @@ public void hide(String name) {
228228

229229
@SubCommand(aliases = {"unhide", "uh"})
230230
public void unhide(String name) {
231-
Socket.CLIENT.send(new Request(
231+
Socket.CLIENT.sendText(new Request(
232232
"method", "groupUnhide",
233233
"name", name,
234234
"username", Minecraft.getMinecraft().thePlayer.getName(),
@@ -241,7 +241,7 @@ public void unhide(String name) {
241241

242242
@SubCommand(description = "Set the color of the groups prefix", aliases = "color")
243243
public void color( String name, String color) {
244-
Socket.CLIENT.send(new Request(
244+
Socket.CLIENT.sendText(new Request(
245245
"method", "groupColor",
246246
"name", name,
247247
"username", Minecraft.getMinecraft().thePlayer.getName(),

src/main/java/cc/woverflow/hysentials/command/HysentialsCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void handleReload() {
4747
ImageIcon.reloadIcons();
4848
Hysentials.INSTANCE.sbBoxes = new JsonData("./config/hysentials/lines.json", new JSONObject().put("lines", new JSONArray()));
4949
Hysentials.INSTANCE.rankColors = new JsonData("./config/hysentials/colors.json", new JSONObject());
50-
MUtils.chat("§aReloaded Hysentials!");
50+
UChat.chat("§aReloaded Hysentials!");
5151
}
5252

5353
@SubCommand(aliases = {"online"}, description = "Shows online players")
@@ -228,7 +228,7 @@ private static void test(String command, @Greedy String args) {
228228
@SubCommand(aliases = "reconnect")
229229
private static void reconnect() {
230230
if (Socket.CLIENT != null && Socket.CLIENT.isOpen())
231-
Socket.CLIENT.close();
231+
Socket.CLIENT.sendClose();
232232
Socket.createSocket();
233233
}
234234

@@ -264,7 +264,7 @@ private static void link() {
264264
Multithreading.runAsync(() -> {
265265
JSONObject response = Socket.data;
266266
response.put("server", false);
267-
Socket.CLIENT.send(response.toString());
267+
Socket.CLIENT.sendText(response.toString());
268268
Socket.linking = false;
269269
Socket.data = null;
270270
Socket.linked = true;

0 commit comments

Comments
 (0)