Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KingRainbow44 committed May 7, 2022
1 parent 59b24aa commit e6cb97a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 304 deletions.
14 changes: 11 additions & 3 deletions src/main/java/emu/grasscutter/Grasscutter.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,20 @@ public static void main(String[] args) throws Exception {
Crypto.loadKeys(); // Load keys from buffers.

// Parse arguments.
boolean exitEarly = false;
for (String arg : args) {
switch (arg.toLowerCase()) {
case "-handbook" -> Tools.createGmHandbook();
case "-gachamap" -> Tools.createGachaMapping("./gacha-mapping.js");
case "-handbook" -> {
Tools.createGmHandbook(); exitEarly = true;
}
case "-gachamap" -> {
Tools.createGachaMapping("./gacha-mapping.js"); exitEarly = true;
}
}
}
}

// Exit early if argument sets it.
if(exitEarly) System.exit(0);

// Initialize server.
Grasscutter.getLogger().info(translate("messages.status.starting"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;

@SuppressWarnings("unchecked")
public class GameServerPacketHandler {
private final Int2ObjectMap<PacketHandler> handlers;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/emu/grasscutter/tools/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public static void createGmHandbook() throws Exception {
}

Grasscutter.getLogger().info("GM Handbook generated!");
System.exit(0);
}

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -183,6 +182,5 @@ public static void createGachaMapping(String location) throws Exception {
}

Grasscutter.getLogger().info("Mappings generated!");
System.exit(0);
}
}
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/utils/Language.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private Language(String fileName) {
@Nullable JsonObject languageData = null;

try {
InputStream file = Grasscutter.class.getResourceAsStream("/lang/" + fileName);
InputStream file = Grasscutter.class.getResourceAsStream("/languages/" + fileName);
languageData = Grasscutter.getGsonFactory().fromJson(Utils.readFromInputStream(file), JsonObject.class);
} catch (Exception exception) {
Grasscutter.getLogger().error("Failed to load language file: " + fileName, exception);
Expand Down
298 changes: 0 additions & 298 deletions src/main/resources/languages/en_US.json

This file was deleted.

0 comments on commit e6cb97a

Please sign in to comment.