Compare commits
No commits in common. "fdf8e47e5e68b09989fb1ba1b49c27e8b895d35f" and "2f5981b3de3e7393dc31779faac4e2ab38a09a3a" have entirely different histories.
fdf8e47e5e
...
2f5981b3de
@ -380,7 +380,8 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
|
|||||||
for ((color, item) in MRegistry.COMPUTER_TERMINAL.allItems) {
|
for ((color, item) in MRegistry.COMPUTER_TERMINAL.allItems) {
|
||||||
val builder = MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
|
val builder = MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
|
||||||
|
|
||||||
builder.row(MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS)
|
builder.rowB(MItemTags.BASIC_CIRCUIT)
|
||||||
|
builder.rowB(MItemTags.TRITANIUM_PLATES)
|
||||||
|
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
builder.rowB(color.tag)
|
builder.rowB(color.tag)
|
||||||
|
@ -24,7 +24,6 @@ import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
|||||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatHistory
|
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatMatter
|
import ru.dbotthepony.mc.otm.core.util.formatMatter
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatMatterLevel
|
import ru.dbotthepony.mc.otm.core.util.formatMatterLevel
|
||||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||||
@ -138,6 +137,21 @@ open class MatterGaugePanel<out S : Screen> @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun formatLevel(a: Decimal, b: Decimal): Component {
|
||||||
|
val diff = a - b
|
||||||
|
|
||||||
|
val fa = a.formatMatter(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_GREEN)
|
||||||
|
val fb = b.formatMatter(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_RED)
|
||||||
|
|
||||||
|
if (diff.isZero) {
|
||||||
|
return TranslatableComponent("otm.gui.diff", diff.formatMatter(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.GRAY), fa, fb)
|
||||||
|
} else if (diff.isPositive) {
|
||||||
|
return TranslatableComponent("otm.gui.diff", diff.formatMatter(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_GREEN), fa, fb)
|
||||||
|
} else {
|
||||||
|
return TranslatableComponent("otm.gui.diff", (-diff).formatMatter(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_RED), fa, fb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
open class ProfiledMatterGaugePanel<out S : Screen>(
|
open class ProfiledMatterGaugePanel<out S : Screen>(
|
||||||
screen: S,
|
screen: S,
|
||||||
parent: EditablePanel<*>? = null,
|
parent: EditablePanel<*>? = null,
|
||||||
@ -147,12 +161,29 @@ open class ProfiledMatterGaugePanel<out S : Screen>(
|
|||||||
): MatterGaugePanel<S>(screen, parent, profiledWidget.gauge, x, y) {
|
): MatterGaugePanel<S>(screen, parent, profiledWidget.gauge, x, y) {
|
||||||
override fun makeTooltip(): MutableList<Component> {
|
override fun makeTooltip(): MutableList<Component> {
|
||||||
return super.makeTooltip().also {
|
return super.makeTooltip().also {
|
||||||
formatHistory(
|
it.add(TextComponent(""))
|
||||||
it,
|
|
||||||
profiledWidget,
|
if (minecraft.window.isShiftDown) {
|
||||||
verbose = ShiftPressedCond,
|
it.add(formatLevel(profiledWidget.lastTickReceive, profiledWidget.lastTickTransfer))
|
||||||
suffix = TranslatableComponent("otm.gui.matter.name")
|
it.add(TextComponent("---"))
|
||||||
)
|
}
|
||||||
|
|
||||||
|
it.add(formatLevel(
|
||||||
|
profiledWidget.weightedReceive,
|
||||||
|
profiledWidget.weightedTransfer,
|
||||||
|
))
|
||||||
|
|
||||||
|
if (minecraft.window.isShiftDown) {
|
||||||
|
it.add(TextComponent("---"))
|
||||||
|
val values = IntArrayList()
|
||||||
|
|
||||||
|
values.addAll(profiledWidget.tick downTo 0)
|
||||||
|
values.addAll(AbstractProfiledStorage.HISTORY_SIZE - 1 downTo profiledWidget.tick + 1)
|
||||||
|
|
||||||
|
for (i in values.intIterator()) {
|
||||||
|
it.add(formatLevel(profiledWidget.historyReceive[i].value, profiledWidget.historyTransfer[i].value))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ import ru.dbotthepony.mc.otm.client.render.*
|
|||||||
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatHistory
|
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatPower
|
import ru.dbotthepony.mc.otm.core.util.formatPower
|
||||||
import ru.dbotthepony.mc.otm.core.util.formatPowerLevel
|
import ru.dbotthepony.mc.otm.core.util.formatPowerLevel
|
||||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||||
@ -95,6 +94,21 @@ fun <S : Screen> WidePowerGaugePanel(
|
|||||||
height: Float = 48f
|
height: Float = 48f
|
||||||
) = PowerGaugePanel(screen, parent, widget, x, y, width, height)
|
) = PowerGaugePanel(screen, parent, widget, x, y, width, height)
|
||||||
|
|
||||||
|
private fun formatLevel(a: Decimal, b: Decimal): Component {
|
||||||
|
val diff = a - b
|
||||||
|
|
||||||
|
val fa = a.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_GREEN)
|
||||||
|
val fb = b.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_RED)
|
||||||
|
|
||||||
|
if (diff.isZero) {
|
||||||
|
return TranslatableComponent("otm.gui.diff", diff.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.GRAY), fa, fb)
|
||||||
|
} else if (diff.isPositive) {
|
||||||
|
return TranslatableComponent("otm.gui.diff", diff.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_GREEN), fa, fb)
|
||||||
|
} else {
|
||||||
|
return TranslatableComponent("otm.gui.diff", (-diff).formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.DARK_RED), fa, fb)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
open class ProfiledPowerGaugePanel<out S : Screen>(
|
open class ProfiledPowerGaugePanel<out S : Screen>(
|
||||||
screen: S,
|
screen: S,
|
||||||
parent: EditablePanel<*>? = null,
|
parent: EditablePanel<*>? = null,
|
||||||
@ -106,12 +120,29 @@ open class ProfiledPowerGaugePanel<out S : Screen>(
|
|||||||
) : PowerGaugePanel<S>(screen, parent, profiledWidget.gauge, x, y, width, height) {
|
) : PowerGaugePanel<S>(screen, parent, profiledWidget.gauge, x, y, width, height) {
|
||||||
override fun makeTooltip(): MutableList<Component> {
|
override fun makeTooltip(): MutableList<Component> {
|
||||||
return super.makeTooltip().also {
|
return super.makeTooltip().also {
|
||||||
formatHistory(
|
it.add(TextComponent(""))
|
||||||
it,
|
|
||||||
profiledWidget,
|
if (minecraft.window.isShiftDown) {
|
||||||
verbose = ShiftPressedCond,
|
it.add(formatLevel(profiledWidget.lastTickReceive, profiledWidget.lastTickTransfer))
|
||||||
suffix = TranslatableComponent("otm.gui.power.name")
|
it.add(TextComponent("---"))
|
||||||
)
|
}
|
||||||
|
|
||||||
|
it.add(formatLevel(
|
||||||
|
profiledWidget.weightedReceive,
|
||||||
|
profiledWidget.weightedTransfer,
|
||||||
|
))
|
||||||
|
|
||||||
|
if (minecraft.window.isShiftDown) {
|
||||||
|
it.add(TextComponent("---"))
|
||||||
|
val values = IntArrayList()
|
||||||
|
|
||||||
|
values.addAll(profiledWidget.tick downTo 0)
|
||||||
|
values.addAll(AbstractProfiledStorage.HISTORY_SIZE - 1 downTo profiledWidget.tick + 1)
|
||||||
|
|
||||||
|
for (i in values.intIterator()) {
|
||||||
|
it.add(formatLevel(profiledWidget.historyReceive[i].value, profiledWidget.historyTransfer[i].value))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,11 +43,11 @@ class CombinedContainer(containers: Stream<Pair<Container, Iterable<Int>>>) : IM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val slots: ImmutableList<Slot>
|
private val slots: List<Slot>
|
||||||
private val slotsMap: ImmutableMap<Container, List<IContainerSlot>>
|
private val slotsMap: Map<Container, List<IContainerSlot>>
|
||||||
private val containers: ImmutableSet<Container>
|
private val containers: Set<Container>
|
||||||
private val fullCoverage: ImmutableList<Container>
|
private val fullCoverage: List<Container>
|
||||||
private val notFullCoverage: ImmutableMap<Container, List<IContainerSlot>>
|
private val notFullCoverage: Map<Container, List<IContainerSlot>>
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val list = ImmutableList.Builder<Slot>()
|
val list = ImmutableList.Builder<Slot>()
|
||||||
|
@ -1,22 +1,15 @@
|
|||||||
package ru.dbotthepony.mc.otm.core.util
|
package ru.dbotthepony.mc.otm.core.util
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.chars.CharArrayList
|
import it.unimi.dsi.fastutil.chars.CharArrayList
|
||||||
import it.unimi.dsi.fastutil.ints.IntArrayList
|
|
||||||
import net.minecraft.ChatFormatting
|
|
||||||
import net.minecraft.network.chat.Component
|
import net.minecraft.network.chat.Component
|
||||||
import net.minecraft.network.chat.MutableComponent
|
|
||||||
import ru.dbotthepony.kommons.util.value
|
|
||||||
import ru.dbotthepony.mc.otm.capability.AbstractProfiledStorage
|
|
||||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
import ru.dbotthepony.mc.otm.core.math.isNegative
|
import ru.dbotthepony.mc.otm.core.math.isNegative
|
||||||
import ru.dbotthepony.mc.otm.core.math.isZero
|
import ru.dbotthepony.mc.otm.core.math.isZero
|
||||||
import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget
|
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
import java.util.function.BooleanSupplier
|
import java.util.function.BooleanSupplier
|
||||||
import kotlin.math.absoluteValue
|
import kotlin.math.absoluteValue
|
||||||
import kotlin.math.max
|
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
private fun concat(numbers: String, suffix: Any): Component {
|
private fun concat(numbers: String, suffix: Any): Component {
|
||||||
@ -134,7 +127,7 @@ private fun reformat(numbers: String): String {
|
|||||||
for (i in dot downTo 0) {
|
for (i in dot downTo 0) {
|
||||||
if (++c == 4) {
|
if (++c == 4) {
|
||||||
c = 1
|
c = 1
|
||||||
result.add(' ')
|
result.add(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
result.add(numbers[i])
|
result.add(numbers[i])
|
||||||
@ -145,19 +138,6 @@ private fun reformat(numbers: String): String {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// because minecraft's font 'Figure Space' (FSP) does not match width of numbers
|
|
||||||
private fun resplice(number: String, decimals: Int): String {
|
|
||||||
var i = if (decimals != 0) decimals + 4 else 3
|
|
||||||
val resplice = number.toCharArray()
|
|
||||||
|
|
||||||
while (i < number.length) {
|
|
||||||
resplice[resplice.size - i - 1] = ' '
|
|
||||||
i += 3
|
|
||||||
}
|
|
||||||
|
|
||||||
return String(resplice)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Long.formatSiComponent(suffix: Any = "", decimalPlaces: Int = 3, formatAsReadable: BooleanSupplier = never, bias: Int = 0): Component {
|
fun Long.formatSiComponent(suffix: Any = "", decimalPlaces: Int = 3, formatAsReadable: BooleanSupplier = never, bias: Int = 0): Component {
|
||||||
require(decimalPlaces >= 0) { "Invalid amount of decimal places required: $decimalPlaces" }
|
require(decimalPlaces >= 0) { "Invalid amount of decimal places required: $decimalPlaces" }
|
||||||
|
|
||||||
@ -254,85 +234,3 @@ fun formatTickDuration(ticks: Int, longFormat: Boolean = false): String {
|
|||||||
return "${padded(minutes)}:$seconds"
|
return "${padded(minutes)}:$seconds"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun formatHistory(
|
|
||||||
result: MutableList<Component>,
|
|
||||||
widget: ProfiledLevelGaugeWidget<*>,
|
|
||||||
bias: Int = 0,
|
|
||||||
decimals: Int = 3,
|
|
||||||
verbose: BooleanSupplier = never,
|
|
||||||
suffix: Any = "",
|
|
||||||
) {
|
|
||||||
data class Part(val formatted: String, val number: Decimal, val prefix: SiPrefix)
|
|
||||||
data class Line(val delta: Part, val incoming: Part, val outgoing: Part)
|
|
||||||
|
|
||||||
val lines = ArrayList<Line>()
|
|
||||||
|
|
||||||
fun part(number: Decimal): Part {
|
|
||||||
if (verbose.asBoolean && number.absoluteValue >= Decimal.ONE) {
|
|
||||||
return Part(reformat(number.toString(decimals)), number, SiPrefix.NONE)
|
|
||||||
}
|
|
||||||
|
|
||||||
val prefix = SiPrefix.determine(number).neighbour(bias)
|
|
||||||
if (prefix.isEmpty) return Part(number.toString(decimals), number, prefix)
|
|
||||||
return Part((number / prefix.decimal).toString(decimals), number, prefix)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun addLine(a: Decimal, b: Decimal) {
|
|
||||||
lines.add(Line(part(a - b), part(a), part(b)))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verbose.asBoolean) {
|
|
||||||
addLine(widget.lastTickReceive, widget.lastTickTransfer)
|
|
||||||
|
|
||||||
val values = IntArrayList()
|
|
||||||
values.addAll(widget.tick downTo 0)
|
|
||||||
values.addAll(AbstractProfiledStorage.HISTORY_SIZE - 1 downTo widget.tick + 1)
|
|
||||||
|
|
||||||
for (i in values.intIterator()) {
|
|
||||||
addLine(widget.historyReceive[i].value, widget.historyTransfer[i].value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addLine(
|
|
||||||
widget.weightedReceive,
|
|
||||||
widget.weightedTransfer
|
|
||||||
)
|
|
||||||
|
|
||||||
val maxWidthDeltaNumber = lines.maxOf { it.delta.formatted.length }
|
|
||||||
val maxWidthInNumber = lines.maxOf { it.incoming.formatted.length }
|
|
||||||
val maxWidthOutNumber = lines.maxOf { it.outgoing.formatted.length }
|
|
||||||
|
|
||||||
val maxWidthDeltaSi = lines.maxOf { it.delta.prefix.length }
|
|
||||||
val maxWidthInSi = lines.maxOf { it.incoming.prefix.length }
|
|
||||||
val maxWidthOutSi = lines.maxOf { it.outgoing.prefix.length }
|
|
||||||
|
|
||||||
fun Part.format(widthNumbers: Int, widthSi: Int): MutableComponent {
|
|
||||||
return TranslatableComponent(
|
|
||||||
prefix.formatLocaleKey,
|
|
||||||
resplice("-".repeat(max(widthNumbers - formatted.length, 0)) + formatted, decimals) + "-".repeat(max(widthSi - prefix.length, 0)),
|
|
||||||
suffix
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Line.format(): Component {
|
|
||||||
val deltaColor = if (delta.number.isZero) ChatFormatting.GRAY else if (delta.number.isPositive) ChatFormatting.DARK_GREEN else ChatFormatting.DARK_RED
|
|
||||||
|
|
||||||
return TranslatableComponent(
|
|
||||||
"otm.gui.diff",
|
|
||||||
delta.format(maxWidthDeltaNumber, maxWidthDeltaSi).withStyle(deltaColor),
|
|
||||||
incoming.format(maxWidthInNumber, maxWidthInSi).withStyle(ChatFormatting.DARK_GREEN),
|
|
||||||
outgoing.format(maxWidthOutNumber, maxWidthOutSi).withStyle(ChatFormatting.DARK_RED),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
result.add(TextComponent(""))
|
|
||||||
result.add(lines.removeFirst().format())
|
|
||||||
|
|
||||||
if (verbose.asBoolean) {
|
|
||||||
result.add(TextComponent("---"))
|
|
||||||
result.add(lines.removeFirst().format())
|
|
||||||
result.add(TextComponent("---"))
|
|
||||||
lines.forEach { result.add(it.format()) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package ru.dbotthepony.mc.otm.core.util
|
package ru.dbotthepony.mc.otm.core.util
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList
|
import com.google.common.collect.ImmutableList
|
||||||
import net.minecraft.network.chat.Component
|
|
||||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
import ru.dbotthepony.mc.otm.core.math.isZero
|
import ru.dbotthepony.mc.otm.core.math.isZero
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
@ -21,9 +19,6 @@ enum class SiPrefix(val power: Int, val symbol: String) {
|
|||||||
NONE(0, "") {
|
NONE(0, "") {
|
||||||
override val isEmpty: Boolean
|
override val isEmpty: Boolean
|
||||||
get() = true
|
get() = true
|
||||||
|
|
||||||
override val length: Int
|
|
||||||
get() = 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
KILO (1, "k"),
|
KILO (1, "k"),
|
||||||
@ -40,10 +35,6 @@ enum class SiPrefix(val power: Int, val symbol: String) {
|
|||||||
val formatLocaleKey = "otm.suffix.${name.lowercase()}".intern()
|
val formatLocaleKey = "otm.suffix.${name.lowercase()}".intern()
|
||||||
val conciseFormatLocaleKey = "otm.suffix_concise.${name.lowercase()}".intern()
|
val conciseFormatLocaleKey = "otm.suffix_concise.${name.lowercase()}".intern()
|
||||||
val rawLocaleKey = "otm.suffix_raw.${name.lowercase()}".intern()
|
val rawLocaleKey = "otm.suffix_raw.${name.lowercase()}".intern()
|
||||||
val rawLocale: Component = TranslatableComponent(rawLocaleKey)
|
|
||||||
|
|
||||||
open val length: Int
|
|
||||||
get() = rawLocale.string.length
|
|
||||||
|
|
||||||
val string: String
|
val string: String
|
||||||
|
|
||||||
@ -81,15 +72,18 @@ enum class SiPrefix(val power: Int, val symbol: String) {
|
|||||||
|
|
||||||
if (new < 0) {
|
if (new < 0) {
|
||||||
return YOCTO
|
return YOCTO
|
||||||
} else if (new >= entries.size) {
|
} else if (new >= VALUES.size) {
|
||||||
return YOTTA
|
return YOTTA
|
||||||
} else {
|
} else {
|
||||||
return entries[new]
|
return VALUES[new]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@JvmField
|
||||||
|
val VALUES: ImmutableList<SiPrefix> = ImmutableList.copyOf(values())
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
val MULTIPLIES: ImmutableList<SiPrefix> = ImmutableList.builder<SiPrefix>()
|
val MULTIPLIES: ImmutableList<SiPrefix> = ImmutableList.builder<SiPrefix>()
|
||||||
.add(NONE)
|
.add(NONE)
|
||||||
|
@ -330,26 +330,23 @@ object MItems {
|
|||||||
16,
|
16,
|
||||||
) { Ingredient.of(TRITANIUM_INGOT) }
|
) { Ingredient.of(TRITANIUM_INGOT) }
|
||||||
|
|
||||||
|
private val TOOLS_PROPRTIES = Item.Properties()
|
||||||
|
|
||||||
val TRITANIUM_SWORD: SwordItem by registry.register(MNames.TRITANIUM_SWORD) { SwordItem(TRITANIUM_COMPONENT,
|
val TRITANIUM_SWORD: SwordItem by registry.register(MNames.TRITANIUM_SWORD) { SwordItem(TRITANIUM_COMPONENT,
|
||||||
Properties().attributes(SwordItem.createAttributes(TRITANIUM_COMPONENT, 4f, -2.7f)))
|
TOOLS_PROPRTIES.attributes(SwordItem.createAttributes(TRITANIUM_COMPONENT, 4f, -2.7f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val TRITANIUM_SHOVEL: ShovelItem by registry.register(MNames.TRITANIUM_SHOVEL) { ShovelItem(TRITANIUM_COMPONENT,
|
val TRITANIUM_SHOVEL: ShovelItem by registry.register(MNames.TRITANIUM_SHOVEL) { ShovelItem(TRITANIUM_COMPONENT,
|
||||||
Properties().attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 1.5f, -2.4f)))
|
TOOLS_PROPRTIES.attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 1.5f, -2.4f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val TRITANIUM_AXE: MatteryAxeItem by registry.register(MNames.TRITANIUM_AXE) { MatteryAxeItem(TRITANIUM_COMPONENT,
|
val TRITANIUM_AXE: MatteryAxeItem by registry.register(MNames.TRITANIUM_AXE) { MatteryAxeItem(TRITANIUM_COMPONENT,
|
||||||
Properties().attributes(AxeItem.createAttributes(TRITANIUM_COMPONENT, 8.5f, -3.4f)))
|
TOOLS_PROPRTIES.attributes(AxeItem.createAttributes(TRITANIUM_COMPONENT, 8.5f, -3.4f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val TRITANIUM_PICKAXE: PickaxeItem by registry.register(MNames.TRITANIUM_PICKAXE) { PickaxeItem(TRITANIUM_COMPONENT,
|
val TRITANIUM_PICKAXE: PickaxeItem by registry.register(MNames.TRITANIUM_PICKAXE) { PickaxeItem(TRITANIUM_COMPONENT,
|
||||||
Properties().attributes(PickaxeItem.createAttributes(TRITANIUM_COMPONENT, 2f, -2.8f)))
|
TOOLS_PROPRTIES.attributes(PickaxeItem.createAttributes(TRITANIUM_COMPONENT, 2f, -2.8f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val TRITANIUM_HOE: HoeItem by registry.register(MNames.TRITANIUM_HOE) { HoeItem(TRITANIUM_COMPONENT,
|
val TRITANIUM_HOE: HoeItem by registry.register(MNames.TRITANIUM_HOE) { HoeItem(TRITANIUM_COMPONENT,
|
||||||
Properties().attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 0f, -3.4f)))
|
TOOLS_PROPRTIES.attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 0f, -3.4f)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val TRITANIUM_SHEARS: ShearsItem by registry.register(MNames.TRITANIUM_SHEARS) { object : ShearsItem(Properties().durability(3072)) {
|
val TRITANIUM_SHEARS: ShearsItem by registry.register(MNames.TRITANIUM_SHEARS) { object : ShearsItem(Properties().durability(3072)) {
|
||||||
override fun isValidRepairItem(pToRepair: ItemStack, pRepair: ItemStack): Boolean {
|
override fun isValidRepairItem(pToRepair: ItemStack, pRepair: ItemStack): Boolean {
|
||||||
return pRepair.`is`(MItemTags.TRITANIUM_INGOTS)
|
return pRepair.`is`(MItemTags.TRITANIUM_INGOTS)
|
||||||
|
Loading…
Reference in New Issue
Block a user