diff --git a/changelog.md b/changelog.md index 62a8cbc..c8d0072 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,10 @@ +------------------------------------------------------ +Version 1.6.1-mc1.20.1 +------------------------------------------------------ +**Fixes** +- Fixed `blabber dialogue start` not working when used as a command action on a dialogue end state +- Fixed JEI still appearing on dialogue screens with RPG layout + ------------------------------------------------------ Version 1.6.0-mc1.20.1 ------------------------------------------------------ diff --git a/gradle.properties b/gradle.properties index 990d472..cc4db8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx2G java_version=17 # Mod Properties - mod_version = 1.6.0-mc1.20.1 + mod_version = 1.6.1-mc1.20.1 maven_group = org.ladysnake archives_base_name = blabber diff --git a/src/main/java/org/ladysnake/blabber/impl/common/DialogueScreenHandler.java b/src/main/java/org/ladysnake/blabber/impl/common/DialogueScreenHandler.java index 2c9aeab..e6a5dee 100644 --- a/src/main/java/org/ladysnake/blabber/impl/common/DialogueScreenHandler.java +++ b/src/main/java/org/ladysnake/blabber/impl/common/DialogueScreenHandler.java @@ -113,7 +113,8 @@ public ChoiceResult makeChoice(int choice) { public boolean makeChoice(ServerPlayerEntity player, int choice) { try { // Can't throw here, could cause trouble with a bad packet ChoiceResult result = this.dialogue.choose(choice, action -> action.handle(player, this.interlocutor)); - if (result == ChoiceResult.END_DIALOGUE) { + // The action itself can close the dialogue or switch to a different one, so we need to check this one is still open + if (result == ChoiceResult.END_DIALOGUE && player.currentScreenHandler == this) { PlayerDialogueTracker.get(player).endDialogue(); } diff --git a/src/testmod/resources/data/babblings/blabber/dialogues/mountain_king.json b/src/testmod/resources/data/babblings/blabber/dialogues/mountain_king.json index 8693ac4..b0eb551 100644 --- a/src/testmod/resources/data/babblings/blabber/dialogues/mountain_king.json +++ b/src/testmod/resources/data/babblings/blabber/dialogues/mountain_king.json @@ -79,9 +79,22 @@ { "text": [{"text":"My name is "},{"selector":"@s"}], "next": "end" + }, + { + "text": "Let's play DnD", + "next": "end_dnd" } ], "illustrations": ["discussion"] + }, + "end_dnd": { + "text": "", + "choices": [], + "type": "end_dialogue", + "action": { + "type": "blabber:command", + "value": "blabber dialogue start babblings:perception_check" + } } }, "illustrations": {