Fix throughput on batteries being wrong if no si prefix is present
This commit is contained in:
parent
0812ccf379
commit
8eee289020
@ -43,7 +43,6 @@ class BatteryItem : Item {
|
||||
val storage: ImpreciseFraction
|
||||
val receive: ImpreciseFraction
|
||||
val extract: ImpreciseFraction
|
||||
private val throughputText: Component
|
||||
|
||||
constructor(storage: ImpreciseFraction, receive: ImpreciseFraction, extract: ImpreciseFraction) : super(
|
||||
Properties().stacksTo(1).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)
|
||||
@ -52,11 +51,6 @@ class BatteryItem : Item {
|
||||
this.storage = storage
|
||||
this.receive = receive
|
||||
this.extract = extract
|
||||
throughputText = TranslatableComponent(
|
||||
"otm.item.power.normal.throughput",
|
||||
receive.formatPower(),
|
||||
extract.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY)
|
||||
}
|
||||
|
||||
constructor() : super(Properties().stacksTo(1).rarity(Rarity.EPIC).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) {
|
||||
@ -64,7 +58,6 @@ class BatteryItem : Item {
|
||||
storage = ImpreciseFraction.LONG_MAX_VALUE
|
||||
receive = ImpreciseFraction.LONG_MAX_VALUE
|
||||
extract = ImpreciseFraction.LONG_MAX_VALUE
|
||||
throughputText = TranslatableComponent("otm.item.power.infinite.throughput").withStyle(ChatFormatting.GRAY)
|
||||
}
|
||||
|
||||
override fun appendHoverText(
|
||||
@ -77,7 +70,7 @@ class BatteryItem : Item {
|
||||
|
||||
if (isCreative) {
|
||||
p_41423_.add(INFINITE_STORAGE)
|
||||
p_41423_.add(throughputText)
|
||||
p_41423_.add(TranslatableComponent("otm.item.power.infinite.throughput").withStyle(ChatFormatting.GRAY))
|
||||
} else {
|
||||
stack.getCapability(MatteryCapability.ENERGY).ifPresentK {
|
||||
p_41423_.add(
|
||||
@ -89,7 +82,11 @@ class BatteryItem : Item {
|
||||
)
|
||||
}
|
||||
|
||||
p_41423_.add(throughputText)
|
||||
p_41423_.add(TranslatableComponent(
|
||||
"otm.item.power.normal.throughput",
|
||||
receive.formatPower(),
|
||||
extract.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user