From 720cfdd1ed9fc203dd65bbcdc368e124dd35d3cf Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 4 May 2023 15:21:57 +0200 Subject: Slog more nullable references through the REI plugin --- .../moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt b/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt index 22835e6..8ea691b 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt @@ -85,20 +85,20 @@ object SBItemEntryDefinition : EntryDefinition { return VanillaEntryTypes.ITEM.definition.asFormattedText(entry.asItemEntry(), value.asItemStack()) } - override fun hash(entry: EntryStack, value: NEUItem, context: ComparisonContext): Long { + override fun hash(entry: EntryStack, value: NEUItem?, context: ComparisonContext): Long { // Repo items are immutable, and get replaced entirely when loaded from disk return System.identityHashCode(value) * 31L } - override fun wildcard(entry: EntryStack, value: NEUItem): NEUItem { + override fun wildcard(entry: EntryStack?, value: NEUItem?): NEUItem? { return value } - override fun normalize(entry: EntryStack, value: NEUItem): NEUItem { + override fun normalize(entry: EntryStack?, value: NEUItem?): NEUItem? { return value } - override fun copy(entry: EntryStack?, value: NEUItem): NEUItem { + override fun copy(entry: EntryStack?, value: NEUItem?): NEUItem? { return value } @@ -106,8 +106,8 @@ object SBItemEntryDefinition : EntryDefinition { return false } - override fun getIdentifier(entry: EntryStack?, value: NEUItem): Identifier { - return value.getIdentifier() + override fun getIdentifier(entry: EntryStack?, value: NEUItem?): Identifier { + return value?.getIdentifier() ?: Identifier.of("skyblockitem", "null")!! } -- cgit