mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 02:39:48 -04:00
Don't display empty stacks.
This commit is contained in:
parent
a766c6f213
commit
ac756b6770
@ -36,7 +36,7 @@ class Drone(val parent: Delegator) extends traits.Delegate with CustomModel {
|
||||
override protected def tooltipExtended(stack: ItemStack, tooltip: util.List[String]): Unit = {
|
||||
if (KeyBindings.showExtendedTooltips) {
|
||||
val info = new DroneData(stack)
|
||||
for (component <- info.components if component != null) {
|
||||
for (component <- info.components if !component.isEmpty) {
|
||||
tooltip.add("- " + component.getDisplayName)
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,14 @@
|
||||
package li.cil.oc.util
|
||||
|
||||
import net.minecraft.item.ItemStack
|
||||
|
||||
import scala.math.ScalaNumber
|
||||
|
||||
object ResultWrapper {
|
||||
def result(args: Any*): Array[AnyRef] = {
|
||||
def unwrap(arg: Any): AnyRef = arg match {
|
||||
case x: ScalaNumber => x.underlying
|
||||
case x: ItemStack if x.isEmpty => null
|
||||
case x => x.asInstanceOf[AnyRef]
|
||||
}
|
||||
Array(args map unwrap: _*)
|
||||
|
Loading…
x
Reference in New Issue
Block a user