matter capacitor gauge
@ -132,9 +132,9 @@ fun addItemModels(provider: MatteryItemModelProvider) {
|
||||
provider.generated(MItems.BATTERY_CREATIVE)
|
||||
provider.generated(MItems.PROCEDURAL_BATTERY, modLocation("item/battery_procedural"))
|
||||
|
||||
provider.generated(MItems.MATTER_CAPACITOR_BASIC, modLocation("item/matter_capacitor_tier1"))
|
||||
provider.generated(MItems.MATTER_CAPACITOR_NORMAL, modLocation("item/matter_capacitor_tier2"))
|
||||
provider.generated(MItems.MATTER_CAPACITOR_DENSE, modLocation("item/matter_capacitor_tier3"))
|
||||
provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_BASIC, baseTexture = modLocation("item/matter_capacitor_tier1"))
|
||||
provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_NORMAL, baseTexture = modLocation("item/matter_capacitor_tier2"))
|
||||
provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_DENSE, baseTexture = modLocation("item/matter_capacitor_tier3"))
|
||||
provider.generated(MItems.MATTER_CAPACITOR_CREATIVE)
|
||||
|
||||
provider.generated(MItems.MachineUpgrades.Basic.BLANK, modLocation("item/machine_upgrade_tier1"))
|
||||
|
@ -143,6 +143,33 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
|
||||
.texture("layer1", modLocation("item/machine_upgrade_icon_$upgradeType"))
|
||||
}
|
||||
|
||||
fun capacitorWithGauge(item: Item, fillTextures: Int = 8, baseTexture: ResourceLocation?) = exec {
|
||||
val path = item.registryName!!.path
|
||||
val texture = baseTexture ?: modLocation("item/$path")
|
||||
|
||||
val empty = withExistingParent("${path}_empty", GENERATED)
|
||||
.texture("layer0", texture)
|
||||
|
||||
val basic = withExistingParent(path, GENERATED)
|
||||
.texture("layer0", texture)
|
||||
.texture("layer1", modLocation("item/matter_capacitor_gauge_$fillTextures"))
|
||||
.override()
|
||||
.predicate(modLocation("matter_capacitor_fill"), 0f)
|
||||
.model(empty)
|
||||
.end()
|
||||
|
||||
for (i in 1 .. fillTextures) {
|
||||
val model = withExistingParent("${path}_fill_$i", GENERATED)
|
||||
.texture("layer0", texture)
|
||||
.texture("layer1", modLocation("item/matter_capacitor_gauge_$i"))
|
||||
|
||||
basic.override()
|
||||
.predicate(modLocation("matter_capacitor_fill"), i.toFloat() / fillTextures.toFloat())
|
||||
.model(model)
|
||||
.end()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val ARMOR_TRIM_MATERIALS = listOf("quartz", "iron", "netherite", "redstone", "copper", "gold", "emerald", "diamond", "lapis", "amethyst")
|
||||
val GENERATED = ResourceLocation("minecraft", "item/generated")
|
||||
|
@ -36,6 +36,7 @@ import ru.dbotthepony.mc.otm.block.decorative.CargoCrateBlock
|
||||
import ru.dbotthepony.mc.otm.block.decorative.ComputerTerminalBlock
|
||||
import ru.dbotthepony.mc.otm.block.decorative.StarChairBlock
|
||||
import ru.dbotthepony.mc.otm.block.decorative.TritaniumPressurePlate
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matteryEnergy
|
||||
import ru.dbotthepony.mc.otm.client.MatteryGUI
|
||||
import ru.dbotthepony.mc.otm.util.ResourceLocation
|
||||
@ -317,6 +318,13 @@ object MRegistry : IBlockItemRegistryAcceptor {
|
||||
val tag = stack.getOrDefault(MDataComponentTypes.Configurator.CONFIGURATION, CompoundTag())
|
||||
if (tag.isEmpty) 0f else 1f
|
||||
}
|
||||
|
||||
for (item in MItems.MATTER_CAPACITORS) {
|
||||
ItemProperties.register(item, ResourceLocation(OverdriveThatMatters.MOD_ID, "matter_capacitor_fill")) { stack, _, _, _ ->
|
||||
val cap = stack.getCapability(MatteryCapability.MATTER_ITEM) ?: return@register 1f
|
||||
(cap.storedMatter / cap.maxStoredMatter).toFloat()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 371 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 385 B |
After Width: | Height: | Size: 398 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 397 B |
After Width: | Height: | Size: 386 B |
After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 480 B |
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 483 B |