fix: Tooltips of other fabric mods not being displayed in REI
This commit is contained in:
@@ -47,7 +47,7 @@ object NEUItemEntryRenderer : EntryRenderer<SBItemStack> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val minecraft = MinecraftClient.getInstance()
|
val minecraft = MinecraftClient.getInstance()
|
||||||
var canUseVanillaTooltipEvents = false
|
var canUseVanillaTooltipEvents = true
|
||||||
|
|
||||||
override fun getTooltip(entry: EntryStack<SBItemStack>, tooltipContext: TooltipContext): Tooltip? {
|
override fun getTooltip(entry: EntryStack<SBItemStack>, tooltipContext: TooltipContext): Tooltip? {
|
||||||
val stack = entry.value.asImmutableItemStack()
|
val stack = entry.value.asImmutableItemStack()
|
||||||
@@ -60,6 +60,7 @@ object NEUItemEntryRenderer : EntryRenderer<SBItemStack> {
|
|||||||
stack, tooltipContext.vanillaContext(), TooltipType.BASIC, lore
|
stack, tooltipContext.vanillaContext(), TooltipType.BASIC, lore
|
||||||
)
|
)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
canUseVanillaTooltipEvents = false
|
||||||
ErrorUtil.softError("Failed to use vanilla tooltips", ex)
|
ErrorUtil.softError("Failed to use vanilla tooltips", ex)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package moe.nea.firmament.events
|
|||||||
import java.util.concurrent.CopyOnWriteArrayList
|
import java.util.concurrent.CopyOnWriteArrayList
|
||||||
import org.apache.commons.lang3.reflect.TypeUtils
|
import org.apache.commons.lang3.reflect.TypeUtils
|
||||||
import moe.nea.firmament.Firmament
|
import moe.nea.firmament.Firmament
|
||||||
|
import moe.nea.firmament.util.ErrorUtil
|
||||||
import moe.nea.firmament.util.MC
|
import moe.nea.firmament.util.MC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,7 +49,7 @@ open class FirmamentEventBus<T : FirmamentEvent> {
|
|||||||
val klass = e.javaClass
|
val klass = e.javaClass
|
||||||
if (!function.knownErrors.contains(klass) || Firmament.DEBUG) {
|
if (!function.knownErrors.contains(klass) || Firmament.DEBUG) {
|
||||||
function.knownErrors.add(klass)
|
function.knownErrors.add(klass)
|
||||||
Firmament.logger.error("Caught exception during processing event $event by $function", e)
|
ErrorUtil.softError("Caught exception during processing event $event by $function", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user