Skip to content

Commit

Permalink
Fix Decoding Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Aug 22, 2023
1 parent cb7b3a1 commit 4c18526
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}

version = '1.0'
version = '1.0.1'
group = 'org.infernalstudios.abs'
archivesBaseName = 'abs'

Expand Down
14 changes: 8 additions & 6 deletions src/main/java/org/infernalstudios/abs/rules/SpawningRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ public static SpawningRules decode(JsonElement element) {
FilterRules include = FilterRules.empty();
FilterRules exclude = FilterRules.empty();

JsonObject json = element.getAsJsonObject();
if (json.has("include")) {
include = FilterRules.decode(json.get("include"));
}
if (element != null) {
JsonObject json = element.getAsJsonObject();
if (json.has("include")) {
include = FilterRules.decode(json.get("include"));
}

if (json.has("exclude")) {
exclude = FilterRules.decode(json.get("exclude"));
if (json.has("exclude")) {
exclude = FilterRules.decode(json.get("exclude"));
}
}

return new SpawningRules(include, exclude);
Expand Down

0 comments on commit 4c18526

Please sign in to comment.