Skip to content

Commit

Permalink
Fix dialogue switching on end states
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jun 20, 2024
1 parent 0fc68bd commit 9d7ae53
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 9d7ae53

Please sign in to comment.