Skip to content

Commit

Permalink
Update to 1.19.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jul 30, 2022
1 parent a1b565c commit 7a9445f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.7
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.1
loader_version=0.14.8
java_version=17

# Mod Properties
Expand All @@ -14,12 +14,12 @@ org.gradle.jvmargs=-Xmx2G
archives_base_name = blabber

# Dependencies
fabric_version=0.55.3+1.19
fabric_version=0.58.5+1.19.1

# Publishing
license_header = LGPL
curseforge_id = 565396
curseforge_versions = 1.19
curseforge_versions = 1.19.1
cf_requirements = fabric-api
cf_embeddeds = cardinal-components
release_type = beta
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
cca = "5.0.0-beta.1"
elmendorf = "0.6.0"
cca = "5.0.1"
elmendorf = "0.7.0"
fpa = "0.1-SNAPSHOT"
mcAnnotations = "1.0"
modmenu = "4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public record CommandDialogueAction(String command) implements DialogueAction {

@Override
public void handle(ServerPlayerEntity player) {
player.server.getCommandManager().execute(player.getCommandSource().withLevel(2), this.command());
player.server.getCommandManager().executeWithPrefix(player.getCommandSource().withLevel(2), this.command());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ public final class BlabberTestSuite implements FabricGameTest {
public void nominal(TestContext ctx) {
ServerPlayerEntity player = ctx.spawnServerPlayer(2, 2, 2);
Blabber.startDialogue(player, new Identifier("babblings:remnant_choice_builtin"));
GameTestUtil.assertTrue("startDialogue did not work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.isUnskippable() && handler.getCurrentChoices().size() == 3);
GameTestUtil.assertTrue("startDialogue should work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.isUnskippable() && handler.getCurrentChoices().size() == 3);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 0);
GameTestUtil.assertTrue("choice 0 did not work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 1);
GameTestUtil.assertTrue("choice 0 should work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 1);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 420);
GameTestUtil.assertTrue("choice 420 was not ignored", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 1);
GameTestUtil.assertTrue("choice 420 should be ignored", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 1);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 0);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 1);
GameTestUtil.assertTrue("choice 1 did not work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 2);
GameTestUtil.assertTrue("choice 1 should work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.getCurrentChoices().size() == 2);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 1);
((DialogueScreenHandler) player.currentScreenHandler).makeChoice(player, 1);
GameTestUtil.assertTrue("dialogue did not end", player.currentScreenHandler == player.playerScreenHandler);
GameTestUtil.assertTrue("dialogue should end", player.currentScreenHandler == player.playerScreenHandler);
ctx.complete();
}

@GameTest(templateName = EMPTY_STRUCTURE)
public void registryGetsPopulated(TestContext ctx) {
GameTestUtil.assertTrue("dialogue registry does not match expected state",
GameTestUtil.assertTrue("dialogue registry should match expected state",
ctx.getWorld().getRegistryManager().get(BlabberRegistrar.DIALOGUE_REGISTRY_KEY).streamEntries().map(RegistryEntry.Reference::getKey).map(k -> k.orElseThrow().getValue()).sorted().toList().equals(List.of(
new Identifier("babblings:mountain_king"),
new Identifier("babblings:remnant_choice"),
Expand All @@ -72,14 +72,14 @@ public void registryGetsPopulated(TestContext ctx) {
@GameTest(templateName = EMPTY_STRUCTURE)
public void validationFailsOnIncompleteDialogue(TestContext ctx) {
DataResult<Pair<DialogueTemplate, JsonElement>> result = DialogueTemplate.CODEC.decode(JsonOps.INSTANCE, new Gson().fromJson(new InputStreamReader(Objects.requireNonNull(BlabberTestSuite.class.getResourceAsStream("/incomplete_dialogue.json"))), JsonElement.class));
GameTestUtil.assertTrue("Dialogue validation does not detect incomplete dialogues", result.error().filter(it -> it.message().equals("(Blabber) a has no available choices but is not an end state")).isPresent());
GameTestUtil.assertTrue("Dialogue validation should detect incomplete dialogues", result.error().filter(it -> it.message().equals("(Blabber) a has no available choices but is not an end state")).isPresent());
ctx.complete();
}

@GameTest(templateName = EMPTY_STRUCTURE)
public void validationFailsOnLoopingDialogue(TestContext ctx) {
DataResult<Pair<DialogueTemplate, JsonElement>> result = DialogueTemplate.CODEC.decode(JsonOps.INSTANCE, new Gson().fromJson(new InputStreamReader(Objects.requireNonNull(BlabberTestSuite.class.getResourceAsStream("/looping_dialogue.json"))), JsonElement.class));
GameTestUtil.assertTrue("Dialogue validation does not detect looping dialogues", result.error().filter(it -> it.message().equals("(Blabber) a does not have any path to the end of the dialogue")).isPresent());
GameTestUtil.assertTrue("Dialogue validation should detect looping dialogues", result.error().filter(it -> it.message().equals("(Blabber) a does not have any path to the end of the dialogue")).isPresent());
ctx.complete();
}
}

0 comments on commit 7a9445f

Please sign in to comment.