diff --git a/src/main/java/org/ladysnake/blabber/api/DialogueIllustrationType.java b/src/main/java/org/ladysnake/blabber/api/DialogueIllustrationType.java index 83389458..fe4fa5da 100644 --- a/src/main/java/org/ladysnake/blabber/api/DialogueIllustrationType.java +++ b/src/main/java/org/ladysnake/blabber/api/DialogueIllustrationType.java @@ -19,6 +19,7 @@ import com.mojang.serialization.Codec; import net.minecraft.network.PacketByteBuf; +import org.jetbrains.annotations.ApiStatus; import org.ladysnake.blabber.impl.common.BlabberRegistrar; import java.util.function.BiConsumer; @@ -71,6 +72,7 @@ public void writeToPacket(PacketByteBuf buf, T toWrite) { * Same as writeToPacket, but does an unchecked cast, for when the type information is lost somewhere. * Make sure it's safe. */ + @ApiStatus.Internal public void writeToPacketUnsafe(PacketByteBuf buf, DialogueIllustration illustration) { //noinspection unchecked this.writeToPacket(buf, (T) illustration); diff --git a/src/main/java/org/ladysnake/blabber/impl/common/validation/DialogueValidator.java b/src/main/java/org/ladysnake/blabber/impl/common/validation/DialogueValidator.java index df2cc1fe..d776df18 100644 --- a/src/main/java/org/ladysnake/blabber/impl/common/validation/DialogueValidator.java +++ b/src/main/java/org/ladysnake/blabber/impl/common/validation/DialogueValidator.java @@ -93,7 +93,7 @@ public static ValidationResult validateStructure(DialogueTemplate dialogue) { for (Map.Entry state : dialogue.states().entrySet()) { for (String illustration : state.getValue().illustrations()) { if (!dialogue.illustrations().containsKey(illustration)) { - warnings.add(new ValidationResult.Warning.NonexistentIllustrationList(state.getKey(), illustration)); + return new ValidationResult.Error.NonexistentIllustrationList(state.getKey(), illustration); } } } diff --git a/src/main/java/org/ladysnake/blabber/impl/common/validation/ValidationResult.java b/src/main/java/org/ladysnake/blabber/impl/common/validation/ValidationResult.java index dd4ffc02..eff11917 100644 --- a/src/main/java/org/ladysnake/blabber/impl/common/validation/ValidationResult.java +++ b/src/main/java/org/ladysnake/blabber/impl/common/validation/ValidationResult.java @@ -53,14 +53,6 @@ public String message() { return state() + " only has conditional paths to the end of the dialogue"; } } - - record NonexistentIllustrationList(String state, String illustration) implements Warning { - - @Override - public String message() { - return state() + " references non-existent illustration list " + illustration(); - } - } } sealed interface Error extends ValidationResult { @@ -81,5 +73,12 @@ public String message() { return state() + " does not have any path to the end of the dialogue"; } } + + record NonexistentIllustrationList(String state, String illustration) implements Error { + @Override + public String message() { + return state() + " references non-existent illustration list " + illustration(); + } + } } }