Skip to content

Commit e25f500

Browse files
committed
Code cleanup
1 parent 936b42e commit e25f500

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInvalidPattern.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import at.petrak.hexcasting.api.pigment.FrozenPigment
1010
import net.minecraft.network.chat.Component
1111
import net.minecraft.world.item.DyeColor
1212

13-
class MishapInvalidPattern(val pattern: HexPattern? = null) : Mishap() {
13+
class MishapInvalidPattern(val pattern: HexPattern?) : Mishap() {
14+
@Deprecated("Provide the pattern that caused the mishap as an argument")
15+
constructor() : this(null) {}
16+
1417
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
1518
dyeColor(DyeColor.YELLOW)
1619

@@ -22,6 +25,6 @@ class MishapInvalidPattern(val pattern: HexPattern? = null) : Mishap() {
2225

2326
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context): Component? {
2427
if (pattern == null) return error("invalid_pattern_generic")
25-
else return error("invalid_pattern", PatternIota.display(pattern))
28+
return error("invalid_pattern", PatternIota.display(pattern))
2629
}
2730
}

0 commit comments

Comments
 (0)