From dd9930fbbadbea6077bbbea6b4d6164fb0b923b1 Mon Sep 17 00:00:00 2001 From: DragonEggBedrockBreaking <68545280+DragonEggBedrockBreaking@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:03:34 +0100 Subject: [PATCH 1/2] Fix #13 (non-vanilla advancements causing crash) --- .../mixin/advancement/MixinPlayerAdvancements.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/uk/debb/vanilla_disable/mixin/advancement/MixinPlayerAdvancements.java b/src/main/java/uk/debb/vanilla_disable/mixin/advancement/MixinPlayerAdvancements.java index fc4b3d2d..f1234bc5 100644 --- a/src/main/java/uk/debb/vanilla_disable/mixin/advancement/MixinPlayerAdvancements.java +++ b/src/main/java/uk/debb/vanilla_disable/mixin/advancement/MixinPlayerAdvancements.java @@ -14,10 +14,12 @@ public abstract class MixinPlayerAdvancements implements Maps { @ModifyReturnValue(method = "getOrStartProgress", at = @At("RETURN")) private AdvancementProgress cancelPerformingCriterion(AdvancementProgress original, Advancement advancement) { if (advancement.getDisplay() != null) { - Gamerules gameRule = playerAdvancementsStringMap.get(advancement.getDisplay().getTitle().toString().split("'")[1]); - if (!Gamerules.ADVANCEMENTS_ENABLED.getBool() || (gameRule != null && !gameRule.getBool())) { - return new AdvancementProgress(); - } + try { + Gamerules gameRule = playerAdvancementsStringMap.get(advancement.getDisplay().getTitle().toString().split("'")[1]); + if (!Gamerules.ADVANCEMENTS_ENABLED.getBool() || (gameRule != null && !gameRule.getBool())) { + return new AdvancementProgress(); + } + } catch (ArrayIndexOutOfBoundsException ignored) {} } return original; } From 80d4eb5c103290988e198fb6742fefc6024a5918 Mon Sep 17 00:00:00 2001 From: DragonEggBedrockBreaking <68545280+DragonEggBedrockBreaking@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:04:25 +0100 Subject: [PATCH 2/2] Bump to 2.4.1 --- src/main/resources/fabric.mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 97045fa6..ca41d24a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "vanilla_disable", - "version": "2.4.0", + "version": "2.4.1", "name": "Vanilla Disable", "description": "Allows you to disable a lot of vanilla features.", "authors": [