error reporting for unexpected registry misses

This commit is contained in:
octarine-noise
2017-05-05 10:57:34 +02:00
parent 8ffca417fb
commit 5bea5cde99
6 changed files with 55 additions and 5 deletions

View File

@@ -1,7 +1,11 @@
@file:JvmName("Utils")
package mods.octarinecore.client.gui
import net.minecraft.util.text.TextFormatting.*
import net.minecraft.util.text.Style
import net.minecraft.util.text.TextComponentString
import net.minecraft.util.text.TextFormatting
import net.minecraft.util.text.TextFormatting.AQUA
import net.minecraft.util.text.TextFormatting.GRAY
fun stripTooltipDefaultText(tooltip: MutableList<String>) {
var defaultRows = false
@@ -10,4 +14,9 @@ fun stripTooltipDefaultText(tooltip: MutableList<String>) {
if (iter.next().startsWith(AQUA.toString())) defaultRows = true
if (defaultRows) iter.remove()
}
}
fun textComponent(msg: String, color: TextFormatting = GRAY): TextComponentString {
val style = Style().apply { this.color = color }
return TextComponentString(msg).apply { this.style = style }
}