per type texture for disc shelf tms
Signed-off-by: Polymeta <4726322-polymeta@users.noreply.gitlab.com>
@@ -59,6 +59,8 @@
|
||||
- Updated various recipes to display in Recipe Groups within the Recipe Book
|
||||
- Updated most recipes to display more logically/consistently within the Recipe Book's categories
|
||||
- Make ride rotations less jittery in multiplayer.
|
||||
- Changes tm shelf discs to use textures instead of tinting and overlays to line up with item display
|
||||
- Blank TM can now be inserted into the Disc Shelf
|
||||
|
||||
### Fixes
|
||||
- Correctly grants "They're Minerals!" advancement when planting a type gem
|
||||
|
||||
@@ -128,6 +128,7 @@ class DiscShelfBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cobbl
|
||||
|
||||
fun isValidItem(stack: ItemStack): Boolean {
|
||||
return stack.item is TechnicalMachineItem
|
||||
|| stack.item == CobblemonItems.BLANK_TM
|
||||
|| stack.item == CobblemonItems.UPGRADE
|
||||
|| stack.item == CobblemonItems.DUBIOUS_DISC
|
||||
|| stack.has(DataComponents.JUKEBOX_PLAYABLE)
|
||||
|
||||
@@ -82,7 +82,7 @@ class MovesLearnsetWidget(val pX: Int, val pY: Int) : SoundlessWidget(
|
||||
|
||||
private val moveSlot = cobblemonResource("textures/gui/pokedex/move_slot.png")
|
||||
private val moveSlotSelected = cobblemonResource("textures/gui/pokedex/move_slot_select.png")
|
||||
private val tmSprite = cobblemonResource("textures/item/tms/blank_disc.png")
|
||||
private val tmSprite = cobblemonResource("textures/item/tms/blank_tm.png")
|
||||
private val tmSpriteUndiscovered = cobblemonResource("textures/gui/pokedex/tm_undiscovered.png")
|
||||
private val scrollBorderTop = cobblemonResource("textures/gui/pokedex/move_scroll_border.png")
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
package com.cobblemon.mod.common.client.render.block
|
||||
|
||||
import com.cobblemon.mod.common.CobblemonItemComponents
|
||||
import com.cobblemon.mod.common.block.entity.DiscShelfBlockEntity
|
||||
import com.cobblemon.mod.common.CobblemonItems
|
||||
import com.cobblemon.mod.common.client.render.color.TechnicalMachineItemColorProvider
|
||||
import com.cobblemon.mod.common.util.cobblemonResource
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer
|
||||
@@ -44,11 +44,8 @@ class DiscShelfBlockEntityRenderer(ctx: BlockEntityRendererProvider.Context) :
|
||||
private val rightMargin = 1f
|
||||
private val topMargin = 1f
|
||||
private val interRowSpacing = 0f
|
||||
private val tmOverlayDepthOffset = -0.0002f
|
||||
private val slotBrightnessMultiplier = 0.65f
|
||||
|
||||
private val tmBaseTexture = cobblemonResource("textures/block/disc_shelf/technical_machine_base.png")
|
||||
private val tmOverlayTexture = cobblemonResource("textures/block/disc_shelf/technical_machine_overlay.png")
|
||||
private val musicDiscUnknownTexture = cobblemonResource("textures/block/disc_shelf/music_disc_unknown.png")
|
||||
|
||||
override fun render(
|
||||
@@ -101,35 +98,19 @@ class DiscShelfBlockEntityRenderer(ctx: BlockEntityRendererProvider.Context) :
|
||||
poseStack.translate(posX, posY, -0.001f)
|
||||
|
||||
if (item.item == CobblemonItems.TECHNICAL_MACHINE) {
|
||||
val baseColor = TechnicalMachineItemColorProvider.getColor(item, 0)
|
||||
val overlayColor = TechnicalMachineItemColorProvider.getColor(item, 1)
|
||||
|
||||
val elementId = item.components.get(CobblemonItemComponents.TM_MOVE)!!.move.elementalType.showdownId
|
||||
val resource = cobblemonResource("textures/block/disc_shelf/${elementId}_tm.png")
|
||||
renderSlotQuad(
|
||||
poseStack,
|
||||
buffer,
|
||||
tmBaseTexture,
|
||||
baseColor,
|
||||
resource,
|
||||
0xFFFFFF,
|
||||
packedLight,
|
||||
slotWidth,
|
||||
slotHeight,
|
||||
tint = true,
|
||||
useTextRenderType = true
|
||||
)
|
||||
|
||||
poseStack.pushPose()
|
||||
poseStack.translate(0.0, 0.0, tmOverlayDepthOffset.toDouble())
|
||||
renderSlotQuad(
|
||||
poseStack,
|
||||
buffer,
|
||||
tmOverlayTexture,
|
||||
overlayColor,
|
||||
packedLight,
|
||||
slotWidth,
|
||||
slotHeight,
|
||||
tint = true,
|
||||
useTextRenderType = true
|
||||
)
|
||||
poseStack.popPose()
|
||||
} else {
|
||||
val tex = getItemTexture(item)
|
||||
renderSlotQuad(
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Cobblemon Contributors
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
package com.cobblemon.mod.common.client.render.color
|
||||
|
||||
import com.cobblemon.mod.common.api.types.ElementalTypes
|
||||
import com.cobblemon.mod.common.item.components.TMMoveComponent.Companion.getTMMove
|
||||
import net.minecraft.client.color.item.ItemColor
|
||||
import net.minecraft.util.FastColor
|
||||
import net.minecraft.world.item.ItemStack
|
||||
|
||||
object TechnicalMachineItemColorProvider : ItemColor {
|
||||
override fun getColor(itemStack: ItemStack, layer: Int): Int {
|
||||
val moveType = getTMMove(itemStack)?.elementalType ?: ElementalTypes.NORMAL
|
||||
val color = when (layer) {
|
||||
0 -> moveType.primaryColor
|
||||
1 -> moveType.secondaryColor
|
||||
else -> 0xFFFFFF
|
||||
}
|
||||
return FastColor.ARGB32.opaque(color)
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 403 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 401 B |
|
After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 404 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 404 B |
|
After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 411 B |
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 399 B |
|
After Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 411 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 408 B |
|
Before Width: | Height: | Size: 98 B |
|
Before Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 90 B |
|
After Width: | Height: | Size: 406 B |