GearShocky — Вчера, в 15:24

ну давай ещё полоску на батарейках влепи
(она сверху)
This commit is contained in:
YuRaNnNzZZ 2025-04-05 00:19:56 +03:00
parent 4faef9d7c9
commit 3e59eb5595
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D
30 changed files with 25 additions and 13 deletions

View File

@ -128,13 +128,17 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.BREAD_MONSTER_SPAWN_EGG, modLocation("item/egg/bread_monster"))
provider.generated(MItems.LOADER_SPAWN_EGG, modLocation("item/egg/loader"))
provider.generatedTiered(MItems.BATTERIES, "battery_tier")
provider.capacitorWithGauge(MItems.BATTERY_CRUDE, 10, "battery_gauge_", modLocation("item/battery_tier0"))
provider.capacitorWithGauge(MItems.BATTERY_BASIC, 10, "battery_gauge_", modLocation("item/battery_tier1"))
provider.capacitorWithGauge(MItems.BATTERY_NORMAL, 10, "battery_gauge_", modLocation("item/battery_tier2"))
provider.capacitorWithGauge(MItems.BATTERY_DENSE, 10, "battery_gauge_", modLocation("item/battery_tier3"))
provider.capacitorWithGauge(MItems.BATTERY_CAPACITOR, 10, "battery_gauge_", modLocation("item/battery_tier4"))
provider.generated(MItems.BATTERY_CREATIVE)
provider.generated(MItems.PROCEDURAL_BATTERY, modLocation("item/battery_procedural"))
provider.capacitorWithGauge(MItems.PROCEDURAL_BATTERY, 9, "battery_procedural_gauge_", modLocation("item/battery_procedural"))
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.capacitorWithGauge(MItems.MATTER_CAPACITOR_BASIC, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier1"))
provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_NORMAL, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier2"))
provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_DENSE, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier3"))
provider.generated(MItems.MATTER_CAPACITOR_CREATIVE)
provider.generated(MItems.MachineUpgrades.Basic.BLANK, modLocation("item/machine_upgrade_tier1"))
@ -182,8 +186,8 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.upgrade(MItems.MachineUpgrades.Creative.MATTER_STORAGE_FLAT_SMALL, "matter", "creative")
provider.generated(MItems.QUANTUM_BATTERY)
provider.generated(MItems.QUANTUM_CAPACITOR)
provider.capacitorWithGauge(MItems.QUANTUM_BATTERY, 10, "battery_gauge_")
provider.capacitorWithGauge(MItems.QUANTUM_CAPACITOR, 10, "battery_gauge_")
provider.generated(MItems.QUANTUM_BATTERY_CREATIVE)
provider.generated(MItems.PATTERN_DRIVE_NORMAL, modLocation("item/pattern_drive_tier1"))

View File

@ -143,7 +143,7 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
.texture("layer1", modLocation("item/machine_upgrade_icon_$upgradeType"))
}
fun capacitorWithGauge(item: Item, fillTextures: Int = 8, baseTexture: ResourceLocation?) = exec {
fun capacitorWithGauge(item: Item, fillTextures: Int, gaugePrefix: String, baseTexture: ResourceLocation? = null) = exec {
val path = item.registryName!!.path
val texture = baseTexture ?: modLocation("item/$path")
@ -152,19 +152,19 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
val basic = withExistingParent(path, GENERATED)
.texture("layer0", texture)
.texture("layer1", modLocation("item/matter_capacitor_gauge_$fillTextures"))
.texture("layer1", modLocation("item/${gaugePrefix}$fillTextures"))
.override()
.predicate(modLocation("matter_capacitor_fill"), 0f)
.predicate(modLocation("capacitor_gauge"), 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"))
.texture("layer1", modLocation("item/${gaugePrefix}$i"))
basic.override()
.predicate(modLocation("matter_capacitor_fill"), i.toFloat() / fillTextures.toFloat())
.predicate(modLocation("capacitor_gauge"), i.toFloat() / fillTextures.toFloat())
.model(model)
.end()
}

View File

@ -320,11 +320,19 @@ object MRegistry : IBlockItemRegistryAcceptor {
}
for (item in MItems.MATTER_CAPACITORS) {
ItemProperties.register(item, ResourceLocation(OverdriveThatMatters.MOD_ID, "matter_capacitor_fill")) { stack, _, _, _ ->
ItemProperties.register(item, ResourceLocation(OverdriveThatMatters.MOD_ID, "capacitor_gauge")) { stack, _, _, _ ->
val cap = stack.getCapability(MatteryCapability.MATTER_ITEM) ?: return@register 1f
(cap.storedMatter / cap.maxStoredMatter).toFloat()
}
}
for (item in MItems.ALL_BATTERIES) {
ItemProperties.register(item, ResourceLocation(OverdriveThatMatters.MOD_ID, "capacitor_gauge")) { stack, _, _, _ ->
val energy = stack.matteryEnergy ?: return@register 1f
(energy.batteryLevel / energy.maxBatteryLevel).toFloat()
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 488 B