Compare commits

..
Author SHA1 Message Date
Plastered_Crab c77963dec0 Add ORAS PC Variant and Galar PC Variant 2026-04-20 12:55:23 -07:00
Plastered_Crab 515986e7bd Add PC Variants (Gen4, Gen5, Gen7, XD) 2026-04-16 23:19:24 -07:00
Plastered_Crab 245f569c8a Add test Heart Gold Soul Silver PC variant from Mod Station 2026-04-16 16:21:56 -07:00
Plastered_Crab b7d8d85b1c Add test Dome Fossil mod station variants 2026-04-16 15:33:57 -07:00
Plastered_Crab 66ffb21bbd Add Modification Station with test variants of the Display Case 2026-04-16 11:53:54 -07:00
Jackson Bowes 9e4720b233 Merge branch 'S+' into '1.8.0'
Rewrote our Height Range Structure Prevention Mixin into a Processor for addon devs to use

See merge request cable-mc/cobblemon!2190
2026-04-03 14:42:43 -05:00
Aram 426cd50bb1 Rewrote our Height Range Structure Prevention Mixin into a Processor for addon devs to use 2026-04-03 14:42:43 -05:00
Test 0d33618e83 Merge branch '1.21.1-tm-fixes' into '1.8.0'
TM fixes, pokedex move screen updates

See merge request cable-mc/cobblemon!2191
2026-04-03 04:51:51 +00:00
Test 0803906f30 disk asset 2026-04-02 22:42:08 -04:00
Test 2c26046a3c rmv unused method 2026-04-02 21:15:55 -04:00
Test bdab3d04cb update tinting, cluster hitboxes 2026-04-02 20:08:05 -04:00
Test 59488974d6 update tmm json 2026-04-01 22:52:48 -04:00
Test 3f0561456f unused imports 2026-03-31 23:57:56 -04:00
Test 5279767829 merge 2026-03-31 23:52:26 -04:00
Test e3f8aacd9e Merge branch 'tmfix' into 1.21.1-tm-fixes
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/CobblemonBlocks.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/block/TypeGemClusterBlock.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/tmmachine/TMMachineScreen.kt
2026-03-31 23:20:17 -04:00
Test d381dd0d21 remove unnecessary TypeGemBlock, refactor monitor assets 2026-03-31 23:00:44 -04:00
Plastered_Crab 2dad3c3197 Fix Type Gem Cluster bugs 2026-03-31 13:38:21 -07:00
Plastered_Crab ea8e70d0fa Fix Type Gem Cluster bugs 2026-03-31 13:36:01 -07:00
Plastered_Crab 64717be354 Add lang files for the Type Gem Blocks, Clusters and Deepslate Crystal Core 2026-03-31 11:34:13 -07:00
Plastered_Crab bc9314b9d9 Add Baby Doll Eyes to TM list 2026-03-30 16:49:34 -07:00
Plastered_Crab 541f2dac40 Remove changes to TMMachineScreen about the Screensaver 2026-03-30 16:22:19 -07:00
Plastered_Crab adba69c675 TM Machine visually shows disc in it if there is a TM in the output slot too 2026-03-30 16:08:27 -07:00
Plastered_Crab ab831a2d9d Default TMs now show in Move Dex as Unlocked 2026-03-30 16:07:58 -07:00
Plastered_Crab faa939986a TM Machine screensaver to kick in after 1 minute idling and goes away when moving the mouse 2026-03-30 15:32:53 -07:00
Plastered_Crab b651bf1ded Fix fully evolved pokemon not tracking unlocked moves as well as Discovered TM moves in the Pokedex Move Dex 2026-03-30 15:09:04 -07:00
Plastered_Crab 8eb77cfc97 Fix hitboxes of Type Gem Clusters 2026-03-30 14:50:11 -07:00
Polymeta e54b22409a Merge branch 'clamp-structure-height' into '1.8.0'
Allow Slippy to define a range in which the structure will spawn

See merge request cable-mc/cobblemon!2185
2026-03-25 23:20:08 +00:00
MeAlam1 e03a3abe1d Update CHANGELOG-1.8.md 2026-03-25 23:33:03 +01:00
MeAlam1 497f832995 Update StructureMixin.java 2026-03-25 23:29:42 +01:00
1876 changed files with 11724 additions and 43967 deletions

No files matched your search

+2
View File
@@ -19,9 +19,11 @@
### Fixes
- Fixed rare Pokémon being far too likely to spawn multiple times in a single spawn cycle. The dev told me that the exact bug is too complicated to explain.
- Resolved the niche issue where Structures would spawn in an incorrect location, creating very funky world gen.
### Developer
- Tweaked the spawning selector interface to take a bucket function rather than a bucket directly.
- Added a new `cobblemon:height_range` processor type to allow developers to restrict structure spawning ranges.
### Molang & Datapacks
@@ -1,67 +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.mixin;
import com.cobblemon.mod.common.world.CobblemonStructureIDs;
import com.llamalad7.mixinextras.sugar.Local;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.RandomState;
import net.minecraft.world.level.levelgen.structure.Structure;
import net.minecraft.world.level.levelgen.structure.StructurePiece;
import net.minecraft.world.level.levelgen.structure.StructureStart;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Predicate;
@Mixin(Structure.class)
public abstract class StructureMixin {
// Define a set of structures that should not spawn below Sea Level
@Unique
private static final Set<ResourceLocation> RESTRICTED_STRUCTURES = new HashSet<>(Arrays.asList(
CobblemonStructureIDs.STONJOURNER_HENGE,
CobblemonStructureIDs.LUNA_HENGE,
CobblemonStructureIDs.SOL_HENGE
));
@Inject(method = "generate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/structure/StructureStart;isValid()Z"),
cancellable = true)
public void cobblemon$isValid(RegistryAccess registryAccess, ChunkGenerator chunkGenerator, BiomeSource biomeSource,
RandomState randomState, StructureTemplateManager structureTemplateManager, long seed,
ChunkPos chunkPos, int references, LevelHeightAccessor heightAccessor,
Predicate<Holder<Biome>> validBiome,
CallbackInfoReturnable<StructureStart> cir,
@Local StructureStart structureStart) {
ResourceLocation structureKey = registryAccess.registryOrThrow(Registries.STRUCTURE).getKey((Structure) (Object) this);
if(!RESTRICTED_STRUCTURES.contains(structureKey)) {
return;
}
for (StructurePiece piece : structureStart.getPieces()) {
if (piece.getBoundingBox().minY() < chunkGenerator.getSeaLevel()) {
cir.setReturnValue(StructureStart.INVALID_START);
return;
}
}
}
}
@@ -34,7 +34,10 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
val HEALING_MACHINE: BlockEntityType<HealingMachineBlockEntity> = this.create("healing_machine", BlockEntityType.Builder.of(::HealingMachineBlockEntity, CobblemonBlocks.HEALING_MACHINE).build(null))
@JvmField
val PC: BlockEntityType<PCBlockEntity> = this.create("pc", BlockEntityType.Builder.of(::PCBlockEntity, CobblemonBlocks.PC).build(null))
val PC: BlockEntityType<PCBlockEntity> = this.create(
"pc",
BlockEntityType.Builder.of(::PCBlockEntity, CobblemonBlocks.PC, *CobblemonModificationBlocks.pcVariantBlocks().toTypedArray()).build(null)
)
@JvmField
val LECTERN: BlockEntityType<LecternBlockEntity> = this.create("lectern", BlockEntityType.Builder.of(::LecternBlockEntity, CobblemonBlocks.LECTERN).build(null))
@@ -89,7 +92,11 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
@JvmField
val DISPLAY_CASE: BlockEntityType<DisplayCaseBlockEntity> = this.create("display_case",
BlockEntityType.Builder.of(::DisplayCaseBlockEntity, CobblemonBlocks.DISPLAY_CASE).build(null)
BlockEntityType.Builder.of(
::DisplayCaseBlockEntity,
CobblemonBlocks.DISPLAY_CASE,
*CobblemonModificationBlocks.displayCaseVariantBlocks().toTypedArray()
).build(null)
)
// TODO after 1.7
@@ -122,19 +122,19 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
val APRICORN_PLANKS = this.create("apricorn_planks",
Block(
BlockBehaviour.Properties.of().mapColor(MapColor.DIRT).instrument(NoteBlockInstrument.BASS)
.strength(2.0f, 3.0f).sound(SoundType.WOOD)
.strength(2.0F, 3.0F).sound(SoundType.WOOD)
)
)
@JvmField
val APRICORN_LEAVES = leaves("apricorn_leaves")
@JvmField
val APRICORN_FENCE = this.create("apricorn_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val APRICORN_FENCE = this.create("apricorn_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD)))
@JvmField
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(APRICORN_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).strength(2.0f, 3.0f).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
val APRICORN_FENCE_GATE = this.create("apricorn_fence_gate", FenceGateBlock(APRICORN_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).strength(2.0F, 3.0F).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
@JvmField
val APRICORN_BUTTON = this.create("apricorn_button", BlocksInvoker.createWoodenButtonBlock(APRICORN_BLOCK_SET_TYPE))
@JvmField
val APRICORN_PRESSURE_PLATE = this.create("apricorn_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(APRICORN_BLOCK_SET_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).noCollission().strength(0.5f).sound(SoundType.WOOD)))
val APRICORN_PRESSURE_PLATE = this.create("apricorn_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(APRICORN_BLOCK_SET_TYPE, BlockBehaviour.Properties.of().mapColor(APRICORN_PLANKS.defaultMapColor()).noCollission().strength(0.5F).sound(SoundType.WOOD)))
@JvmField
val APRICORN_SIGN = this.create("apricorn_sign", CobblemonSignBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_SIGN), APRICORN_WOOD_TYPE))
@@ -151,7 +151,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val APRICORN_WALL_HANGING_SIGN = this.create("apricorn_wall_hanging_sign", CobblemonWallHangingSignBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_HANGING_SIGN), APRICORN_WOOD_TYPE))
@JvmField
val APRICORN_SLAB = this.create("apricorn_slab", SlabBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val APRICORN_SLAB = this.create("apricorn_slab", SlabBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD)))
@JvmField
val APRICORN_STAIRS = this.create("apricorn_stairs", StairsBlockInvoker.`cobblemon$create`(APRICORN_PLANKS.defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(APRICORN_PLANKS)))
@JvmField
@@ -188,12 +188,12 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val STRIPPED_SACCHARINE_WOOD = this.create("stripped_saccharine_wood", RotatedPillarBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_LIGHT_BLUE).instrument(NoteBlockInstrument.BASS).strength(2.0F).sound(SoundType.WOOD).ignitedByLava())) //log("stripped_saccharine_log")
@JvmField
val SACCHARINE_PLANKS = this.create("saccharine_planks", Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_LIGHT_BLUE).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val SACCHARINE_PLANKS = this.create("saccharine_planks", Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_LIGHT_BLUE).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD)))
@JvmField
val SACCHARINE_LEAVES = this.create("saccharine_leaves", SaccharineLeafBlock(
BlockBehaviour.Properties.of().mapColor(
MapColor.PLANT
).strength(0.2f).randomTicks().sound(SoundType.GRASS).noOcclusion()
).strength(0.2F).randomTicks().sound(SoundType.GRASS).noOcclusion()
.isValidSpawn { _: BlockState?, _: BlockGetter?, _: BlockPos?, entity: EntityType<*>? ->
entity === EntityType.OCELOT || entity === EntityType.PARROT
}.isSuffocating { _: BlockState?, _: BlockGetter?, _: BlockPos? ->
@@ -205,13 +205,13 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
false
}))
@JvmField
val SACCHARINE_FENCE = this.create("saccharine_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val SACCHARINE_FENCE = this.create("saccharine_fence", FenceBlock(BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD)))
@JvmField
val SACCHARINE_FENCE_GATE = this.create("saccharine_fence_gate", FenceGateBlock(SACCHARINE_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
val SACCHARINE_FENCE_GATE = this.create("saccharine_fence_gate", FenceGateBlock(SACCHARINE_WOOD_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD).ignitedByLava().forceSolidOn()))
@JvmField
val SACCHARINE_BUTTON = this.create("saccharine_button", BlocksInvoker.createWoodenButtonBlock(BlockSetType.OAK))
@JvmField
val SACCHARINE_PRESSURE_PLATE = this.create("saccharine_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(SACCHARINE_BLOCK_SET_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).noCollission().strength(0.5f).sound(SoundType.WOOD)))
val SACCHARINE_PRESSURE_PLATE = this.create("saccharine_pressure_plate", PressurePlateBlockInvoker.`cobblemon$create`(SACCHARINE_BLOCK_SET_TYPE, BlockBehaviour.Properties.of().mapColor(SACCHARINE_PLANKS.defaultMapColor()).instrument(NoteBlockInstrument.BASS).noCollission().strength(0.5F).sound(SoundType.WOOD)))
@JvmField
val SACCHARINE_SIGN = this.create("saccharine_sign", CobblemonSignBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_SIGN), SACCHARINE_WOOD_TYPE))
@JvmField
@@ -221,7 +221,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val SACCHARINE_WALL_HANGING_SIGN = this.create("saccharine_wall_hanging_sign", CobblemonWallHangingSignBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_HANGING_SIGN), SACCHARINE_WOOD_TYPE))
@JvmField
val SACCHARINE_SLAB = this.create("saccharine_slab", SlabBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).strength(2.0f, 3.0f).sound(SoundType.WOOD)))
val SACCHARINE_SLAB = this.create("saccharine_slab", SlabBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sound(SoundType.WOOD)))
@JvmField
val SACCHARINE_STAIRS = this.create("saccharine_stairs", StairsBlockInvoker.`cobblemon$create`(SACCHARINE_PLANKS.defaultBlockState(), BlockBehaviour.Properties.ofFullCopy(SACCHARINE_PLANKS)))
@JvmField
@@ -284,9 +284,9 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
val BLACK_TUMBLESTONE_BLOCK = this.create("black_tumblestone_block", Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_BLACK).strength(1.0F).sound(CobblemonSounds.TUMBLESTONE_BLOCK_SOUNDS).requiresCorrectToolForDrops().instrument(NoteBlockInstrument.BASEDRUM)))
@JvmField
val TYPE_GEM_CORE = this.create("type_gem_core", TypeGemCoreBlock(BlockBehaviour.Properties.of().strength(4.0f, 10.0f).requiresCorrectToolForDrops()))
val TYPE_GEM_CORE = this.create("type_gem_core", TypeGemCoreBlock(BlockBehaviour.Properties.of().strength(4.0F, 10.0F).requiresCorrectToolForDrops()))
private val typeGemBlocks = mutableMapOf<ResourceLocation, TypeGemBlock>()
private val typeGemBlocks = mutableMapOf<ResourceLocation, Block>()
@JvmField
val TYPE_GEM_BLOCK_NORMAL = typeGemBlock("type_gem_block_normal")
@@ -538,11 +538,10 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
@JvmField
val SOUL_CAMPFIRE = create("soul_campfire", CampfireBlock(BlockBehaviour.Properties.of().sound(SoundType.WOOD).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.PODZOL).strength(2.0F).lightLevel{9}, true))
@JvmField
val RELIC_COIN_POUCH = create("relic_coin_pouch", CoinPouchBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.RELIC_COIN_POUCH_SOUNDS).pushReaction(PushReaction.DESTROY).noOcclusion(), true))
@JvmField
val RELIC_COIN_SACK = create("relic_coin_sack", CoinPouchBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.RELIC_COIN_SACK_SOUNDS).pushReaction(PushReaction.DESTROY).strength(0.4f), false))
val RELIC_COIN_SACK = create("relic_coin_sack", CoinPouchBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.RELIC_COIN_SACK_SOUNDS).pushReaction(PushReaction.DESTROY).strength(0.4F), false))
@JvmField
val GILDED_CHEST = create("gilded_chest", GildedChestBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.CHEST).noOcclusion().sound(CobblemonSounds.GILDED_CHEST_SOUNDS), GildedChestBlock.Type.RED))
@@ -662,7 +661,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
val RESTORATION_TANK = create("restoration_tank", RestorationTankBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.GLASS).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().strength(5.0F, 6.0F).noOcclusion()))
@JvmField
val HEALING_MACHINE = create("healing_machine", HealingMachineBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2f).noOcclusion().lightLevel { if (it.getValue(HealingMachineBlock.CHARGE_LEVEL) >= HealingMachineBlock.MAX_CHARGE_LEVEL) 12 else 5 }))
val HEALING_MACHINE = create("healing_machine", HealingMachineBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2F).noOcclusion().lightLevel { if (it.getValue(HealingMachineBlock.CHARGE_LEVEL) >= HealingMachineBlock.MAX_CHARGE_LEVEL) 12 else 5 }))
@JvmField
val PC = create("pc", PCBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2F).noOcclusion().lightLevel { if ((it.getValue(PCBlock.ON) as Boolean) && (it.getValue(PCBlock.PART) == PCBlock.PCPart.TOP)) 13 else 0 }))
@@ -679,6 +678,18 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
)
)
@JvmField
val MODIFICATION_STATION = create(
"modification_station",
ModificationStationBlock(
BlockBehaviour.Properties.of()
.mapColor(MapColor.STONE)
.sound(SoundType.STONE)
.strength(3.5F)
.requiresCorrectToolForDrops()
)
)
@JvmField
val LECTERN = create("lectern", LecternBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).sound(SoundType.WOOD).strength(2.5F).ignitedByLava().lightLevel { if (it.getValue(LecternBlock.EMIT_LIGHT) as Boolean) 13 else 0 }))
@@ -691,7 +702,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
// TODO after 1.7
// @JvmField
// val INCENSE_SWEET = create("incense_sweet", SweetIncenseBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.DISPLAY_CASE_SOUNDS).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.STONE).strength(0.3f)))
// val INCENSE_SWEET = create("incense_sweet", SweetIncenseBlock(BlockBehaviour.Properties.of().sound(CobblemonSounds.DISPLAY_CASE_SOUNDS).noOcclusion().pushReaction(PushReaction.BLOCK).mapColor(MapColor.STONE).strength(0.3F)))
@JvmField
val PASTURE = create("pasture", PastureBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BROWN).sound(SoundType.WOOD).strength(2F).noOcclusion().pushReaction(PushReaction.BLOCK).lightLevel { if ((it.getValue(PastureBlock.ON) as Boolean) && (it.getValue(PastureBlock.PART) == PastureBlock.PasturePart.TOP)) 13 else 0 }))
@@ -990,8 +1001,8 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
return this.create(name, block)
}
private fun typeGemBlock(name: String): TypeGemBlock {
val typeGemBlock = this.create(name, TypeGemBlock(BlockBehaviour.Properties.of().strength(3.0f, 6.0f)))
private fun typeGemBlock(name: String): Block {
val typeGemBlock = this.create(name, Block(BlockBehaviour.Properties.of().strength(3.0F, 6.0F).sound(SoundType.AMETHYST)))
val identifier = cobblemonResource(name)
typeGemBlocks[identifier] = typeGemBlock
@@ -1002,7 +1013,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
fun typeGemBlocks() = typeGemBlocks.toMap()
private fun typeGemCluster(name: String, gemBlock: Block, dropItemId: ResourceLocation): Block {
val gemClusterBlock = this.create(name, TypeGemClusterBlock(BlockBehaviour.Properties.of().strength(2.0f, 3.0f).pushReaction(PushReaction.DESTROY), gemBlock, dropItemId))
val gemClusterBlock = this.create(name, TypeGemClusterBlock(BlockBehaviour.Properties.of().strength(2.0F, 3.0F).sound(SoundType.AMETHYST_CLUSTER).pushReaction(PushReaction.DESTROY), gemBlock, dropItemId))
TypeGemClusterBlock.gemToClusterMap[gemBlock] = gemClusterBlock
@@ -99,6 +99,12 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
.networkSynchronized(ByteBufCodecs.BOOL)
.build())
@JvmField
val MODIFICATION_VARIANT: DataComponentType<ModificationVariantComponent> = create("modification_variant", DataComponentType.builder<ModificationVariantComponent>()
.persistent(ModificationVariantComponent.CODEC)
.networkSynchronized(ModificationVariantComponent.PACKET_CODEC)
.build())
fun register() {
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:pokemon_item"), POKEMON_ITEM)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:bait"), BAIT)
@@ -112,6 +118,7 @@ object CobblemonItemComponents : PlatformRegistry<Registry<DataComponentType<*>>
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:food"), FOOD)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:mob_effects"), MOB_EFFECTS)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:held_item_effect"), HELD_ITEM_EFFECT)
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.parse("cobblemon:modification_variant"), MODIFICATION_VARIANT)
}
override val registry = BuiltInRegistries.DATA_COMPONENT_TYPE
@@ -459,6 +459,8 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val TM_MACHINE = blockItem("tm_machine", CobblemonBlocks.TM_MACHINE)
@JvmField
val MODIFICATION_STATION = blockItem("modification_station", CobblemonBlocks.MODIFICATION_STATION)
@JvmField
val TM_SHELF = blockItem("tm_shelf", CobblemonBlocks.TM_SHELF)
@JvmField
val PASTURE = blockItem("pasture", CobblemonBlocks.PASTURE)
@@ -1520,41 +1522,41 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
// Type Gems
@JvmField
val NORMAL_GEM = this.create("normal_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_NORMAL, Item.Properties()))
val NORMAL_GEM = this.create("normal_gem", itemNameBlockItem("normal_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_NORMAL))
@JvmField
val FIRE_GEM = this.create("fire_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_FIRE, Item.Properties()))
val FIRE_GEM = this.create("fire_gem", itemNameBlockItem("fire_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_FIRE))
@JvmField
val WATER_GEM = this.create("water_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_WATER, Item.Properties()))
val WATER_GEM = this.create("water_gem", itemNameBlockItem("water_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_WATER))
@JvmField
val GRASS_GEM = this.create("grass_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_GRASS, Item.Properties()))
val GRASS_GEM = this.create("grass_gem", itemNameBlockItem("grass_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_GRASS))
@JvmField
val ELECTRIC_GEM = this.create("electric_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_ELECTRIC, Item.Properties()))
val ELECTRIC_GEM = this.create("electric_gem", itemNameBlockItem("electric_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_ELECTRIC))
@JvmField
val ICE_GEM = this.create("ice_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_ICE, Item.Properties()))
val ICE_GEM = this.create("ice_gem", itemNameBlockItem("ice_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_ICE))
@JvmField
val FIGHTING_GEM = this.create("fighting_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_FIGHTING, Item.Properties()))
val FIGHTING_GEM = this.create("fighting_gem", itemNameBlockItem("fighting_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_FIGHTING))
@JvmField
val POISON_GEM = this.create("poison_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_POISON, Item.Properties()))
val POISON_GEM = this.create("poison_gem", itemNameBlockItem("poison_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_POISON))
@JvmField
val GROUND_GEM = this.create("ground_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_GROUND, Item.Properties()))
val GROUND_GEM = this.create("ground_gem", itemNameBlockItem("ground_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_GROUND))
@JvmField
val FLYING_GEM = this.create("flying_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_FLYING, Item.Properties()))
val FLYING_GEM = this.create("flying_gem", itemNameBlockItem("flying_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_FLYING))
@JvmField
val PSYCHIC_GEM = this.create("psychic_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_PSYCHIC, Item.Properties()))
val PSYCHIC_GEM = this.create("psychic_gem", itemNameBlockItem("psychic_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_PSYCHIC))
@JvmField
val BUG_GEM = this.create("bug_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_BUG, Item.Properties()))
val BUG_GEM = this.create("bug_gem", itemNameBlockItem("bug_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_BUG))
@JvmField
val ROCK_GEM = this.create("rock_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_ROCK, Item.Properties()))
val ROCK_GEM = this.create("rock_gem", itemNameBlockItem("rock_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_ROCK))
@JvmField
val GHOST_GEM = this.create("ghost_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_GHOST, Item.Properties()))
val GHOST_GEM = this.create("ghost_gem", itemNameBlockItem("ghost_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_GHOST))
@JvmField
val DRAGON_GEM = this.create("dragon_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_DRAGON, Item.Properties()))
val DRAGON_GEM = this.create("dragon_gem", itemNameBlockItem("dragon_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_DRAGON))
@JvmField
val DARK_GEM = this.create("dark_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_DARK, Item.Properties()))
val DARK_GEM = this.create("dark_gem", itemNameBlockItem("dark_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_DARK))
@JvmField
val STEEL_GEM = this.create("steel_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_STEEL, Item.Properties()))
val STEEL_GEM = this.create("steel_gem", itemNameBlockItem("steel_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_STEEL))
@JvmField
val FAIRY_GEM = this.create("fairy_gem", TypeGemItem(CobblemonBlocks.TYPE_GEM_CLUSTER_FAIRY, Item.Properties()))
val FAIRY_GEM = this.create("fairy_gem", itemNameBlockItem("fairy_gem", CobblemonBlocks.TYPE_GEM_CLUSTER_FAIRY))
//@JvmField
//val BINDING_SOIL = blockItem("binding_soil", CobblemonBlocks.BINDING_SOIL)
@@ -10,6 +10,7 @@ package com.cobblemon.mod.common
import com.cobblemon.mod.common.block.campfirepot.CookingPotMenu
import com.cobblemon.mod.common.block.modificationstation.ModificationStationMenu
import com.cobblemon.mod.common.block.tmmachine.TMMachineMenu
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.core.Registry
@@ -22,6 +23,7 @@ object CobblemonMenuType : PlatformRegistry<Registry<MenuType<*>>, ResourceKey<R
val COOKING_POT = MenuType.register("cooking_pot_menu", ::CookingPotMenu)
val TM_MACHINE = MenuType.register("tm_machine_menu", ::TMMachineMenu)
val MODIFICATION_STATION = MenuType.register("modification_station_menu", ::ModificationStationMenu)
override val registry: Registry<MenuType<*>>
get() = BuiltInRegistries.MENU
@@ -0,0 +1,77 @@
/*
* 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
import com.cobblemon.mod.common.modification_station.DisplayCaseVariantBlocks
import com.cobblemon.mod.common.modification_station.DomeFossilVariantBlocks
import com.cobblemon.mod.common.modification_station.ModificationVariantBlockRegistrar
import com.cobblemon.mod.common.modification_station.PCVariantBlocks
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.block.Block
@Suppress("MemberVisibilityCanBePrivate")
object CobblemonModificationBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<Block>>, Block>() {
override val registry: Registry<Block> = BuiltInRegistries.BLOCK
override val resourceKey: ResourceKey<Registry<Block>> = Registries.BLOCK
private val variantRegistrars: List<ModificationVariantBlockRegistrar> = listOf(
DisplayCaseVariantBlocks,
DomeFossilVariantBlocks,
PCVariantBlocks
)
override fun register(consumer: (ResourceLocation, Block) -> Unit) {
variantRegistrars.forEach { registrar -> registrar.registerAll(consumer) }
}
@JvmStatic
fun allVariantEntries(): Map<ResourceLocation, Block> = linkedMapOf<ResourceLocation, Block>().also { result ->
variantRegistrars.forEach { registrar -> result.putAll(registrar.allEntries()) }
}
@JvmStatic
fun variantIdentifier(block: Block): ResourceLocation? {
variantRegistrars.forEach { registrar ->
val identifier = registrar.variantIdentifier(block)
if (identifier != null) {
return identifier
}
}
return null
}
@JvmStatic
fun isVariant(block: Block): Boolean = variantIdentifier(block) != null
@JvmStatic
fun displayCaseVariantBlocks(): Collection<Block> = DisplayCaseVariantBlocks.allBlocks()
@JvmStatic
fun displayCaseTintedVariantBlocks(): Collection<Block> = DisplayCaseVariantBlocks.tintedVariantBlocks()
@JvmStatic
fun displayCaseNonTintedVariantBlocks(): Collection<Block> = DisplayCaseVariantBlocks.nonTintedVariantBlocks()
@JvmStatic
fun displayCaseVariantEntries(): Map<ResourceLocation, Block> = DisplayCaseVariantBlocks.allEntries()
@JvmStatic
fun displayCaseVariantIdentifier(block: Block): ResourceLocation? = DisplayCaseVariantBlocks.variantIdentifier(block)
@JvmStatic
fun domeFossilVariantBlocks(): Collection<Block> = DomeFossilVariantBlocks.allBlocks()
@JvmStatic
fun pcVariantBlocks(): Collection<Block> = PCVariantBlocks.allBlocks()
}
@@ -0,0 +1,38 @@
/*
* 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
import com.cobblemon.mod.common.platform.PlatformRegistry
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.Item
@Suppress("MemberVisibilityCanBePrivate")
object CobblemonModificationItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<Item>>, Item>() {
override val registry: Registry<Item> = BuiltInRegistries.ITEM
override val resourceKey: ResourceKey<Registry<Item>> = Registries.ITEM
private val variantItemsById = linkedMapOf<ResourceLocation, BlockItem>()
init {
CobblemonModificationBlocks.allVariantEntries().forEach { (identifier, block) ->
variantItemsById[identifier] = create(identifier, BlockItem(block, Item.Properties()))
}
}
@JvmStatic
fun allVariantItems(): Collection<Item> = variantItemsById.values
@JvmStatic
fun displayCaseVariantItems(): Collection<Item> = variantItemsById.values
}
@@ -416,6 +416,7 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(DexEntrySyncPacket.ID, DexEntrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SpawnBaitRegistrySyncPacket.ID, SpawnBaitRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(SeasoningRegistrySyncPacket.ID, SeasoningRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(ModificationVariantRegistrySyncPacket.ID, ModificationVariantRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(CallbackRegistrySyncPacket.ID, CallbackRegistrySyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(CosmeticItemAssignmentSyncPacket.ID, CosmeticItemAssignmentSyncPacket::decode, DataRegistrySyncPacketHandler()))
list.add(PacketRegisterInfo(BehaviourSyncPacket.ID, BehaviourSyncPacket::decode, DataRegistrySyncPacketHandler()))
@@ -626,4 +627,4 @@ object CobblemonNetwork {
fun sendPacketToPlayer(player: ServerPlayer, packet: NetworkPacket<*>) {
Cobblemon.implementation.networkManager.sendPacketToPlayer(player, packet)
}
}
}
@@ -0,0 +1,80 @@
/*
* 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.api.modification
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
data class ModificationVariant(
@Transient
var identifier: ResourceLocation = ResourceLocation.withDefaultNamespace("missing"),
val parent: ResourceLocation,
val model: String,
val id: Int = 0,
val shape: List<List<Double>>? = emptyList(),
val size: ModificationVariantSize? = null
) {
fun resolvedModelIdentifier(): ResourceLocation {
return ResourceLocation.tryParse(model) ?: ResourceLocation.fromNamespaceAndPath(parent.namespace, model)
}
fun resolvedBlockModelIdentifier(): ResourceLocation {
val resolved = resolvedModelIdentifier()
return if (resolved.path.startsWith("block/")) {
resolved
} else {
ResourceLocation.fromNamespaceAndPath(resolved.namespace, "block/${resolved.path}")
}
}
fun createShape(): VoxelShape? {
if (!shape.isNullOrEmpty()) {
var combined = Shapes.empty()
for (entry in shape) {
if (entry.size != 6) {
continue
}
combined = Shapes.or(
combined,
Shapes.box(
entry[0] / 16.0,
entry[1] / 16.0,
entry[2] / 16.0,
entry[3] / 16.0,
entry[4] / 16.0,
entry[5] / 16.0
)
)
}
return if (combined.isEmpty) null else combined
}
val sized = size ?: return null
return Shapes.box(
sized.offsetX / 16.0,
sized.offsetY / 16.0,
sized.offsetZ / 16.0,
(sized.offsetX + sized.width) / 16.0,
(sized.offsetY + sized.height) / 16.0,
(sized.offsetZ + sized.depth) / 16.0
)
}
}
data class ModificationVariantSize(
val width: Double = 16.0,
val height: Double = 16.0,
val depth: Double = 16.0,
val offsetX: Double = 0.0,
val offsetY: Double = 0.0,
val offsetZ: Double = 0.0
)
@@ -0,0 +1,93 @@
/*
* 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.api.modification
import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.data.JsonDataRegistry
import com.cobblemon.mod.common.api.reactive.SimpleObservable
import com.cobblemon.mod.common.net.messages.client.data.ModificationVariantRegistrySyncPacket
import com.cobblemon.mod.common.util.adapters.IdentifierAdapter
import com.cobblemon.mod.common.util.cobblemonResource
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerPlayer
import net.minecraft.server.packs.PackType
object ModificationVariants : JsonDataRegistry<ModificationVariant> {
override val id: ResourceLocation = cobblemonResource("modification_variants")
override val type: PackType = PackType.SERVER_DATA
override val observable = SimpleObservable<ModificationVariants>()
override val typeToken: TypeToken<ModificationVariant> = TypeToken.get(ModificationVariant::class.java)
override val resourcePath = "modification_variants"
override val gson: Gson = GsonBuilder()
.registerTypeAdapter(ResourceLocation::class.java, IdentifierAdapter)
.setPrettyPrinting()
.disableHtmlEscaping()
.create()
private val variantsByIdentifier = linkedMapOf<ResourceLocation, ModificationVariant>()
private val variantsByParent = hashMapOf<ResourceLocation, List<ModificationVariant>>()
override fun reload(data: Map<ResourceLocation, ModificationVariant>) {
val variants = data.mapNotNull { (identifier, variant) ->
val parentExistsAsBlock = BuiltInRegistries.BLOCK.containsKey(variant.parent)
val parentExistsAsItem = BuiltInRegistries.ITEM.containsKey(variant.parent)
if (!parentExistsAsBlock && !parentExistsAsItem) {
Cobblemon.LOGGER.warn(
"Skipping modification variant {} because parent id {} does not exist as a block or item",
identifier,
variant.parent
)
return@mapNotNull null
}
if (!BuiltInRegistries.BLOCK.containsKey(identifier)) {
Cobblemon.LOGGER.warn("Skipping modification variant {} because variant block {} does not exist", identifier, identifier)
return@mapNotNull null
}
variant.identifier = identifier
variant
}
reloadEntries(variants)
}
fun reloadEntries(entries: Collection<ModificationVariant>) {
val sorted = entries
.sortedWith(compareBy<ModificationVariant> { it.id }.thenBy { it.identifier.toString() })
variantsByIdentifier.clear()
variantsByParent.clear()
sorted.forEach { variant ->
variantsByIdentifier[variant.identifier] = variant
}
variantsByParent.putAll(sorted.groupBy { it.parent })
Cobblemon.LOGGER.info("Loaded {} modification variants", variantsByIdentifier.size)
observable.emit(this)
}
override fun sync(player: ServerPlayer) {
ModificationVariantRegistrySyncPacket(all()).sendToPlayer(player)
}
@JvmStatic
fun all(): List<ModificationVariant> = variantsByIdentifier.values.toList()
@JvmStatic
fun forParent(parent: ResourceLocation): List<ModificationVariant> = variantsByParent[parent] ?: emptyList()
@JvmStatic
fun getByIdentifier(identifier: ResourceLocation): ModificationVariant? = variantsByIdentifier[identifier]
}
@@ -183,6 +183,7 @@ class FormDexRecord {
fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeCollection(genders) { _, it -> buffer.writeEnumConstant(it) }
buffer.writeCollection(seenShinyStates) { _, it -> buffer.writeString(it) }
buffer.writeInt(highestLevel)
buffer.writeEnumConstant(knowledge)
}
@@ -191,6 +192,7 @@ class FormDexRecord {
seenShinyStates.clear()
genders.addAll(buffer.readCollection(Sets::newHashSetWithExpectedSize) { buffer.readEnumConstant(Gender::class.java) })
seenShinyStates.addAll(buffer.readCollection(Sets::newHashSetWithExpectedSize) { buffer.readString() })
highestLevel = buffer.readInt()
knowledge = buffer.readEnumConstant(PokedexEntryProgress::class.java)
}
}
@@ -100,32 +100,31 @@ class SearchFilter(val pokedexManager: AbstractPokedexManager, val searchString:
pokedex: AbstractPokedexManager,
learnedTMs: Set<ResourceLocation>
): Boolean {
val evolutionMoveLevels = buildEvolutionMoveLevelIndex(form)
val highestEvolutionLevel = collectEvolutionForms(form).maxOfOrNull { evolutionForm ->
val speciesRecord = pokedex.getSpeciesRecord(evolutionForm.species.resourceIdentifier)
speciesRecord?.getFormRecord(evolutionForm.name)?.highestLevel ?: speciesRecord?.highestLevel ?: -1
} ?: -1
fun matches(move: MoveTemplate): Boolean {
return move.displayName.string.lowercase().contains(search)
}
fun isLevelUpDiscovered(move: MoveTemplate, level: Int): Boolean {
fun isLevelUpDiscovered(level: Int): Boolean {
if (highestLevel >= level) return true
for ((evolutionSpeciesId, moveLevels) in evolutionMoveLevels) {
val evolutionLevel = moveLevels[move.name] ?: continue
val evolutionHighest = pokedex.getSpeciesRecord(evolutionSpeciesId)?.highestLevel ?: -1
if (evolutionHighest >= evolutionLevel) return true
}
return false
return highestEvolutionLevel >= level
}
form.moves.levelUpMoves.forEach { (level, moves) ->
for (move in moves) {
if (matches(move) && isLevelUpDiscovered(move, level)) return true
if (matches(move) && isLevelUpDiscovered(level)) return true
}
}
form.moves.tmMoves.forEach { move ->
val tmId = TechnicalMachines.moveToTM[move]?.id
val discovered = tmId == null || tmId in learnedTMs
val discovered = tmId == null
|| tmId in learnedTMs
|| TechnicalMachines.tmMap[tmId]?.isPassivelyObtained() == true
if (discovered && matches(move)) return true
}
@@ -147,6 +146,7 @@ class SearchFilter(val pokedexManager: AbstractPokedexManager, val searchString:
return false
}
// todo remove this since it isn't needed anymore
private fun buildEvolutionMoveLevelIndex(form: FormData): Map<ResourceLocation, Map<String, Int>> {
val evolutionForms = collectEvolutionForms(form)
val levelsBySpecies = mutableMapOf<ResourceLocation, MutableMap<String, Int>>()
@@ -8,7 +8,6 @@
package com.cobblemon.mod.common.api.pokedex.filter
import com.cobblemon.mod.common.api.moves.MoveTemplate
import com.cobblemon.mod.common.api.pokedex.AbstractPokedexManager
import com.cobblemon.mod.common.api.pokedex.PokedexEntryProgress
import com.cobblemon.mod.common.api.pokedex.entry.PokedexEntry
@@ -65,23 +64,22 @@ class SecondaryPokedexFilter(
form: FormData,
highestLevel: Int
): Boolean {
val evolutionMoveLevels = buildEvolutionMoveLevelIndex(form)
val learnedTMs = CobblemonClient.clientTMMoveData.learnedTMs
val highestEvolutionLevel = collectEvolutionForms(form).maxOfOrNull { evolutionForm ->
val speciesRecord = pokedexManager.getSpeciesRecord(evolutionForm.species.resourceIdentifier)
speciesRecord?.getFormRecord(evolutionForm.name)?.highestLevel ?: speciesRecord?.highestLevel ?: -1
} ?: -1
fun isLevelUpDiscovered(move: MoveTemplate, level: Int): Boolean {
fun isLevelUpDiscovered(level: Int): Boolean {
if (highestLevel >= level) return true
for ((evolutionSpeciesId, moveLevels) in evolutionMoveLevels) {
val evolutionLevel = moveLevels[move.name] ?: continue
val evolutionHighest = pokedexManager.getSpeciesRecord(evolutionSpeciesId)?.highestLevel ?: -1
if (evolutionHighest >= evolutionLevel) return true
}
return false
return highestEvolutionLevel >= level
}
form.moves.levelUpMoves.forEach { (level, moves) ->
for (move in moves) {
if (TechnicalMachines.moveToTM[move] != null && !isLevelUpDiscovered(move, level)) {
val tmId = TechnicalMachines.moveToTM[move]?.id ?: continue
val tmUnlocked = tmId in learnedTMs || TechnicalMachines.tmMap[tmId]?.isPassivelyObtained() == true
if (!tmUnlocked && !isLevelUpDiscovered(level)) {
return true
}
}
@@ -90,24 +88,6 @@ class SecondaryPokedexFilter(
return false
}
private fun buildEvolutionMoveLevelIndex(form: FormData): Map<ResourceLocation, Map<String, Int>> {
val evolutionForms = collectEvolutionForms(form)
val levelsBySpecies = mutableMapOf<ResourceLocation, MutableMap<String, Int>>()
for (evolutionForm in evolutionForms) {
val speciesId = evolutionForm.species.resourceIdentifier
val moveLevels = levelsBySpecies.getOrPut(speciesId) { mutableMapOf() }
buildMoveLevelIndex(evolutionForm).forEach { (moveName, level) ->
val current = moveLevels[moveName]
if (current == null || level < current) {
moveLevels[moveName] = level
}
}
}
return levelsBySpecies
}
private fun buildMoveLevelIndex(form: FormData): Map<String, Int> {
val levels = mutableMapOf<String, Int>()
form.moves.levelUpMoves.forEach { (level, moves) ->
@@ -46,8 +46,18 @@ class TMMoveManager(
}
fun getLearnableTMsFromPokemon(pokemon: Pokemon): Collection<ResourceLocation> {
val learnableMoves = pokemon.allAccessibleMoves.toMutableSet()
learnableMoves.addAll(pokemon.moveSet.map { it.template })
var preEvolution = pokemon.preEvolution
while (preEvolution != null) {
learnableMoves.addAll(preEvolution.form.moves.getLevelUpMovesUpTo(pokemon.level))
learnableMoves.addAll(preEvolution.form.moves.evolutionMoves)
preEvolution = preEvolution.form.preEvolution
}
return TechnicalMachines.tmMap.values
.filter { tm -> tm.moveName in pokemon.allAccessibleMoves }
.filter { tm -> tm.moveName in learnableMoves }
.map(TechnicalMachine::id)
}
@@ -77,9 +87,7 @@ class TMMoveManager(
var processed = 0
while (processed < batchSize && iterator.hasNext()) {
val pokemon = iterator.next()
for (move in pokemon.allAccessibleMoves) {
TechnicalMachines.moveToTM[move]?.id?.let { tmIds.add(it) }
}
tmIds.addAll(getLearnableTMsFromPokemon(pokemon))
processed++
}
@@ -8,20 +8,29 @@
package com.cobblemon.mod.common.block
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.CobblemonModificationBlocks
import com.cobblemon.mod.common.api.modification.ModificationVariants
import com.cobblemon.mod.common.block.entity.DisplayCaseBlockEntity
import com.cobblemon.mod.common.item.PokeBallItem
import com.cobblemon.mod.common.item.components.ModificationVariantComponent
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.Containers
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.BaseEntityBlock
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
@@ -32,6 +41,11 @@ import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.DirectionProperty
import net.minecraft.world.level.pathfinder.PathComputationType
import net.minecraft.world.phys.BlockHitResult
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
import net.minecraft.world.level.storage.loot.LootParams
import net.minecraft.world.level.storage.loot.parameters.LootContextParams
@Suppress("OVERRIDE_DEPRECATION")
class DisplayCaseBlock(settings: Properties) : BaseEntityBlock(settings) {
@@ -80,6 +94,12 @@ class DisplayCaseBlock(settings: Properties) : BaseEntityBlock(settings) {
else super.updateShape(state, direction, neighborState, world, pos, neighborPos)
}
override fun setPlacedBy(world: Level, pos: BlockPos, state: BlockState, placer: LivingEntity?, stack: ItemStack) {
super.setPlacedBy(world, pos, state, placer, stack)
val entity = world.getBlockEntity(pos) as? DisplayCaseBlockEntity ?: return
entity.applyVariantFromStack(stack)
}
override fun useWithoutItem(
state: BlockState,
world: Level,
@@ -95,6 +115,28 @@ class DisplayCaseBlock(settings: Properties) : BaseEntityBlock(settings) {
return result
}
override fun getCloneItemStack(level: LevelReader, pos: BlockPos, state: BlockState): ItemStack {
val stack = super.getCloneItemStack(level, pos, state)
if (state.block != CobblemonBlocks.DISPLAY_CASE) {
return stack
}
val variantId = (level.getBlockEntity(pos) as? DisplayCaseBlockEntity)?.variantIdentifier ?: return stack
stack.set(CobblemonItemComponents.MODIFICATION_VARIANT, ModificationVariantComponent(variantId))
return stack
}
override fun getDrops(state: BlockState, params: LootParams.Builder): List<ItemStack> {
val drop = ItemStack(this)
if (state.block == CobblemonBlocks.DISPLAY_CASE) {
val variantId = (params.getOptionalParameter(LootContextParams.BLOCK_ENTITY) as? DisplayCaseBlockEntity)?.variantIdentifier
if (variantId != null) {
drop.set(CobblemonItemComponents.MODIFICATION_VARIANT, ModificationVariantComponent(variantId))
}
}
return listOf(drop)
}
override fun onRemove(
state: BlockState,
world: Level,
@@ -124,6 +166,24 @@ class DisplayCaseBlock(settings: Properties) : BaseEntityBlock(settings) {
override fun hasAnalogOutputSignal(state: BlockState): Boolean = true
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return getVariantShape(state, level, pos) ?: BASE_SHAPE
}
override fun getCollisionShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return getShape(state, level, pos, context)
}
private fun getVariantShape(state: BlockState, level: BlockGetter, pos: BlockPos): VoxelShape? {
val blockEntity = level.getBlockEntity(pos) as? DisplayCaseBlockEntity ?: return null
val variantIdentifier = blockEntity.variantIdentifier
?: CobblemonModificationBlocks.displayCaseVariantIdentifier(state.block)
?: return null
val variant = ModificationVariants.getByIdentifier(variantIdentifier) ?: return null
val shape = variant.createShape() ?: return null
return rotateShape(Direction.NORTH, state.getValue(FACING), shape)
}
override fun codec(): MapCodec<out BaseEntityBlock> {
return CODEC
}
@@ -133,6 +193,7 @@ class DisplayCaseBlock(settings: Properties) : BaseEntityBlock(settings) {
companion object {
val CODEC = simpleCodec(::DisplayCaseBlock)
val ITEM_DIRECTION = DirectionProperty.create("item_facing")
val BASE_SHAPE: VoxelShape = Shapes.block()
}
}
}
@@ -0,0 +1,113 @@
/*
* 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.block
import com.cobblemon.mod.common.block.modificationstation.ModificationStationMenu
import com.cobblemon.mod.common.util.rotateShape
import com.mojang.serialization.MapCodec
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.network.chat.Component
import net.minecraft.stats.Stats
import net.minecraft.world.InteractionResult
import net.minecraft.world.MenuProvider
import net.minecraft.world.SimpleMenuProvider
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.ContainerLevelAccess
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.HorizontalDirectionalBlock
import net.minecraft.world.level.block.Mirror
import net.minecraft.world.level.block.RenderShape
import net.minecraft.world.level.block.Rotation
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.DirectionProperty
import net.minecraft.world.level.pathfinder.PathComputationType
import net.minecraft.world.phys.BlockHitResult
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class ModificationStationBlock(properties: Properties) : Block(properties) {
override fun codec(): MapCodec<ModificationStationBlock> = CODEC
init {
registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH))
}
override fun getStateForPlacement(context: BlockPlaceContext): BlockState {
return defaultBlockState().setValue(FACING, context.horizontalDirection.opposite)
}
override fun useWithoutItem(state: BlockState, level: Level, pos: BlockPos, player: Player, hit: BlockHitResult): InteractionResult {
if (level.isClientSide) {
return InteractionResult.SUCCESS
}
player.openMenu(state.getMenuProvider(level, pos))
player.awardStat(Stats.INTERACT_WITH_STONECUTTER)
return InteractionResult.CONSUME
}
override fun getMenuProvider(state: BlockState, level: Level, pos: BlockPos): MenuProvider {
return SimpleMenuProvider(
{ syncId, inventory, _ -> ModificationStationMenu(syncId, inventory, ContainerLevelAccess.create(level, pos)) },
CONTAINER_TITLE
)
}
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return SHAPES_BY_FACING[state.getValue(FACING)] ?: SHAPE
}
override fun getCollisionShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape {
return getShape(state, level, pos, context)
}
override fun useShapeForLightOcclusion(state: BlockState): Boolean = true
override fun getRenderShape(state: BlockState): RenderShape = RenderShape.MODEL
override fun rotate(state: BlockState, rotation: Rotation): BlockState {
return state.setValue(FACING, rotation.rotate(state.getValue(FACING)))
}
override fun mirror(state: BlockState, mirror: Mirror): BlockState {
return state.rotate(mirror.getRotation(state.getValue(FACING)))
}
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING)
}
override fun isPathfindable(state: BlockState, type: PathComputationType): Boolean = false
companion object {
val CODEC: MapCodec<ModificationStationBlock> = simpleCodec(::ModificationStationBlock)
val CONTAINER_TITLE: Component = Component.translatable("container.cobblemon.modification_station")
val FACING: DirectionProperty = HorizontalDirectionalBlock.FACING
val SHAPE: VoxelShape = Shapes.or(
box(3.0, 0.0, 4.0, 13.0, 17.0, 13.0),
box(0.0, 8.0, 4.0, 3.0, 13.0, 13.0),
box(2.0, 10.5, 0.5, 16.0, 14.5, 13.5),
box(3.0, 3.0, 4.0, 4.0, 8.0, 6.0),
box(12.0, 3.0, 4.0, 13.0, 8.0, 6.0),
box(11.5, 13.5, 0.5, 15.5, 14.5, 4.5),
box(1.0, 13.0, 9.5, 2.0, 17.0, 12.5)
)
val SHAPES_BY_FACING: Map<Direction, VoxelShape> = mapOf(
Direction.NORTH to SHAPE,
Direction.EAST to rotateShape(Direction.NORTH, Direction.EAST, SHAPE),
Direction.SOUTH to rotateShape(Direction.NORTH, Direction.SOUTH, SHAPE),
Direction.WEST to rotateShape(Direction.NORTH, Direction.WEST, SHAPE)
)
}
}
@@ -50,7 +50,7 @@ import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
class PCBlock(properties: Properties): BaseEntityBlock(properties), SimpleWaterloggedBlock {
open class PCBlock(properties: Properties): BaseEntityBlock(properties), SimpleWaterloggedBlock {
companion object {
val CODEC = simpleCodec(::PCBlock)
val PART = EnumProperty.create("part", PCPart::class.java)
@@ -163,7 +163,7 @@ class PCBlock(properties: Properties): BaseEntityBlock(properties), SimpleWaterl
}
}
fun getPositionOfOtherPart(state: BlockState, pos: BlockPos): BlockPos {
open fun getPositionOfOtherPart(state: BlockState, pos: BlockPos): BlockPos {
return if (state.getValue(PART) == PCPart.BOTTOM) {
pos.above()
} else {
@@ -171,7 +171,7 @@ class PCBlock(properties: Properties): BaseEntityBlock(properties), SimpleWaterl
}
}
fun getBasePosition(state: BlockState, pos: BlockPos): BlockPos {
open fun getBasePosition(state: BlockState, pos: BlockPos): BlockPos {
return if (isBase(state)) {
pos
} else {
@@ -331,4 +331,4 @@ class PCBlock(properties: Properties): BaseEntityBlock(properties), SimpleWaterl
return state
}
}
}
@@ -1,23 +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.block
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.CobblemonItems
import net.minecraft.world.item.Item
import net.minecraft.world.level.block.Block
class TypeGemBlock(
settings: Properties
) : Block(settings) {
companion object {
}
}
@@ -8,29 +8,23 @@
package com.cobblemon.mod.common.block
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.api.tags.CobblemonBlockTags
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.core.component.DataComponents
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.resources.ResourceLocation
import net.minecraft.server.level.ServerLevel
import net.minecraft.util.RandomSource
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.component.BlockItemStateProperties
import net.minecraft.world.item.component.CustomModelData
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.item.enchantment.Enchantments
import net.minecraft.world.item.enchantment.ItemEnchantments
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.block.AirBlock
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.DirectionalBlock
@@ -42,18 +36,14 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty
import net.minecraft.world.level.block.state.properties.DirectionProperty
import net.minecraft.world.level.block.state.properties.IntegerProperty
import net.minecraft.world.level.material.PushReaction
import net.minecraft.world.level.storage.loot.LootContext
import net.minecraft.world.level.storage.loot.LootParams
import net.minecraft.world.level.storage.loot.parameters.LootContextParams
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
import javax.swing.text.html.HTML.Attribute.SHAPES
import kotlin.io.path.Path
class TypeGemClusterBlock(
settings: Properties,
val nextStage: Block,
val dropItemId: ResourceLocation
settings: Properties,
val nextStage: Block,
val dropItemId: ResourceLocation
) : DirectionalBlock(settings.pushReaction(PushReaction.DESTROY)) {
companion object {
@@ -82,10 +72,10 @@ class TypeGemClusterBlock(
init {
registerDefaultState(stateDefinition.any()
.setValue(FACING, Direction.UP)
.setValue(SHOULD_GROW, true)
.setValue(STAGE, 0)
.setValue(STUNTED, false)
.setValue(FACING, Direction.UP)
.setValue(SHOULD_GROW, true)
.setValue(STAGE, 0)
.setValue(STUNTED, false)
)
}
@@ -97,10 +87,10 @@ class TypeGemClusterBlock(
val shouldGrow = blockBelow is TypeGemCoreBlock
return defaultBlockState()
.setValue(FACING, facing)
.setValue(SHOULD_GROW, shouldGrow)
.setValue(STAGE, 0)
.setValue(STUNTED, false)
.setValue(FACING, facing)
.setValue(SHOULD_GROW, shouldGrow)
.setValue(STAGE, 0)
.setValue(STUNTED, false)
}
override fun isRandomlyTicking(state: BlockState): Boolean = state.getValue(SHOULD_GROW)
@@ -116,7 +106,7 @@ class TypeGemClusterBlock(
if (currentStage < 3) {
// Progress through stages regardless of STUNTED
level.setBlock(pos, state.setValue(STAGE, currentStage + 1), Block.UPDATE_ALL)
level.setBlock(pos, state.setValue(STAGE, currentStage + 1), UPDATE_ALL)
return
}
@@ -125,50 +115,35 @@ class TypeGemClusterBlock(
val facing = state.getValue(FACING)
if (isStunted) {
// println("[TypeGemClusterBlock] Cluster at $pos is STUNTED at STAGE_3. Finalizing growth.")
level.setBlock(pos, state.setValue(SHOULD_GROW, false), Block.UPDATE_ALL)
level.setBlock(pos, state.setValue(SHOULD_GROW, false), UPDATE_ALL)
return
}
// Log type of cluster based on nextStage
val clusterType = level.registryAccess()
.registryOrThrow(BuiltInRegistries.BLOCK.key())
.getKey(nextStage)
.toString()
// println("[TypeGemClusterBlock] Attempting to grow into TypeGemBlock at $pos")
// println("[TypeGemClusterBlock] Cluster type: $clusterType")
// Check neighboring gem blocks
val hasConflict = Direction.entries
.filter { it != facing.opposite }
.any { dir ->
val neighborPos = pos.relative(dir)
val neighborState = level.getBlockState(neighborPos)
val neighborBlockId = BuiltInRegistries.BLOCK.getKey(neighborState.block)
// println("[TypeGemClusterBlock] Neighbor at $dir -> $neighborBlockId")
isGem(neighborState)
}
if (hasConflict) {
// println("[TypeGemClusterBlock] Found nearby TypeGemBlock(s). Stunting cluster at $pos.")
level.setBlock(
pos,
state.setValue(STUNTED, true).setValue(SHOULD_GROW, false),
Block.UPDATE_ALL
pos,
state.setValue(STUNTED, true).setValue(SHOULD_GROW, false),
UPDATE_ALL
)
} else {
// println("[TypeGemClusterBlock] No conflicts. Converting cluster to TypeGemBlock.")
var nextState = nextStage.defaultBlockState()
if (nextState.hasProperty(FACING)) {
nextState = nextState.setValue(FACING, facing)
}
level.setBlock(pos, nextState, Block.UPDATE_ALL)
level.setBlock(pos, nextState, UPDATE_ALL)
attachDecorativeClusters(level, pos, random)
}
}
private fun isGem(state: BlockState): Boolean {
return state.`is`(CobblemonBlockTags.TYPE_GEM_BLOCKS)
}
@@ -199,7 +174,7 @@ class TypeGemClusterBlock(
.setValue(SHOULD_GROW, false) // so we can reduce lag... hopefully
.setValue(STUNTED, false)
level.setBlock(clusterPos, clusterState, Block.UPDATE_ALL)
level.setBlock(clusterPos, clusterState, UPDATE_ALL)
}
}
@@ -236,20 +211,20 @@ class TypeGemClusterBlock(
val facing = state.getValue(FACING)
val (min, max) = when (stage) {
0 -> 5.0 to 11.0
1 -> 4.0 to 12.0
2 -> 3.0 to 13.0
3 -> 2.0 to 14.0
0 -> 6.0 to 5.0 // type_gem_bud_small_* (4px wide, 5px protrusion)
1 -> 5.0 to 6.0 // type_gem_bud_medium_* (6px wide, 6px protrusion)
2 -> 4.0 to 7.0 // type_gem_bud_large_* (8px wide, 7px protrusion)
3 -> 3.0 to 8.0 // Fully grown cluster (10px wide, 8px protrusion)
else -> return Shapes.empty()
}
return when (facing) {
Direction.UP -> Shapes.box(min / 16, 0.0, min / 16, max / 16, (min + 1) / 16, max / 16)
Direction.DOWN -> Shapes.box(min / 16, (16 - (min + 1)) / 16, min / 16, max / 16, 1.0, max / 16)
Direction.NORTH -> Shapes.box(min / 16, min / 16, (16 - (min + 1)) / 16, max / 16, max / 16, 1.0)
Direction.SOUTH -> Shapes.box((16 - max) / 16, min / 16, 0.0, (16 - min) / 16, max / 16, (min + 1) / 16)
Direction.WEST -> Shapes.box((16 - (min + 1)) / 16, min / 16, min / 16, 1.0, max / 16, max / 16)
Direction.EAST -> Shapes.box(0.0, min / 16, min / 16, (min + 1) / 16, max / 16, max / 16)
Direction.UP -> Shapes.box(min / 16.0, 0.0, min / 16.0, (16 - min) / 16.0, max / 16.0, (16 - min) / 16.0)
Direction.DOWN -> Shapes.box(min / 16.0, (16 - max) / 16.0, min / 16.0, (16 - min) / 16.0, 1.0, (16 - min) / 16.0)
Direction.NORTH -> Shapes.box(min / 16.0, min / 16.0, (16 - max) / 16.0, (16 - min) / 16.0, (16 - min) / 16.0, 1.0)
Direction.SOUTH -> Shapes.box(min / 16.0, min / 16.0, 0.0, (16 - min) / 16.0, (16 - min) / 16.0, max / 16.0)
Direction.WEST -> Shapes.box((16 - max) / 16.0, min / 16.0, min / 16.0, 1.0, (16 - min) / 16.0, (16 - min) / 16.0)
Direction.EAST -> Shapes.box(0.0, min / 16.0, min / 16.0, max / 16.0, (16 - min) / 16.0, (16 - min) / 16.0)
}
}
@@ -272,9 +247,16 @@ class TypeGemClusterBlock(
override fun canSurvive(state: BlockState, level: LevelReader, pos: BlockPos): Boolean {
val supportPos = pos.relative(state.getValue(FACING).opposite)
val supportBlock = level.getBlockState(supportPos).block
return supportBlock !is AirBlock
return CobblemonBlocks.typeGemBlocks().containsValue(supportBlock) || (supportBlock == CobblemonBlocks.TYPE_GEM_CORE)
}
override fun propagatesSkylightDown(state: BlockState, level: net.minecraft.world.level.BlockGetter, pos: BlockPos): Boolean = true
override fun getShadeBrightness(state: BlockState, level: net.minecraft.world.level.BlockGetter, pos: BlockPos): Float = 1.0F
override fun useShapeForLightOcclusion(state: BlockState): Boolean = false
override fun codec(): MapCodec<out DirectionalBlock> = CODEC
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
@@ -9,6 +9,8 @@
package com.cobblemon.mod.common.block.entity
import com.cobblemon.mod.common.CobblemonBlockEntities
import com.cobblemon.mod.common.CobblemonItemComponents
import com.cobblemon.mod.common.CobblemonModificationBlocks
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.util.giveOrDropItemStack
import net.minecraft.core.BlockPos
@@ -31,11 +33,14 @@ import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.resources.ResourceLocation
class DisplayCaseBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(CobblemonBlockEntities.DISPLAY_CASE, pos, state),
WorldlyContainer {
val inv: NonNullList<ItemStack> = NonNullList.withSize(1, ItemStack.EMPTY)
var variantIdentifier: ResourceLocation? = null
private set
/**
* Updates the [ItemStack] stored in this entity
@@ -98,15 +103,41 @@ class DisplayCaseBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cob
onItemUpdated(level, oldState, level.getBlockState(blockPos))
}
fun applyVariantFromStack(stack: ItemStack) {
val stackVariant = stack.get(CobblemonItemComponents.MODIFICATION_VARIANT)?.variant
val blockVariant = CobblemonModificationBlocks.displayCaseVariantIdentifier(blockState.block)
updateVariantIdentifier(stackVariant ?: blockVariant)
}
fun updateVariantIdentifier(identifier: ResourceLocation?) {
if (variantIdentifier == identifier) {
return
}
variantIdentifier = identifier
val level = level
if (level != null) {
onVariantUpdated(level)
} else {
setChanged()
}
}
override fun saveAdditional(nbt: CompoundTag, registryLookup: HolderLookup.Provider) {
super.saveAdditional(nbt, registryLookup)
ContainerHelper.saveAllItems(nbt, inv, true, registryLookup)
variantIdentifier?.let { nbt.putString(MODIFICATION_VARIANT_TAG, it.toString()) }
}
override fun loadAdditional(nbt: CompoundTag, registryLookup: HolderLookup.Provider) {
super.loadAdditional(nbt, registryLookup)
inv.clear()
ContainerHelper.loadAllItems(nbt, inv, registryLookup)
variantIdentifier = if (nbt.contains(MODIFICATION_VARIANT_TAG)) {
ResourceLocation.tryParse(nbt.getString(MODIFICATION_VARIANT_TAG))
} else {
null
}
}
override fun getUpdatePacket(): Packet<ClientGamePacketListener>? {
@@ -123,6 +154,12 @@ class DisplayCaseBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cob
setChanged()
}
private fun onVariantUpdated(world: Level) {
val state = world.getBlockState(blockPos)
world.sendBlockUpdated(blockPos, state, state, Block.UPDATE_CLIENTS)
setChanged()
}
override fun clearContent() {
inv.clear()
}
@@ -176,4 +213,8 @@ class DisplayCaseBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Cob
override fun canPlaceItemThroughFace(slot: Int, stack: ItemStack, dir: Direction?): Boolean = (getStack().isEmpty)
override fun canTakeItemThroughFace(slot: Int, stack: ItemStack, direction: Direction): Boolean = (direction == Direction.DOWN)
}
companion object {
const val MODIFICATION_VARIANT_TAG = "ModificationVariant"
}
}
@@ -49,10 +49,11 @@ import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.state.BlockState
open class PokeSnackBlockEntity(pos: BlockPos, state: BlockState) :
TintBlockEntity(CobblemonBlockEntities.POKE_SNACK, pos, state),
BlockEntity(CobblemonBlockEntities.POKE_SNACK, pos, state), TintBlockEntity,
SpawningInfluence {
companion object {
@@ -62,6 +63,8 @@ open class PokeSnackBlockEntity(pos: BlockPos, state: BlockState) :
const val POKE_SNACK_CRUMBED_ASPECT = "poke_snack_crumbed"
}
override var tint: Int? = null
val spawner: FixedAreaSpawner by lazy {
val server = level as ServerLevel
@@ -229,6 +232,8 @@ open class PokeSnackBlockEntity(pos: BlockPos, state: BlockState) :
override fun saveAdditional(tag: CompoundTag, registries: HolderLookup.Provider) {
super.saveAdditional(tag, registries)
saveTint(tag)
tag.putInt(DataKeys.AMOUNT_SPAWNED, amountSpawned)
foodColourComponent?.let { component ->
@@ -268,6 +273,8 @@ open class PokeSnackBlockEntity(pos: BlockPos, state: BlockState) :
override fun loadAdditional(tag: CompoundTag, registries: HolderLookup.Provider) {
super.loadAdditional(tag, registries)
loadTint(tag)
amountSpawned = tag.getInt(DataKeys.AMOUNT_SPAWNED)
if (tag.contains(DataKeys.FOOD_COLOUR)) {
@@ -17,7 +17,6 @@ import com.cobblemon.mod.common.block.tmmachine.TMMachineBlock
import com.cobblemon.mod.common.block.tmmachine.TMMachineMenu
import com.cobblemon.mod.common.client.gui.tmmachine.TMMachineScreen
import com.cobblemon.mod.common.item.components.TMMoveComponent
import com.cobblemon.mod.common.util.itemRegistry
import net.minecraft.core.BlockPos
import net.minecraft.core.HolderLookup
import net.minecraft.core.NonNullList
@@ -41,7 +40,7 @@ import net.minecraft.world.inventory.ContainerData
import net.minecraft.world.level.Level
class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
BaseContainerBlockEntity(CobblemonBlockEntities.TM_MACHINE, pos, state) {
BaseContainerBlockEntity(CobblemonBlockEntities.TM_MACHINE, pos, state), TintBlockEntity {
companion object {
const val BURN_ACTIVE_TAG = "burnActive"
const val BURN_PROGRESS_TAG = "burnProgress"
@@ -113,6 +112,8 @@ class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
}
}
override var tint: Int? = null
var tmMachineInventory = TMMachineBlockInventory(this)
var partialTicks: Float = 0F
@@ -204,6 +205,7 @@ class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
// Add crafted TM to result slot
if (resultStack.isEmpty) {
setItem(TMMachineMenu.RESULT_SLOT, craftedTmStack)
setTint(move.elementalType.hue, 0.8F)
} else if (resultStack.count < resultStack.maxStackSize) {
resultStack.grow(1)
}
@@ -221,6 +223,7 @@ class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
override fun saveAdditional(compound: CompoundTag, registries: HolderLookup.Provider) {
super.saveAdditional(compound, registries)
saveTint(compound)
compound.putBoolean(BURN_ACTIVE_TAG, burnActive)
compound.putBoolean(REPEAT_PROCESS_TAG, repeatProcess)
compound.putInt(BURN_PROGRESS_TAG, burnProgress)
@@ -230,6 +233,7 @@ class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
override fun loadAdditional(compound: CompoundTag, registries: HolderLookup.Provider) {
super.loadAdditional(compound, registries)
loadTint(compound)
burnActive = compound.getBoolean(BURN_ACTIVE_TAG)
repeatProcess = compound.getBoolean(REPEAT_PROCESS_TAG)
burnProgress = compound.getInt(BURN_PROGRESS_TAG)
@@ -279,6 +283,15 @@ class TMMachineBlockEntity(pos: BlockPos, state: BlockState) :
updated = true
}
}
if (state.hasProperty(TMMachineBlock.DISPENSED)) {
val isDispensed = !getItem(TMMachineMenu.RESULT_SLOT).isEmpty
if (currentState.getValue(TMMachineBlock.DISPENSED) != isDispensed) {
currentState = currentState.setValue(TMMachineBlock.DISPENSED, isDispensed)
updated = true
}
}
if (state.hasProperty(TMMachineBlock.ACTIVE)) {
val isActive = containerData.get(BURN_ACTIVE_INDEX) == 1
if (currentState.getValue(TMMachineBlock.ACTIVE) != isActive) {
@@ -8,44 +8,50 @@
package com.cobblemon.mod.common.block.entity
import net.minecraft.core.BlockPos
import net.minecraft.core.HolderLookup
import net.minecraft.nbt.CompoundTag
import net.minecraft.nbt.IntTag
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
open class TintBlockEntity(type: BlockEntityType<*>?, blockPos: BlockPos, blockState: BlockState) : BlockEntity(type, blockPos, blockState) {
interface TintBlockEntity {
companion object {
const val TINT = "tint"
}
var tint: Int? = null
var tint: Int?
override fun saveAdditional(tag: CompoundTag, registries: HolderLookup.Provider) {
super.saveAdditional(tag, registries)
fun getTint(): Int = tint ?: 0xFFFFFF
fun setTint(tintValue: Int, opacity: Float = 1F) {
val entity = this as? BlockEntity ?: return
val level = entity.level ?: return
tint = if (opacity != 1F) {
val alpha = opacity.coerceIn(0F, 1F)
val r = (tintValue shr 16) and 0xFF
val g = (tintValue shr 8) and 0xFF
val b = tintValue and 0xFF
// Interpolate each channel toward 255 (White)
val rNew = (r * alpha + 255 * (1 - alpha)).toInt()
val gNew = (g * alpha + 255 * (1 - alpha)).toInt()
val bNew = (b * alpha + 255 * (1 - alpha)).toInt()
// Recombine into a single 0xRRGGBB integer
(rNew shl 16) or (gNew shl 8) or bNew
} else tintValue
entity.setChanged()
level.blockEntityChanged(entity.blockPos)
level.sendBlockUpdated(entity.blockPos, entity.blockState, entity.blockState, Block.UPDATE_ALL)
}
fun saveTint(tag: CompoundTag) {
tint?.let { tag.put(TINT, IntTag.valueOf(it)) }
}
override fun loadAdditional(tag: CompoundTag, registries: HolderLookup.Provider) {
super.loadAdditional(tag, registries)
fun loadTint(tag: CompoundTag) {
if (tag.contains(TINT)) tint = tag.getInt(TINT)
}
override fun getUpdateTag(registryLookup: HolderLookup.Provider): CompoundTag {
return this.saveWithoutMetadata(registryLookup)
}
fun getTint() = tint ?: 0xFFFFFF
fun setTint(tintValue: Int) {
level?.let {
tint = tintValue
setChanged()
it.blockEntityChanged(blockPos)
it.sendBlockUpdated(blockPos, blockState, blockState, Block.UPDATE_ALL)
}
}
}
@@ -0,0 +1,267 @@
/*
* 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.block.modificationstation
import com.cobblemon.mod.common.CobblemonBlocks
import com.cobblemon.mod.common.CobblemonMenuType
import com.cobblemon.mod.common.api.modification.ModificationVariant
import com.cobblemon.mod.common.api.modification.ModificationVariants
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource
import net.minecraft.world.Container
import net.minecraft.world.SimpleContainer
import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu
import net.minecraft.world.inventory.ContainerLevelAccess
import net.minecraft.world.inventory.DataSlot
import net.minecraft.world.inventory.ResultContainer
import net.minecraft.world.inventory.Slot
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.level.Level
class ModificationStationMenu(
containerId: Int,
playerInventory: Inventory,
private val access: ContainerLevelAccess
) : AbstractContainerMenu(CobblemonMenuType.MODIFICATION_STATION, containerId) {
private val selectedVariantIndex = DataSlot.standalone()
private val level: Level = playerInventory.player.level()
private var variants: List<ModificationVariant> = emptyList()
private var variantOutputs: List<ItemStack> = emptyList()
private var input: ItemStack = ItemStack.EMPTY
private var lastSoundTime: Long = 0L
val container: Container = object : SimpleContainer(1) {
override fun setChanged() {
super.setChanged()
this@ModificationStationMenu.slotsChanged(this)
slotUpdateListener.run()
}
}
private val resultContainer = ResultContainer()
val inputSlot: Slot
val resultSlot: Slot
private var slotUpdateListener: Runnable = Runnable {}
init {
inputSlot = addSlot(object : Slot(container, INPUT_SLOT, 20, 33) {
override fun mayPlace(stack: ItemStack): Boolean = hasVariantsFor(stack)
})
resultSlot = addSlot(object : Slot(resultContainer, RESULT_SLOT, 143, 33) {
override fun mayPlace(stack: ItemStack): Boolean = false
override fun onTake(player: Player, stack: ItemStack) {
stack.onCraftedBy(player.level(), player, stack.count)
inputSlot.remove(1)
if (inputSlot.hasItem()) {
setupResultSlot()
} else {
selectedVariantIndex.set(-1)
this.set(ItemStack.EMPTY)
}
access.execute { level, pos ->
val gameTime = level.gameTime
if (lastSoundTime != gameTime) {
level.playSound(null, pos, SoundEvents.UI_STONECUTTER_TAKE_RESULT, SoundSource.BLOCKS, 1.0F, 1.0F)
lastSoundTime = gameTime
}
}
super.onTake(player, stack)
}
})
for (row in 0 until 3) {
for (col in 0 until 9) {
addSlot(Slot(playerInventory, col + row * 9 + 9, 8 + col * 18, 84 + row * 18))
}
}
for (hotbar in 0 until 9) {
addSlot(Slot(playerInventory, hotbar, 8 + hotbar * 18, 142))
}
addDataSlot(selectedVariantIndex)
}
constructor(containerId: Int, playerInventory: Inventory) : this(containerId, playerInventory, ContainerLevelAccess.NULL)
fun getSelectedVariantIndex(): Int = selectedVariantIndex.get()
fun getVariants(): List<ModificationVariant> = variants
fun getVariantOutputs(): List<ItemStack> = variantOutputs
fun getNumVariants(): Int = variants.size
fun hasInputItem(): Boolean = inputSlot.hasItem() && variants.isNotEmpty()
override fun stillValid(player: Player): Boolean {
return stillValid(access, player, CobblemonBlocks.MODIFICATION_STATION)
}
override fun clickMenuButton(player: Player, id: Int): Boolean {
if (isValidVariantIndex(id)) {
selectedVariantIndex.set(id)
setupResultSlot()
}
return true
}
private fun isValidVariantIndex(index: Int): Boolean = index >= 0 && index < variants.size
override fun slotsChanged(container: Container) {
val inputStack = inputSlot.item
if (!inputStack.`is`(input.item)) {
input = inputStack.copy()
setupVariantList(inputStack)
}
}
private fun setupVariantList(inputStack: ItemStack) {
variants = emptyList()
variantOutputs = emptyList()
selectedVariantIndex.set(-1)
resultSlot.set(ItemStack.EMPTY)
if (!inputStack.isEmpty) {
val parentId = getParentIdentifier(inputStack)
if (parentId != null) {
val resolvedVariants = ModificationVariants.forParent(parentId)
.mapNotNull { variant ->
val output = createVariantOutput(variant) ?: return@mapNotNull null
variant to output
}
variants = resolvedVariants.map { it.first }
variantOutputs = resolvedVariants.map { it.second }
}
}
}
private fun setupResultSlot() {
if (isValidVariantIndex(selectedVariantIndex.get())) {
resultSlot.set(variantOutputs[selectedVariantIndex.get()].copy())
} else {
resultSlot.set(ItemStack.EMPTY)
}
broadcastChanges()
}
fun registerUpdateListener(listener: Runnable) {
slotUpdateListener = listener
}
override fun canTakeItemForPickAll(stack: ItemStack, slot: Slot): Boolean {
return slot.container !== resultContainer && super.canTakeItemForPickAll(stack, slot)
}
override fun quickMoveStack(player: Player, index: Int): ItemStack {
var copiedStack = ItemStack.EMPTY
val slot = slots[index]
if (slot.hasItem()) {
val movedStack = slot.item
val movedItem = movedStack.item
copiedStack = movedStack.copy()
if (index == RESULT_SLOT) {
movedItem.onCraftedBy(movedStack, player.level(), player)
if (!moveItemStackTo(movedStack, INV_SLOT_START, USE_ROW_SLOT_END, true)) {
return ItemStack.EMPTY
}
slot.onQuickCraft(movedStack, copiedStack)
} else if (index == INPUT_SLOT) {
if (!moveItemStackTo(movedStack, INV_SLOT_START, USE_ROW_SLOT_END, false)) {
return ItemStack.EMPTY
}
} else if (hasVariantsFor(movedStack)) {
if (!moveItemStackTo(movedStack, INPUT_SLOT, RESULT_SLOT, false)) {
return ItemStack.EMPTY
}
} else if (index in INV_SLOT_START until INV_SLOT_END) {
if (!moveItemStackTo(movedStack, USE_ROW_SLOT_START, USE_ROW_SLOT_END, false)) {
return ItemStack.EMPTY
}
} else if (index in USE_ROW_SLOT_START until USE_ROW_SLOT_END) {
if (!moveItemStackTo(movedStack, INV_SLOT_START, INV_SLOT_END, false)) {
return ItemStack.EMPTY
}
}
if (movedStack.isEmpty) {
slot.setByPlayer(ItemStack.EMPTY)
} else {
slot.setChanged()
}
if (movedStack.count == copiedStack.count) {
return ItemStack.EMPTY
}
slot.onTake(player, movedStack)
broadcastChanges()
}
return copiedStack
}
override fun removed(player: Player) {
super.removed(player)
resultContainer.removeItemNoUpdate(1)
access.execute { _, _ -> clearContainer(player, container) }
}
private fun hasVariantsFor(stack: ItemStack): Boolean {
val parentId = getParentIdentifier(stack) ?: return false
return ModificationVariants.forParent(parentId).isNotEmpty()
}
private fun getParentIdentifier(stack: ItemStack): ResourceLocation? {
val blockItem = stack.item as? BlockItem
if (blockItem != null) {
val blockIdentifier = BuiltInRegistries.BLOCK.getKey(blockItem.block)
return ModificationVariants.getByIdentifier(blockIdentifier)?.parent ?: blockIdentifier
}
val itemIdentifier = BuiltInRegistries.ITEM.getKey(stack.item)
return itemIdentifier
}
private fun createVariantOutput(variant: ModificationVariant): ItemStack? {
if (!BuiltInRegistries.BLOCK.containsKey(variant.identifier)) {
return null
}
val block = BuiltInRegistries.BLOCK.get(variant.identifier) ?: return null
val item = block.asItem()
if (item == Items.AIR) {
return null
}
return ItemStack(item)
}
companion object {
const val INPUT_SLOT = 0
const val RESULT_SLOT = 1
private const val INV_SLOT_START = 2
private const val INV_SLOT_END = 29
private const val USE_ROW_SLOT_START = 29
private const val USE_ROW_SLOT_END = 38
}
}
@@ -55,6 +55,7 @@ class TMMachineBlock(properties: Properties) : BaseEntityBlock(properties), Simp
val WATERLOGGED = BlockStateProperties.WATERLOGGED
val ACTIVE: BooleanProperty = BooleanProperty.create("active")
val OPEN: BooleanProperty = BooleanProperty.create("open")
val DISPENSED: BooleanProperty = BooleanProperty.create("dispensed")
private val SHAPE: VoxelShape = Shapes.box(0.0, 0.0, 0.0, 1.0, 0.375, 1.0)
@@ -140,11 +141,12 @@ class TMMachineBlock(properties: Properties) : BaseEntityBlock(properties), Simp
override fun getStateForPlacement(context: BlockPlaceContext): BlockState {
return defaultBlockState()
.setValue(FACING, context.horizontalDirection.opposite)
.setValue(WATERLOGGED, context.level.getFluidState(context.clickedPos).type == Fluids.WATER)
.setValue(EMPTY, true)
.setValue(ACTIVE, false)
.setValue(OPEN, false)
.setValue(FACING, context.horizontalDirection.opposite)
.setValue(WATERLOGGED, context.level.getFluidState(context.clickedPos).type == Fluids.WATER)
.setValue(EMPTY, true)
.setValue(ACTIVE, false)
.setValue(OPEN, false)
.setValue(DISPENSED, false)
}
override fun useWithoutItem(state: BlockState, level: Level, pos: BlockPos, player: Player, hit: BlockHitResult): InteractionResult {
@@ -188,7 +190,7 @@ class TMMachineBlock(properties: Properties) : BaseEntityBlock(properties), Simp
}
override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
builder.add(FACING, WATERLOGGED, EMPTY, ACTIVE, OPEN)
builder.add(FACING, WATERLOGGED, EMPTY, ACTIVE, OPEN, DISPENSED)
}
override fun codec(): MapCodec<TMMachineBlock> = CODEC
@@ -15,6 +15,7 @@ import com.cobblemon.mod.common.CobblemonClientImplementation
import com.cobblemon.mod.common.CobblemonEntities
import com.cobblemon.mod.common.CobblemonItems
import com.cobblemon.mod.common.CobblemonMenuType
import com.cobblemon.mod.common.CobblemonModificationBlocks
import com.cobblemon.mod.common.api.berry.Berries
import com.cobblemon.mod.common.api.scheduling.ClientTaskTracker
import com.cobblemon.mod.common.api.storage.player.client.ClientGeneralPlayerData
@@ -28,6 +29,7 @@ import com.cobblemon.mod.common.client.gui.PartyOverlayDataControl
import com.cobblemon.mod.common.client.gui.RideControlsOverlay
import com.cobblemon.mod.common.client.gui.battle.BattleOverlay
import com.cobblemon.mod.common.client.gui.cookingpot.CookingPotScreen
import com.cobblemon.mod.common.client.gui.modificationstation.ModificationStationScreen
import com.cobblemon.mod.common.client.gui.tmmachine.TMMachineScreen
import com.cobblemon.mod.common.client.gui.party.PartyTutorialToasts
import com.cobblemon.mod.common.client.particle.BedrockParticleOptionsRepository
@@ -94,7 +96,6 @@ import net.minecraft.client.renderer.blockentity.HangingSignRenderer
import net.minecraft.client.renderer.blockentity.SignRenderer
import net.minecraft.client.renderer.entity.EntityRenderer
import net.minecraft.client.renderer.entity.LivingEntityRenderer
import net.minecraft.client.renderer.entity.layers.RenderLayer
import net.minecraft.client.resources.PlayerSkin
import net.minecraft.server.packs.resources.ResourceManager
import net.minecraft.world.InteractionHand
@@ -234,7 +235,10 @@ object CobblemonClient {
}
}
return@BlockColor 0xFFFFFF
}, CobblemonBlocks.POKE_SNACK, CobblemonBlocks.POKE_CAKE)
}, CobblemonBlocks.POKE_SNACK,
CobblemonBlocks.POKE_CAKE,
CobblemonBlocks.TM_MACHINE
)
}
private fun registerBlockRenderTypes() {
@@ -250,6 +254,7 @@ object CobblemonClient {
RenderType.cutout(),
CobblemonBlocks.GILDED_CHEST,
CobblemonBlocks.FOSSIL_ANALYZER,
CobblemonBlocks.MODIFICATION_STATION,
CobblemonBlocks.APRICORN_DOOR,
CobblemonBlocks.APRICORN_TRAPDOOR,
CobblemonBlocks.APRICORN_SIGN,
@@ -330,6 +335,9 @@ object CobblemonClient {
CobblemonBlocks.SKY_TUMBLESTONE_CLUSTER,
CobblemonBlocks.GIMMIGHOUL_CHEST,
CobblemonBlocks.DISPLAY_CASE,
*CobblemonModificationBlocks.displayCaseNonTintedVariantBlocks().toTypedArray(),
*CobblemonModificationBlocks.domeFossilVariantBlocks().toTypedArray(),
*CobblemonModificationBlocks.pcVariantBlocks().toTypedArray(),
CobblemonBlocks.SACCHARINE_DOOR,
CobblemonBlocks.SACCHARINE_TRAPDOOR,
CobblemonBlocks.SACCHARINE_SIGN,
@@ -393,6 +401,11 @@ object CobblemonClient {
CobblemonBlocks.TM_MACHINE
)
this.implementation.registerBlockRenderType(
RenderType.translucent(),
*CobblemonModificationBlocks.displayCaseTintedVariantBlocks().toTypedArray()
)
this.createBoatModelLayers()
}
@@ -419,6 +432,7 @@ object CobblemonClient {
private fun registerMenuScreens() {
MenuScreens.register(CobblemonMenuType.COOKING_POT, ::CookingPotScreen)
MenuScreens.register(CobblemonMenuType.TM_MACHINE, ::TMMachineScreen)
MenuScreens.register(CobblemonMenuType.MODIFICATION_STATION, ::ModificationStationScreen)
}
private fun registerBlockEntityRenderers() {
@@ -40,9 +40,9 @@ class MoveSlotButton(
) : Button(x, y, WIDTH, HEIGHT, move?.name?.text() ?: lang("ui.moves"), onPress, CreateNarration { move?.name?.text() ?: lang("ui.moves") }), CobblemonRenderable {
companion object {
private val moveResource = cobblemonResource("textures/gui/summary/summary_move.png")
private val moveDisabledResource = cobblemonResource("textures/gui/summary/summary_move_disabled.png")
private val moveOverlayResource = cobblemonResource("textures/gui/summary/summary_move_overlay.png")
val moveResource = cobblemonResource("textures/gui/summary/summary_move.png")
val moveDisabledResource = cobblemonResource("textures/gui/summary/summary_move_disabled.png")
val moveOverlayResource = cobblemonResource("textures/gui/summary/summary_move_overlay.png")
const val WIDTH = 108
const val HEIGHT = 22
@@ -0,0 +1,217 @@
/*
* 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.gui.modificationstation
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
import net.minecraft.client.resources.sounds.SimpleSoundInstance
import com.cobblemon.mod.common.block.modificationstation.ModificationStationMenu
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvents
import net.minecraft.util.Mth
import net.minecraft.network.chat.Component
import net.minecraft.world.entity.player.Inventory
class ModificationStationScreen(
menu: ModificationStationMenu,
playerInventory: Inventory,
title: Component
) : AbstractContainerScreen<ModificationStationMenu>(menu, playerInventory, title) {
private var scrollOffs = 0.0F
private var scrolling = false
private var startIndex = 0
private var displayVariants = false
init {
menu.registerUpdateListener { containerChanged() }
titleLabelY -= 1
}
override fun render(graphics: GuiGraphics, mouseX: Int, mouseY: Int, partialTick: Float) {
super.render(graphics, mouseX, mouseY, partialTick)
renderTooltip(graphics, mouseX, mouseY)
}
override fun renderBg(graphics: GuiGraphics, partialTick: Float, mouseX: Int, mouseY: Int) {
val left = leftPos
val top = topPos
graphics.blit(BG_LOCATION, left, top, 0, 0, imageWidth, imageHeight)
val yOffset = (41.0F * scrollOffs).toInt()
val scrollerSprite = if (isScrollBarActive()) SCROLLER_SPRITE else SCROLLER_DISABLED_SPRITE
graphics.blitSprite(scrollerSprite, left + 119, top + 15 + yOffset, 12, 15)
val variantsLeft = leftPos + RECIPES_X
val variantsTop = topPos + RECIPES_Y
val variantsEnd = startIndex + (RECIPES_COLUMNS * RECIPES_ROWS)
renderButtons(graphics, mouseX, mouseY, variantsLeft, variantsTop, variantsEnd)
renderVariants(graphics, variantsLeft, variantsTop, variantsEnd)
}
override fun renderTooltip(graphics: GuiGraphics, x: Int, y: Int) {
super.renderTooltip(graphics, x, y)
if (!displayVariants) {
return
}
val variantsLeft = leftPos + RECIPES_X
val variantsTop = topPos + RECIPES_Y
val variantsEnd = startIndex + (RECIPES_COLUMNS * RECIPES_ROWS)
val outputs = menu.getVariantOutputs()
for (index in startIndex until variantsEnd) {
if (index >= menu.getNumVariants()) {
break
}
val relativeIndex = index - startIndex
val xPos = variantsLeft + relativeIndex % RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_WIDTH
val yPos = variantsTop + relativeIndex / RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_HEIGHT + 2
if (x >= xPos && x < xPos + RECIPES_IMAGE_SIZE_WIDTH && y >= yPos && y < yPos + RECIPES_IMAGE_SIZE_HEIGHT) {
graphics.renderTooltip(font, outputs[index], x, y)
break
}
}
}
private fun renderButtons(graphics: GuiGraphics, mouseX: Int, mouseY: Int, x: Int, y: Int, endIndex: Int) {
for (index in startIndex until endIndex) {
if (index >= menu.getNumVariants()) {
break
}
val relativeIndex = index - startIndex
val xPos = x + relativeIndex % RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_WIDTH
val row = relativeIndex / RECIPES_COLUMNS
val yPos = y + row * RECIPES_IMAGE_SIZE_HEIGHT + 2
val sprite = if (index == menu.getSelectedVariantIndex()) {
RECIPE_SELECTED_SPRITE
} else if (mouseX in xPos until (xPos + RECIPES_IMAGE_SIZE_WIDTH) && mouseY in yPos until (yPos + RECIPES_IMAGE_SIZE_HEIGHT)) {
RECIPE_HIGHLIGHTED_SPRITE
} else {
RECIPE_SPRITE
}
graphics.blitSprite(sprite, xPos, yPos - 1, RECIPES_IMAGE_SIZE_WIDTH, RECIPES_IMAGE_SIZE_HEIGHT)
}
}
private fun renderVariants(graphics: GuiGraphics, x: Int, y: Int, endIndex: Int) {
val outputs = menu.getVariantOutputs()
for (index in startIndex until endIndex) {
if (index >= menu.getNumVariants()) {
break
}
val relativeIndex = index - startIndex
val xPos = x + relativeIndex % RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_WIDTH
val row = relativeIndex / RECIPES_COLUMNS
val yPos = y + row * RECIPES_IMAGE_SIZE_HEIGHT + 2
graphics.renderItem(outputs[index], xPos, yPos)
}
}
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
scrolling = false
val minecraftClient = minecraft ?: return super.mouseClicked(mouseX, mouseY, button)
if (displayVariants) {
val variantsLeft = leftPos + RECIPES_X
val variantsTop = topPos + RECIPES_Y
val variantsEnd = startIndex + (RECIPES_COLUMNS * RECIPES_ROWS)
for (index in startIndex until variantsEnd) {
val relativeIndex = index - startIndex
val xPos = mouseX - (variantsLeft + relativeIndex % RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_WIDTH)
val yPos = mouseY - (variantsTop + relativeIndex / RECIPES_COLUMNS * RECIPES_IMAGE_SIZE_HEIGHT)
if (xPos >= 0.0 && yPos >= 0.0 && xPos < RECIPES_IMAGE_SIZE_WIDTH.toDouble() && yPos < RECIPES_IMAGE_SIZE_HEIGHT.toDouble()) {
val player = minecraftClient.player
if (player != null && menu.clickMenuButton(player, index)) {
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(SoundEvents.UI_STONECUTTER_SELECT_RECIPE, 1.0F))
minecraftClient.gameMode?.handleInventoryButtonClick(menu.containerId, index)
return true
}
}
}
val scrollX = leftPos + 119
val scrollY = topPos + 9
if (mouseX >= scrollX && mouseX < (scrollX + 12) && mouseY >= scrollY && mouseY < (scrollY + 54)) {
scrolling = true
}
}
return super.mouseClicked(mouseX, mouseY, button)
}
override fun mouseDragged(mouseX: Double, mouseY: Double, button: Int, dragX: Double, dragY: Double): Boolean {
if (scrolling && isScrollBarActive()) {
val minY = topPos + 14
val maxY = minY + 54
scrollOffs = ((mouseY.toFloat() - minY.toFloat()) - 7.5F) / ((maxY - minY).toFloat() - 15.0F)
scrollOffs = Mth.clamp(scrollOffs, 0.0F, 1.0F)
startIndex = (scrollOffs * getOffscreenRows().toFloat() + 0.5).toInt() * RECIPES_COLUMNS
return true
}
return super.mouseDragged(mouseX, mouseY, button, dragX, dragY)
}
override fun mouseScrolled(mouseX: Double, mouseY: Double, scrollX: Double, scrollY: Double): Boolean {
if (isScrollBarActive()) {
val offscreenRows = getOffscreenRows()
val offset = scrollY.toFloat() / offscreenRows.toFloat()
scrollOffs = Mth.clamp(scrollOffs - offset, 0.0F, 1.0F)
startIndex = (scrollOffs * offscreenRows.toFloat() + 0.5).toInt() * RECIPES_COLUMNS
}
return true
}
private fun isScrollBarActive(): Boolean {
return displayVariants && menu.getNumVariants() > RECIPES_COLUMNS * RECIPES_ROWS
}
private fun getOffscreenRows(): Int {
return (menu.getNumVariants() + RECIPES_COLUMNS - 1) / RECIPES_COLUMNS - RECIPES_ROWS
}
private fun containerChanged() {
displayVariants = menu.hasInputItem()
if (!displayVariants) {
scrollOffs = 0.0F
startIndex = 0
}
}
companion object {
private val SCROLLER_SPRITE = ResourceLocation.withDefaultNamespace("container/stonecutter/scroller")
private val SCROLLER_DISABLED_SPRITE = ResourceLocation.withDefaultNamespace("container/stonecutter/scroller_disabled")
private val RECIPE_SELECTED_SPRITE = ResourceLocation.withDefaultNamespace("container/stonecutter/recipe_selected")
private val RECIPE_HIGHLIGHTED_SPRITE = ResourceLocation.withDefaultNamespace("container/stonecutter/recipe_highlighted")
private val RECIPE_SPRITE = ResourceLocation.withDefaultNamespace("container/stonecutter/recipe")
private val BG_LOCATION = ResourceLocation.withDefaultNamespace("textures/gui/container/stonecutter.png")
private const val RECIPES_COLUMNS = 4
private const val RECIPES_ROWS = 3
private const val RECIPES_IMAGE_SIZE_WIDTH = 16
private const val RECIPES_IMAGE_SIZE_HEIGHT = 18
private const val RECIPES_X = 52
private const val RECIPES_Y = 14
}
}
@@ -675,21 +675,17 @@ class MovesLearnsetWidget(val pX: Int, val pY: Int) : SoundlessWidget(
val speciesId = form.species.resourceIdentifier
val pokedexManager = CobblemonClient.clientPokedexData
val highestLevel = pokedexManager.getSpeciesRecord(speciesId)?.getFormRecord(form.name)?.highestLevel ?: 0
val evolutionMoveLevels = buildEvolutionMoveLevelIndex(form)
val highestEvolutionLevel = collectEvolutionForms(form).maxOfOrNull { evolutionForm ->
val speciesRecord = pokedexManager.getSpeciesRecord(evolutionForm.species.resourceIdentifier)
speciesRecord?.getFormRecord(evolutionForm.name)?.highestLevel ?: speciesRecord?.highestLevel ?: 0
} ?: 0
val learnedTMs = CobblemonClient.clientTMMoveData.learnedTMs
val unlockAllMoveDexMovesByDefault = ServerSettings.unlockAllMoveDexMovesByDefault
fun isLevelUpDiscovered(move: MoveTemplate, level: Int): Boolean {
fun isLevelUpDiscovered(level: Int): Boolean {
if (unlockAllMoveDexMovesByDefault) return true
if (highestLevel >= level) return true
for ((evolutionSpeciesId, moveLevels) in evolutionMoveLevels) {
val evolutionLevel = moveLevels[move.name] ?: continue
val evolutionHighest = pokedexManager.getSpeciesRecord(evolutionSpeciesId)?.highestLevel ?: 0
if (evolutionHighest >= evolutionLevel) return true
}
return false
return highestEvolutionLevel >= level
}
fun addEntry(
@@ -702,7 +698,11 @@ class MovesLearnsetWidget(val pX: Int, val pY: Int) : SoundlessWidget(
val key = move.name
if (!entries.containsKey(key)) {
val tmId = TechnicalMachines.moveToTM[move]?.id
val tmUnlocked = source == LearnsetSource.TM && tmId != null && tmId in learnedTMs
val tmUnlocked = tmId != null && (
unlockAllMoveDexMovesByDefault
|| tmId in learnedTMs
|| TechnicalMachines.tmMap[tmId]?.isPassivelyObtained() == true
)
val resolvedTmLocked = if (source == LearnsetSource.TM) tmLocked else false
entries[key] = LearnsetMoveEntry(move, source, level, resolvedTmLocked, isDiscovered, tmId, tmUnlocked)
}
@@ -710,7 +710,7 @@ class MovesLearnsetWidget(val pX: Int, val pY: Int) : SoundlessWidget(
form.moves.levelUpMoves.toSortedMap().forEach { (level, moves) ->
moves.forEach { move ->
val discovered = isLevelUpDiscovered(move, level)
val discovered = isLevelUpDiscovered(level)
addEntry(move, LearnsetSource.LEVEL_UP, level = level, isDiscovered = discovered)
}
}
@@ -718,7 +718,9 @@ class MovesLearnsetWidget(val pX: Int, val pY: Int) : SoundlessWidget(
form.moves.tmMoves.sortedBy { it.displayName.string }.forEach { move ->
val tmLocked = if (unlockAllMoveDexMovesByDefault) false else {
val tmId = TechnicalMachines.moveToTM[move]?.id
tmId != null && tmId !in learnedTMs
tmId != null
&& tmId !in learnedTMs
&& TechnicalMachines.tmMap[tmId]?.isPassivelyObtained() != true
}
addEntry(move, LearnsetSource.TM, tmLocked = tmLocked, isDiscovered = !tmLocked)
}
@@ -27,11 +27,9 @@ class IconButton(
val buttonHeight: Number,
var resource: ResourceLocation? = null,
val scale: Float = 0.5F,
val hoverExtendRight: Int = 0,
val silent: Boolean = false,
val clickAction: OnPress
): Button(buttonX.toInt(), buttonY.toInt(), buttonWidth.toInt(), buttonHeight.toInt(), "".text(), clickAction, DEFAULT_NARRATION), CobblemonRenderable {
override fun mouseDragged(d: Double, e: Double, i: Int, f: Double, g: Double) = false
override fun defaultButtonNarrationText(builder: NarrationElementOutput) {}
@@ -44,7 +42,7 @@ class IconButton(
y = buttonY / scale,
width = buttonWidth,
height = buttonHeight,
vOffset = if (isMouseOver(mouseX.toDouble(), mouseY.toDouble())) buttonHeight else 0,
vOffset = if (isMouseOver(mouseX.toDouble(), mouseY.toDouble()) && active) buttonHeight else 0,
textureHeight = buttonHeight.toFloat() * 2,
scale = scale
)
@@ -62,7 +60,7 @@ class IconButton(
override fun isMouseOver(mouseX: Double, mouseY: Double): Boolean {
val minX = x.toDouble()
val maxX = minX + width + hoverExtendRight
val maxX = minX + width
val minY = y.toDouble()
val maxY = minY + (height * scale)
return active && visible && mouseX >= minX && mouseX < maxX && mouseY >= minY && mouseY < maxY
@@ -17,6 +17,7 @@ import com.cobblemon.mod.common.client.CobblemonResources
import com.cobblemon.mod.common.client.gui.MoveCategoryIcon
import com.cobblemon.mod.common.client.gui.ScrollingWidget
import com.cobblemon.mod.common.client.gui.TypeIcon
import com.cobblemon.mod.common.client.gui.interact.moveselect.MoveSlotButton
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.moves.MoveSlotWidget
import com.cobblemon.mod.common.client.gui.tmmachine.MovesScrollingWidget.ScrollSlot
import com.cobblemon.mod.common.client.render.drawScaledText
@@ -31,7 +32,7 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.util.FastColor
import net.minecraft.util.Mth
class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObservable<MutableList<TechnicalMachine>>, val setTM: (TechnicalMachine?, Boolean) -> (Unit)): ScrollingWidget<ScrollSlot>(
class MovesScrollingWidget(val pX: Int, val pY: Int, tmList: SettableObservable<MutableList<TechnicalMachine>>, val setTM: (TechnicalMachine?, Boolean) -> (Unit)): ScrollingWidget<ScrollSlot>(
width = WIDTH,
height = HEIGHT,
left = pX,
@@ -64,6 +65,17 @@ class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObserva
}
}
fun setDisabled(disabled: Boolean, exclude: TechnicalMachine? = null) {
for (child in children()) {
// Set disabled state for moves that do not match excluded move
if (child is ScrollSlot) {
val shouldDisable = child.tm != exclude
child.highlighted = !shouldDisable
child.disabled = disabled && shouldDisable
}
}
}
override fun getScrollbarPosition(): Int = rowLeft + width - 3
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
@@ -101,6 +113,7 @@ class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObserva
var posX: Int = 0
var posY: Int = 0
var highlighted = false
var disabled = false
override fun render(context: GuiGraphics, index: Int, y: Int, x: Int, entryWidth: Int, entryHeight: Int, mouseX: Int, mouseY: Int, hovered: Boolean, tickDelta: Float) {
posX = x
@@ -114,7 +127,7 @@ class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObserva
val matrices = context.pose()
blitk(
matrixStack = matrices,
texture = MoveSlotWidget.moveResource,
texture = if (disabled) MoveSlotButton.moveDisabledResource else MoveSlotWidget.moveResource,
x = startPosX,
y = startPosY,
width = MoveSlotWidget.MOVE_WIDTH,
@@ -135,7 +148,7 @@ class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObserva
height = MoveSlotWidget.MOVE_HEIGHT
)
if (highlighted || isHovered) {
if (highlighted || (!disabled && isHovered)) {
blitk(
matrixStack = matrices,
texture = MoveSlotWidget.moveSelectedOverlayResource,
@@ -179,14 +192,14 @@ class MovesScrollingWidget(val pX: Int, val pY: Int, val tmList: SettableObserva
shadow = true
)
if (isHovered) {
if (!disabled && isHovered) {
setTM(tm, false)
}
}
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
// Prevent clicking through scroll bar
if (mouseX < posX + (108)) {
if (!disabled && (mouseX < posX + (108))) {
setTM(tm, true)
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
}
@@ -27,6 +27,8 @@ import com.cobblemon.mod.common.block.entity.TMMachineBlockEntity
import com.cobblemon.mod.common.block.tmmachine.TMMachineMenu
import com.cobblemon.mod.common.client.CobblemonClient
import com.cobblemon.mod.common.client.CobblemonResources
import com.cobblemon.mod.common.client.gui.MoveCategoryIcon
import com.cobblemon.mod.common.client.gui.TypeIcon
import com.cobblemon.mod.common.client.gui.interact.moveselect.MoveSlotButton
import com.cobblemon.mod.common.client.gui.summary.widgets.screens.moves.MovesWidget
import com.cobblemon.mod.common.client.settings.ServerSettings
@@ -49,7 +51,6 @@ import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
import net.minecraft.client.resources.sounds.SimpleSoundInstance
import net.minecraft.core.BlockPos
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvent
@@ -77,14 +78,14 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
const val CRAFT_TICKS = 10 // Length for craft completion animation
const val RESET_DISC_TICKS = 4 // Length for disc reset animation
const val SCREEN_SAVER_TIMEOUT_TICKS = 200 // 10 Seconds
const val SCREEN_SAVER_TIMEOUT_TICKS = 1200 // 60 Seconds
const val SCREEN_SAVER_WIDTH = 118
const val SCREEN_SAVER_HEIGHT = 110
val baseResource = cobblemonResource("textures/gui/tmmachine/base.png")
val tmTray = cobblemonResource("textures/gui/tmmachine/tm_tray.png")
val iconArrowLeft = cobblemonResource("textures/gui/tmmachine/icon_arrow_left.png")
val iconArrowRight = cobblemonResource("textures/gui/tmmachine/icon_arrow_right.png")
val iconBack = cobblemonResource("textures/gui/tmmachine/icon_back.png")
val tooltipMoveInfo = cobblemonResource("textures/gui/tmmachine/tooltip_move_info.png")
val emptyDiscSlot = cobblemonResource("textures/item/tms/blank_disc_empty_slot.png")
val discBase = cobblemonResource("textures/gui/tmmachine/tm_base.png")
@@ -140,6 +141,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
var scanLineOffsetY: Double = 0.0
var initScreen: Boolean = false
var heldMoveItemChanged = false
override fun init() {
imageWidth = WIDTH
@@ -160,20 +162,21 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
pY = topPos + 9 + ((TMPartySlotWidget.HEIGHT + 3) * index),
pokemon = pokemon,
onPress = {
if ((it as TMPartySlotWidget).clickable) {
if (heldStackMove != null && pokemon != null) {
if ((it as TMPartySlotWidget).clickable && pokemon != null) {
// Teach move if holding TM item, else open learnable moves list for Pokémon
if (heldStackMove != null) {
heldStackMove?.let { move ->
if (canLearnTMMove(move, pokemon) == TMPartySlotWidget.CAN_LEARN) {
CobblemonNetwork.sendToServer(TMMachineTeachMovePacket(pokemon.uuid, menu.carried, move))
// Mark to update client next tick
heldMoveItemChanged = true
}
}
} else {
if (mode == TYPE_SELECT_MODE && pokemon != null) {
setMoveList(pokemon = pokemon)
setScreenFromMode(MOVE_SELECT_MODE)
selectedPokemon = pokemon
playSound(CobblemonSounds.GUI_CLICK)
}
} else if (mode != TM_BURN_MODE) {
setMoveList(pokemon = pokemon)
setScreenFromMode(MOVE_SELECT_MODE)
selectedPokemon = pokemon
playSound(CobblemonSounds.GUI_CLICK)
}
}
}
@@ -185,7 +188,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
typesScrollList = TypesScrollingWidget(
pX = leftPos + 7,
pX = leftPos + 6,
pY = topPos + 11,
setType = { type ->
sortType = type
@@ -212,13 +215,14 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
if (!children().contains(moveSearchWidget)) addRenderableWidget(moveSearchWidget)
backButton = IconButton(
leftPos + 90F,
leftPos + 106F,
topPos + 1F,
20,
18,
18,
iconArrowLeft,
hoverExtendRight = 11
) { setScreenFromMode(TYPE_SELECT_MODE) }
iconBack
) {
setScreenFromMode(TYPE_SELECT_MODE)
}
if (!children().contains(backButton)) addRenderableWidget(backButton)
selectedMoveButton = MoveSlotButton(
@@ -228,7 +232,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
pp = selectedTM?.moveName?.pp ?: 0,
ppAsFraction = false
) {
if (!isBurnActive()) {
if ((it as MoveSlotButton).enabled) {
if (::movesScrollingList.isInitialized && movesScrollingList.children().isEmpty()) setMoveList()
playSound(CobblemonSounds.GUI_CLICK)
setScreenFromMode(MOVE_SELECT_MODE)
@@ -308,7 +312,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
if (::selectedMoveButton.isInitialized) {
selectedMoveButton.enabled = !isBurnActive()
selectedMoveButton.enabled = !isBurnActive() && (heldStackMove == null || heldStackMove == selectedTM?.moveName)
}
if (isBurnActive()) {
@@ -325,30 +329,9 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
if (!initScreen) loadBurnScreenData()
}
val heldStack = menu.carried
if (heldStack.item == CobblemonItems.TECHNICAL_MACHINE) {
// Store move of TM item picked up by player cursor.
TMMoveComponent.getTMMove(heldStack)?.let { move ->
if (heldStackMove != move) heldStackMove = move
if (mode == TYPE_SELECT_MODE) updatePartySlotStatus(heldStackMove)
}
} else if (heldStackMove != null) {
heldStackMove = null
updatePartySlotStatus(null)
}
// Allow dragging held TMs onto party slots in both move list and burn views.
when (mode) {
TM_BURN_MODE -> {
for (slot in partySlotList) {
slot.clickable = heldStackMove != null && (selectedTM == null || heldStackMove == selectedTM?.moveName)
}
updatePartySlotStatus(selectedTM?.moveName ?: heldStackMove)
}
MOVE_SELECT_MODE -> {
for (slot in partySlotList) slot.clickable = heldStackMove != null
updatePartySlotStatus(heldStackMove)
}
if (heldMoveItemChanged) {
heldMoveItemChanged = false
updateHeldStackMove()
}
// Screen saver
@@ -438,6 +421,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
toggleTMBurn(true)
}
}
updateHeldStackMove()
}
private fun setMoveList(filter: String? = null, pokemon: Pokemon? = null) {
@@ -470,7 +454,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
}
for (slot in partySlotList) slot.clickable = isVisible
setPartySlotsClickable(isVisible)
}
private fun toggleMoveSelect(isVisible: Boolean) {
@@ -686,8 +670,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
fun renderMoveInfo(context: GuiGraphics, mouseX: Int, mouseY: Int) {
val currentTm = selectedTM
val moveTemplate = currentTm?.moveName
val moveTemplate = selectedTM?.moveName
blitk(
matrixStack = context.pose(),
@@ -790,7 +773,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
)
context.pose().popPose()
val recipe = selectedTM?.getClampedRecipe() ?: listOf()
val recipe = TechnicalMachines.moveToTM[moveTemplate]?.getClampedRecipe() ?: listOf()
// Render material cost
recipe.forEachIndexed { index, recipe ->
val itemX = (leftPos + 129 + (index * 18))
@@ -808,6 +791,7 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
context.renderItemDecorations(Minecraft.getInstance().font, itemStack, itemX, itemY)
if (
menu.carried.isEmpty &&
mouseX >= itemX && mouseX < itemX + 16 &&
mouseY >= itemY && mouseY < itemY + 16
) {
@@ -817,6 +801,149 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
}
fun renderHeldMoveInfoTooltip(context: GuiGraphics, mouseX: Int, mouseY: Int) {
heldStackMove?.let { moveTemplate ->
val matrices = context.pose()
val posX = mouseX + 10
val posY = mouseY - 49
matrices.pushPose()
matrices.translate(0.0F, 0.0F, 1000.0F)
blitk(
matrixStack = matrices,
texture = tooltipMoveInfo,
x = posX,
y = posY,
width = 96,
height = 98,
alpha = 0.96F
)
drawScaledText(
context = context,
text = moveTemplate.displayName.bold(),
x = posX + 6,
y = posY + 6,
shadow = true,
scale = HALF_SCALE
)
TypeIcon(posX + 81, posY + 3.5, moveTemplate.elementalType, small = true).render(context)
blitk(
matrixStack = matrices,
texture = MovesWidget.movesPowerIconResource,
x = posX + 8.5,
y = posY + 15.5,
width = 5,
height = 5
)
blitk(
matrixStack = matrices,
texture = MovesWidget.movesAccuracyIconResource,
x = posX + 8.5,
y = posY + 27.5,
width = 5,
height = 5
)
blitk(
matrixStack = matrices,
texture = MovesWidget.movesEffectIconResource,
x = posX + 8.5,
y = posY + 39.5,
width = 5,
height = 5
)
drawScaledText(
context = context,
text = lang("ui.power"),
x = posX + 15.5,
y = posY + 16,
shadow = true,
scale = HALF_SCALE
)
drawScaledText(
context = context,
text = lang("ui.accuracy"),
x = posX + 15.5,
y = posY + 28,
shadow = true,
scale = HALF_SCALE
)
drawScaledText(
context = context,
text = lang("ui.effect"),
x = posX + 15.5,
y = posY + 40,
shadow = true,
scale = HALF_SCALE
)
val movePower = if (moveTemplate.power.toInt() > 0) moveTemplate.power.toInt().toString().text() else "—".text()
drawScaledTextJustifiedRight(
context = context,
text = movePower,
x = posX + 88,
y = posY + 16,
shadow = true,
scale = HALF_SCALE
)
val moveAccuracy = MovesWidget.format(moveTemplate.accuracy).text()
drawScaledTextJustifiedRight(
context = context,
text = moveAccuracy,
x = posX + 88,
y = posY + 28,
shadow = true,
scale = HALF_SCALE
)
val moveEffect = MovesWidget.format(moveTemplate.effectChances.firstOrNull() ?: 0.0).text()
drawScaledTextJustifiedRight(
context = context,
text = moveEffect,
x = posX + 88,
y = posY + 40,
shadow = true,
scale = HALF_SCALE
)
matrices.pushPose()
matrices.scale(HALF_SCALE, HALF_SCALE, 1F)
MultiLineLabelK.create(
component = moveTemplate.description,
width = 79 / HALF_SCALE,
maxLines = 5
).renderLeftAligned(
context = context,
x = (posX + 8.5) / HALF_SCALE,
y = (posY + 52.5) / HALF_SCALE,
ySpacing = 6 / HALF_SCALE,
colour = ColourLibrary.WHITE,
shadow = true
)
matrices.popPose()
drawScaledText(
context = context,
text = lang("ui.moves.pp", moveTemplate.pp).bold(),
x = posX + 6,
y = posY + 88,
scale = HALF_SCALE,
shadow = true
)
MoveCategoryIcon(x = posX + 78, y = posY + 86, category = moveTemplate.damageCategory).render(context)
matrices.popPose()
}
}
fun renderScreenSaver(context: GuiGraphics) {
val poseStack = context.pose()
// Screen saver
@@ -892,6 +1019,58 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
}
private fun setPartySlotsClickable(clickable: Boolean) {
for (slot in partySlotList) slot.clickable = clickable
}
private fun updateHeldStackMove() {
val heldStack = menu.carried
val heldStackIsTm = heldStack.item == CobblemonItems.TECHNICAL_MACHINE
if (heldStackIsTm) {
// Store move of TM item picked up by player cursor
TMMoveComponent.getTMMove(heldStack)?.let { heldMove ->
if (heldStackMove != heldMove) heldStackMove = heldMove
}
if (::movesScrollingList.isInitialized) {
movesScrollingList.setDisabled(true, TechnicalMachines.moveToTM[heldStackMove])
if (mode == MOVE_SELECT_MODE) {
val heldStackTm = TechnicalMachines.moveToTM[heldStackMove]
setSelectedTM(if (tmList.get().contains(heldStackTm)) heldStackTm else null, false)
// Scroll to move if moves list contains held TM move
if (tmList.get().contains(heldStackTm)) {
val moveListIndex = tmList.get().indexOf(heldStackTm)
movesScrollingList.scrollAmount = (if (moveListIndex == tmList.get().lastIndex) 1.0 else (moveListIndex / tmList.get().size.toDouble()))* movesScrollingList.maxScroll
}
}
}
if (::typesScrollList.isInitialized) {
typesScrollList.setDisabled(true, heldStackMove?.elementalType)
}
updatePartySlotStatus(heldStackMove)
} else if (heldStackMove != null) {
// Reset only if last held item was a TM
heldStackMove = null
// Reset selected move on move select screen
if (mode == MOVE_SELECT_MODE) setSelectedTM(null, false)
updatePartySlotStatus(selectedTM?.moveName)
if (::movesScrollingList.isInitialized) {
movesScrollingList.setDisabled(false)
}
if (::typesScrollList.isInitialized) {
typesScrollList.setDisabled(false)
}
}
setPartySlotsClickable(mode == TYPE_SELECT_MODE || heldStackIsTm)
}
override fun mouseMoved(mouseX: Double, mouseY: Double) {
ticksElapsed = 0
super.mouseMoved(mouseX, mouseY)
@@ -903,9 +1082,9 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
}
override fun slotClicked(slot: Slot?, slotId: Int, mouseButton: Int, type: ClickType) {
super.slotClicked(slot, slotId, mouseButton, type)
if (slot != null && slotId in 0 until Inventory.INVENTORY_SIZE && selectedTM != null) {
setSelectedTM(null, false)
if (slot != null) {
super.slotClicked(slot, slotId, mouseButton, type)
updateHeldStackMove()
}
}
@@ -978,17 +1157,6 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
y = topPos + 1
)
if (mode == MOVE_SELECT_MODE && ::backButton.isInitialized) {
drawScaledText(
context = graphics,
font = CobblemonResources.DEFAULT_LARGE,
text = lang("ui.back").bold(),
x = backButton.x + backButton.width + - 8.0,
y = backButton.y,
shadow = true
)
}
if (mode == TM_BURN_MODE) {
blitk(
matrixStack = matrices,
@@ -1029,6 +1197,8 @@ class TMMachineScreen(containerMenu: TMMachineMenu, val inventory: Inventory, ti
renderMoveInfo(graphics, mouseX, mouseY)
this.renderTooltip(graphics, mouseX, mouseY)
renderHeldMoveInfoTooltip(graphics, mouseX, mouseY)
}
override fun renderBlurredBackground(partialTick: Float) {}
@@ -32,10 +32,10 @@ class TypesScrollingWidget(val pX: Int, val pY: Int, val setType: (ElementalType
slotHeight = SLOT_SIZE + SLOT_SPACING
) {
companion object {
const val WIDTH = 112
const val WIDTH = 113
const val HEIGHT = 100
const val SLOT_SIZE = 22
const val SLOT_SPACING = 5
const val SLOT_SIZE = 24
const val SLOT_SPACING = 3
}
init {
@@ -83,27 +83,36 @@ class TypesScrollingWidget(val pX: Int, val pY: Int, val setType: (ElementalType
}
}
fun setDisabled(disabled: Boolean, vararg exclusions: ElementalType?) {
children().forEach { row ->
row.disabled = disabled
row.disabledExclusions = exclusions.toSet() + null
}
}
class ScrollSlotRow(val types: List<ElementalType?>, val setType : (ElementalType?) -> Unit): Slot<ScrollSlotRow>() {
companion object {
private val allSlotResource = cobblemonResource("textures/gui/tmmachine/type_slot_all.png")
private val allIconResource = cobblemonResource("textures/gui/tmmachine/type_slot_icon_all.png")
private val slotResource = cobblemonResource("textures/gui/tmmachine/type_slot.png")
private val slotDisabledResource = cobblemonResource("textures/gui/tmmachine/type_slot_disabled.png")
}
var x: Int = 0
var y: Int = 0
var disabled: Boolean = false
var disabledExclusions: Set<ElementalType?> = setOf(null)
fun renderRow(context: GuiGraphics, y: Int, x: Int, mouseX: Int, mouseY: Int) {
types.forEachIndexed { index, type ->
val matrices = context.pose()
val startPosX = x + ((SLOT_SPACING + SLOT_SIZE) * index)
val startPosY = y + SLOT_SPACING
val startPosY = y + SLOT_SPACING + 1
val slotHovered = getHoveredSlotIndex(mouseX, mouseY) == index
blitk(
matrixStack = matrices,
texture = if (type != null) slotResource else allSlotResource,
texture = if (disabled && !disabledExclusions.contains(type)) slotDisabledResource else slotResource,
x = startPosX,
y = startPosY,
width = SLOT_SIZE,
@@ -113,7 +122,16 @@ class TypesScrollingWidget(val pX: Int, val pY: Int, val setType: (ElementalType
)
if (type != null) {
TypeIcon(startPosX + 2, startPosY + 2, type).render(context)
TypeIcon(startPosX + 3, startPosY + 3, type).render(context)
} else {
blitk(
matrixStack = matrices,
texture = allIconResource,
x = startPosX + 7,
y = startPosY + 7,
width = 11,
height = 11
)
}
}
}
@@ -121,12 +139,19 @@ class TypesScrollingWidget(val pX: Int, val pY: Int, val setType: (ElementalType
override fun render(context: GuiGraphics, index: Int, y: Int, x: Int, entryWidth: Int, entryHeight: Int, mouseX: Int, mouseY: Int, hovered: Boolean, tickDelta: Float) {}
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
var disable = false
val hoverIndex = getHoveredSlotIndex(mouseX.toInt(), mouseY.toInt())
if (hoverIndex > -1 && hoverIndex < types.size) {
setType.invoke(types[hoverIndex])
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
val type = types[hoverIndex]
disable = disabled && !disabledExclusions.contains(type)
if (!disable) {
setType.invoke(type)
Minecraft.getInstance().soundManager.play(SimpleSoundInstance.forUI(CobblemonSounds.GUI_CLICK, 1.0F))
}
}
return true
return !disable
}
private fun getHoveredSlotIndex(mouseX: Int, mouseY: Int): Int {
@@ -34,6 +34,7 @@ class DisplayCaseRenderer(ctx: BlockEntityRendererProvider.Context) : BlockEntit
val coinPouchStack: ItemStack by lazy { ItemStack(
CobblemonItems.RELIC_COIN_POUCH
).also { it.set(DataComponents.CUSTOM_MODEL_DATA, CustomModelData(1)) } }
override fun render(
entity: DisplayCaseBlockEntity,
tickDelta: Float,
@@ -47,6 +48,7 @@ class DisplayCaseRenderer(ctx: BlockEntityRendererProvider.Context) : BlockEntit
} else {
entity.getStack()
}
val world = entity.level ?: return
val posType = getPositioningType(stack, world)
val blockState = if (entity.level != null) entity.blockState
@@ -167,6 +169,7 @@ class DisplayCaseRenderer(ctx: BlockEntityRendererProvider.Context) : BlockEntit
//stack.item == CobblemonItems.POKEMON_MODEL -> PositioningType.ITEM_MODEL
stack.item == Items.SHIELD -> PositioningType.SHIELD
stack.item == Items.DECORATED_POT -> PositioningType.MOB_HEAD
stack.item == CobblemonItems.DOME_FOSSIL -> PositioningType.DOME_FOSSIL
Minecraft.getInstance().itemRenderer.getModel(stack, world, null, 0).isGui3d -> PositioningType.BLOCK_MODEL
else -> PositioningType.ITEM_MODEL
}
@@ -186,6 +189,7 @@ class DisplayCaseRenderer(ctx: BlockEntityRendererProvider.Context) : BlockEntit
MOB_HEAD(1f, 1f, 1f, 0f, -0.025f, 0f, 180f),
SHIELD(1f, 1f, 1f, 0f, -0.045f, 0f, 180f),
PASTURE(1f, 1f, 1f, 0f, 0.0375f, 0f),
COIN_POUCH(1f, 1f, 1f, 0f, 0.415f, 0f)
COIN_POUCH(1f, 1f, 1f, 0f, 0.415f, 0f),
DOME_FOSSIL(1f, 1f, 1f, 0f, -0.15f, 0f)
}
}
}
@@ -17,7 +17,11 @@ 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 = if (layer == 0) moveType.primaryColor else moveType.secondaryColor
val color = when (layer) {
0 -> moveType.primaryColor
1 -> moveType.secondaryColor
else -> 0xFFFFFF
}
return FastColor.ARGB32.opaque(color)
}
}
}
@@ -34,6 +34,7 @@ import com.cobblemon.mod.common.api.fossil.NaturalMaterials
import com.cobblemon.mod.common.api.interaction.PokemonInteractions
import com.cobblemon.mod.common.api.item.HeldItems
import com.cobblemon.mod.common.api.mark.Marks
import com.cobblemon.mod.common.api.modification.ModificationVariants
import com.cobblemon.mod.common.api.moves.Moves
import com.cobblemon.mod.common.api.moves.animations.ActionEffects
import com.cobblemon.mod.common.api.npc.NPCClasses
@@ -119,6 +120,7 @@ object CobblemonDataProvider : DataProvider {
this.register(SpawnBaitEffects, reloadable = false)
this.register(CobblemonRideSettings, reloadable = true)
this.register(TechnicalMachines, reloadable = false)
this.register(ModificationVariants, reloadable = true)
SpawnBait.Effects.setupEffects()
PlatformEvents.SERVER_PLAYER_LOGOUT.subscribe {
@@ -1,63 +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.item
import com.cobblemon.mod.common.block.TypeGemBlock
import com.cobblemon.mod.common.block.TypeGemClusterBlock
import com.cobblemon.mod.common.block.TypeGemCoreBlock
import net.minecraft.world.InteractionResult
import net.minecraft.world.item.Item
import net.minecraft.world.item.context.UseOnContext
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.DirectionalBlock
class TypeGemItem(
private val clusterBlock: Block,
properties: Properties
) : Item(properties) {
override fun useOn(context: UseOnContext): InteractionResult {
val level = context.level
val clickedPos = context.clickedPos
val clickedState = level.getBlockState(clickedPos)
val placePos = clickedPos.relative(context.clickedFace)
// Only place the cluster on TypeGemCore or TypeGemBlock
if (level.isEmptyBlock(placePos) || level.getBlockState(placePos).canBeReplaced()) {
val placePos = clickedPos.relative(context.clickedFace)
if (level.isEmptyBlock(placePos) || level.getBlockState(placePos).canBeReplaced()) {
val player = context.player
val itemInHand = context.itemInHand
if (!level.isClientSide) {
val facing = context.clickedFace
val shouldGrow = clickedState.block is TypeGemCoreBlock
val state = clusterBlock.defaultBlockState()
.setValue(DirectionalBlock.FACING, facing)
.setValue(TypeGemClusterBlock.STAGE, 0)
.setValue(TypeGemClusterBlock.SHOULD_GROW, shouldGrow)
level.setBlock(placePos, state, 3)
if (player == null || !player.isCreative) {
itemInHand.shrink(1)
}
}
return InteractionResult.sidedSuccess(level.isClientSide)
}
}
return InteractionResult.PASS
}
}
@@ -0,0 +1,26 @@
/*
* 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.item.components
import com.mojang.serialization.Codec
import io.netty.buffer.ByteBuf
import net.minecraft.network.codec.ByteBufCodecs
import net.minecraft.network.codec.StreamCodec
import net.minecraft.resources.ResourceLocation
data class ModificationVariantComponent(val variant: ResourceLocation) {
companion object {
val CODEC: Codec<ModificationVariantComponent> = ResourceLocation.CODEC.xmap(
::ModificationVariantComponent,
ModificationVariantComponent::variant
)
val PACKET_CODEC: StreamCodec<ByteBuf, ModificationVariantComponent> = ByteBufCodecs.fromCodec(CODEC)
}
}
@@ -251,6 +251,7 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.HEALING_MACHINE)
entries.accept(CobblemonItems.PASTURE)
entries.accept(CobblemonItems.TM_MACHINE)
entries.accept(CobblemonItems.MODIFICATION_STATION)
entries.accept(CobblemonItems.GILDED_CHEST)
entries.accept(CobblemonItems.YELLOW_GILDED_CHEST)
@@ -0,0 +1,90 @@
/*
* 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.modification_station
import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.block.DisplayCaseBlock
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.material.MapColor
import net.minecraft.world.level.material.PushReaction
object DisplayCaseVariantBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<Block>>, Block>(),
ModificationVariantBlockRegistrar {
override val registry: Registry<Block> = BuiltInRegistries.BLOCK
override val resourceKey: ResourceKey<Registry<Block>> = Registries.BLOCK
private val blocksByIdentifier = linkedMapOf<ResourceLocation, DisplayCaseBlock>()
private val identifiersByBlock = hashMapOf<Block, ResourceLocation>()
private val tintedBlocks = mutableListOf<Block>()
private val nonTintedBlocks = mutableListOf<Block>()
init {
displayCaseVariantPaths().forEach { path ->
registerDisplayCaseVariant(path)
}
}
override fun registerAll(consumer: (ResourceLocation, Block) -> Unit) {
register(consumer)
}
override fun allBlocks(): Collection<Block> = blocksByIdentifier.values
override fun allEntries(): Map<ResourceLocation, Block> = blocksByIdentifier.toMap()
override fun variantIdentifier(block: Block): ResourceLocation? = identifiersByBlock[block]
fun tintedVariantBlocks(): Collection<Block> = tintedBlocks
fun nonTintedVariantBlocks(): Collection<Block> = nonTintedBlocks
private fun registerDisplayCaseVariant(path: String): DisplayCaseBlock {
val identifier = cobblemonResource(path)
val block = create(
identifier,
DisplayCaseBlock(
BlockBehaviour.Properties.of()
.sound(CobblemonSounds.DISPLAY_CASE_SOUNDS)
.noOcclusion()
.pushReaction(PushReaction.BLOCK)
.mapColor(MapColor.STONE)
.strength(0.3F)
.requiresCorrectToolForDrops()
)
)
blocksByIdentifier[identifier] = block
identifiersByBlock[block] = identifier
if (path.contains("_tinted_glass_")) {
tintedBlocks.add(block)
} else {
nonTintedBlocks.add(block)
}
return block
}
private fun displayCaseVariantPaths(): List<String> {
val paths = mutableListOf("display_case_default")
for (index in 1..16) {
paths.add("display_case_stone_glass_color_$index")
paths.add("display_case_stone_no_glass_color_$index")
paths.add("display_case_stone_tinted_glass_color_$index")
}
return paths
}
}
@@ -0,0 +1,77 @@
/*
* 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.modification_station
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.BlockPos
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.material.MapColor
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
object DomeFossilVariantBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<Block>>, Block>(),
ModificationVariantBlockRegistrar {
override val registry: Registry<Block> = BuiltInRegistries.BLOCK
override val resourceKey: ResourceKey<Registry<Block>> = Registries.BLOCK
private val blocksByIdentifier = linkedMapOf<ResourceLocation, Block>()
private val identifiersByBlock = hashMapOf<Block, ResourceLocation>()
init {
registerVariant("dome_fossil_block_1", Shapes.box(4.0 / 16.0, 0.0, 3.0 / 16.0, 12.0 / 16.0, 2.75 / 16.0, 13.0 / 16.0))
registerVariant("dome_fossil_block_2", Shapes.box(0.0, 0.0, 0.0, 1.0, 5.75 / 16.0, 1.0))
}
override fun registerAll(consumer: (ResourceLocation, Block) -> Unit) {
register(consumer)
}
override fun allBlocks(): Collection<Block> = blocksByIdentifier.values
override fun allEntries(): Map<ResourceLocation, Block> = blocksByIdentifier.toMap()
override fun variantIdentifier(block: Block): ResourceLocation? = identifiersByBlock[block]
private fun registerVariant(path: String, shape: VoxelShape): Block {
val identifier = cobblemonResource(path)
val block = create(
identifier,
DomeFossilVariantBlock(
BlockBehaviour.Properties.of()
.mapColor(MapColor.STONE)
.strength(0.8F)
.noOcclusion(),
shape
)
)
blocksByIdentifier[identifier] = block
identifiersByBlock[block] = identifier
return block
}
}
private class DomeFossilVariantBlock(
properties: BlockBehaviour.Properties,
private val shape: VoxelShape
) : Block(properties) {
override fun getShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape = shape
override fun getCollisionShape(state: BlockState, level: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape = shape
}
@@ -0,0 +1,19 @@
/*
* 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.modification_station
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.block.Block
interface ModificationVariantBlockRegistrar {
fun registerAll(consumer: (ResourceLocation, Block) -> Unit)
fun allBlocks(): Collection<Block>
fun allEntries(): Map<ResourceLocation, Block>
fun variantIdentifier(block: Block): ResourceLocation?
}
@@ -0,0 +1,194 @@
/*
* 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.modification_station
import com.cobblemon.mod.common.block.PCBlock
import com.cobblemon.mod.common.platform.PlatformRegistry
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.core.BlockPos
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.LevelAccessor
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.HorizontalDirectionalBlock
import net.minecraft.world.level.block.SoundType
import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.BlockStateProperties.WATERLOGGED
import net.minecraft.world.level.material.Fluids
import net.minecraft.world.level.material.MapColor
import net.minecraft.world.level.material.PushReaction
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
object PCVariantBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<Block>>, Block>(),
ModificationVariantBlockRegistrar {
override val registry: Registry<Block> = BuiltInRegistries.BLOCK
override val resourceKey: ResourceKey<Registry<Block>> = Registries.BLOCK
private val blocksByIdentifier = linkedMapOf<ResourceLocation, PCBlock>()
private val identifiersByBlock = hashMapOf<Block, ResourceLocation>()
init {
registerSingleBlockPCVariant("pc_hgss")
registerSingleBlockPCVariant("pc_sm")
registerDoubleBlockPCVariant("pc_xd")
registerDoubleBlockPCVariant("pc_bw")
registerDoubleBlockPCVariant("pc_dppt")
registerDoubleBlockPCVariant("pc_swsh")
registerOrasPCVariant("pc_oras")
}
override fun registerAll(consumer: (ResourceLocation, Block) -> Unit) {
register(consumer)
}
override fun allBlocks(): Collection<Block> = blocksByIdentifier.values
override fun allEntries(): Map<ResourceLocation, Block> = blocksByIdentifier.toMap()
override fun variantIdentifier(block: Block): ResourceLocation? = identifiersByBlock[block]
private fun registerSingleBlockPCVariant(path: String): PCBlock {
val identifier = cobblemonResource(path)
val block = create(
identifier,
SingleBlockPCVariantBlock(
BlockBehaviour.Properties.of()
.mapColor(MapColor.METAL)
.sound(SoundType.METAL)
.pushReaction(PushReaction.BLOCK)
.strength(2F)
.noOcclusion()
.lightLevel {
if (it.getValue(PCBlock.ON)) 13 else 0
}
)
)
blocksByIdentifier[identifier] = block
identifiersByBlock[block] = identifier
return block
}
private fun registerDoubleBlockPCVariant(path: String): PCBlock {
val identifier = cobblemonResource(path)
val block = create(
identifier,
PCBlock(
BlockBehaviour.Properties.of()
.mapColor(MapColor.METAL)
.sound(SoundType.METAL)
.pushReaction(PushReaction.BLOCK)
.strength(2F)
.noOcclusion()
.lightLevel {
if (it.getValue(PCBlock.ON) && it.getValue(PCBlock.PART) == PCBlock.PCPart.TOP) 13 else 0
}
)
)
blocksByIdentifier[identifier] = block
identifiersByBlock[block] = identifier
return block
}
private fun registerOrasPCVariant(path: String): PCBlock {
val identifier = cobblemonResource(path)
val block = create(
identifier,
OrasPCVariantBlock(
BlockBehaviour.Properties.of()
.mapColor(MapColor.METAL)
.sound(SoundType.METAL)
.pushReaction(PushReaction.BLOCK)
.strength(2F)
.noOcclusion()
.lightLevel {
if (it.getValue(PCBlock.ON) && it.getValue(PCBlock.PART) == PCBlock.PCPart.TOP) 13 else 0
}
)
)
blocksByIdentifier[identifier] = block
identifiersByBlock[block] = identifier
return block
}
}
private class SingleBlockPCVariantBlock(properties: BlockBehaviour.Properties) : PCBlock(properties) {
override fun getStateForPlacement(blockPlaceContext: BlockPlaceContext): BlockState {
return defaultBlockState()
.setValue(HorizontalDirectionalBlock.FACING, blockPlaceContext.horizontalDirection)
.setValue(PART, PCPart.BOTTOM)
.setValue(WATERLOGGED, blockPlaceContext.level.getFluidState(blockPlaceContext.clickedPos).type == Fluids.WATER)
}
override fun setPlacedBy(
world: Level,
pos: BlockPos,
state: BlockState,
placer: LivingEntity?,
itemStack: ItemStack
) {
// Intentionally single-block: do not place a top half.
}
override fun getPositionOfOtherPart(state: BlockState, pos: BlockPos): BlockPos = pos
override fun updateShape(
state: BlockState,
direction: net.minecraft.core.Direction,
neighborState: BlockState,
world: LevelAccessor,
pos: BlockPos,
neighborPos: BlockPos
): BlockState {
if (state.getValue(WATERLOGGED)) {
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world))
}
return if (state.getValue(PART) == PCPart.TOP) Blocks.AIR.defaultBlockState() else state
}
}
private class OrasPCVariantBlock(properties: BlockBehaviour.Properties) : PCBlock(properties) {
companion object {
private val ORAS_TOP_SECTION_SHAPE = Shapes.box(0.0, 0.5, 0.0, 1.0, 1.0, 1.0)
}
override fun getShape(
blockState: BlockState,
blockGetter: BlockGetter,
blockPos: BlockPos,
collisionContext: CollisionContext
): VoxelShape {
return if (blockState.getValue(PART) == PCPart.TOP) Shapes.empty() else ORAS_TOP_SECTION_SHAPE
}
override fun getCollisionShape(
blockState: BlockState,
blockGetter: BlockGetter,
blockPos: BlockPos,
collisionContext: CollisionContext
): VoxelShape {
return if (blockState.getValue(PART) == PCPart.TOP) Shapes.empty() else ORAS_TOP_SECTION_SHAPE
}
}
@@ -0,0 +1,40 @@
/*
* 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.net.messages.client.data
import com.cobblemon.mod.common.api.modification.ModificationVariant
import com.cobblemon.mod.common.api.modification.ModificationVariants
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.network.RegistryFriendlyByteBuf
class ModificationVariantRegistrySyncPacket(variants: Collection<ModificationVariant>) :
DataRegistrySyncPacket<ModificationVariant, ModificationVariantRegistrySyncPacket>(variants) {
companion object {
val ID = cobblemonResource("modification_variant_registry_sync")
fun decode(buffer: RegistryFriendlyByteBuf): ModificationVariantRegistrySyncPacket {
return ModificationVariantRegistrySyncPacket(emptyList()).apply { decodeBuffer(buffer) }
}
}
override val id = ID
override fun encodeEntry(buffer: RegistryFriendlyByteBuf, entry: ModificationVariant) {
buffer.writeUtf(ModificationVariants.gson.toJson(entry))
}
override fun decodeEntry(buffer: RegistryFriendlyByteBuf): ModificationVariant {
return ModificationVariants.gson.fromJson(buffer.readUtf(), ModificationVariant::class.java)
}
override fun synchronizeDecoded(entries: Collection<ModificationVariant>) {
ModificationVariants.reloadEntries(entries)
}
}
@@ -22,6 +22,9 @@ object CobblemonProcessorTypes {
@JvmField
val RANDOM_POOLED_STATES = register("random_pooled_states", RandomizedStructureMappedBlockStatePairProcessor.CODEC)
@JvmField
val HEIGHT_RANGE = register("height_range", HeightRangeStructureProcessor.CODEC)
fun <T : StructureProcessor> register(id: String, codec: MapCodec<T>): StructureProcessorType<T> {
return Registry.register(registry, cobblemonResource(id), StructureProcessorType { codec })
}
@@ -0,0 +1,85 @@
/*
* 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.world.structureprocessors
import com.mojang.serialization.Codec
import com.mojang.serialization.MapCodec
import com.mojang.serialization.codecs.RecordCodecBuilder
import net.minecraft.core.BlockPos
import net.minecraft.world.level.LevelReader
import net.minecraft.world.level.levelgen.Heightmap
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate
class HeightRangeStructureProcessor(
val minOffset: Int,
val maxOffset: Int,
val reference: HeightReference = HeightReference.SEA_LEVEL
) : StructureProcessor() {
override fun processBlock(
world: LevelReader,
pos: BlockPos,
pivot: BlockPos,
originalBlockInfo: StructureTemplate.StructureBlockInfo,
currentBlockInfo: StructureTemplate.StructureBlockInfo,
data: StructurePlaceSettings
): StructureTemplate.StructureBlockInfo? {
val referenceY = reference.getY(world, pos)
val minY = referenceY + minOffset
val maxY = referenceY + maxOffset
return if (pos.y in minY..maxY) {
currentBlockInfo
} else {
null
}
}
override fun getType() = CobblemonProcessorTypes.HEIGHT_RANGE
enum class HeightReference(private val id: String, private val type: Heightmap.Types?) {
SEA_LEVEL("sea_level", null),
WORLD_SURFACE("world_surface", Heightmap.Types.WORLD_SURFACE),
WORLD_SURFACE_WG("world_surface_wg", Heightmap.Types.WORLD_SURFACE_WG),
OCEAN_FLOOR("ocean_floor", Heightmap.Types.OCEAN_FLOOR),
OCEAN_FLOOR_WG("ocean_floor_wg", Heightmap.Types.OCEAN_FLOOR_WG),
MOTION_BLOCKING("motion_blocking", Heightmap.Types.MOTION_BLOCKING),
MOTION_BLOCKING_NO_LEAVES("motion_blocking_no_leaves", Heightmap.Types.MOTION_BLOCKING_NO_LEAVES);
fun getSerializedName(): String = id
@Suppress("DEPRECATION")
fun getY(world: LevelReader, pos: BlockPos): Int {
return if (this == SEA_LEVEL) {
world.seaLevel
} else {
world.getHeight(type ?: Heightmap.Types.WORLD_SURFACE_WG, pos.x, pos.z)
}
}
companion object {
val CODEC: Codec<HeightReference> = Codec.STRING.xmap(
{ serialized -> entries.firstOrNull { it.id == serialized } ?: SEA_LEVEL },
HeightReference::getSerializedName
)
}
}
companion object {
val CODEC: MapCodec<HeightRangeStructureProcessor> = RecordCodecBuilder.mapCodec { instance ->
instance.group(
Codec.INT.fieldOf("min_offset").forGetter { it.minOffset },
Codec.INT.fieldOf("max_offset").forGetter { it.maxOffset },
HeightReference.CODEC.optionalFieldOf("reference", HeightReference.SEA_LEVEL).forGetter { it.reference }
).apply(instance, ::HeightRangeStructureProcessor)
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/display_case"
},
"facing=west": {
"model": "cobblemon:block/display_case",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/display_case",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/display_case",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_1"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_1",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_1",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_1",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_10"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_10",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_10",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_10",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_11"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_11",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_11",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_11",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_12"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_12",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_12",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_12",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_13"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_13",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_13",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_13",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_14"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_14",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_14",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_14",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_15"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_15",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_15",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_15",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_16"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_16",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_16",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_16",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_2"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_2",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_2",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_2",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_3"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_3",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_3",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_3",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_4"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_4",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_4",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_4",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_5"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_5",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_5",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_5",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_6"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_6",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_6",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_6",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_7"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_7",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_7",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_7",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_8"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_8",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_8",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_8",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_9"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_9",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_9",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_glass_color_9",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_1"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_1",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_1",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_1",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_10"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_10",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_10",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_10",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_11"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_11",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_11",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_11",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_12"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_12",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_12",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_12",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_13"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_13",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_13",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_13",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_14"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_14",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_14",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_14",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_15"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_15",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_15",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_15",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_16"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_16",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_16",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_16",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_2"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_2",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_2",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_2",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_3"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_3",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_3",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_3",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_4"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_4",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_4",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_4",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_5"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_5",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_5",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_5",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_6"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_6",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_6",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_6",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_7"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_7",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_7",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_7",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_8"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_8",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_8",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_8",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_9"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_9",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_9",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_no_glass_color_9",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_1"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_1",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_1",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_1",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_10"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_10",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_10",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_10",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_11"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_11",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_11",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_11",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_12"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_12",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_12",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_12",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_13"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_13",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_13",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_13",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_14"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_14",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_14",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_14",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_15"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_15",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_15",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_15",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_16"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_16",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_16",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_16",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_2"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_2",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_2",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_2",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_3"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_3",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_3",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_3",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_4"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_4",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_4",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_4",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_5"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_5",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_5",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_5",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_6"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_6",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_6",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_6",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_7"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_7",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_7",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_7",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_8"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_8",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_8",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_8",
"y": 270
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_9"
},
"facing=west": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_9",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_9",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/mod_station/display_case/display_case_stone_tinted_glass_color_9",
"y": 270
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "cobblemon:block/mod_station/dome_fossil/dome_fossil_block_1"
}
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "cobblemon:block/mod_station/dome_fossil/dome_fossil_block_2"
}
}
}
@@ -0,0 +1,19 @@
{
"variants": {
"facing=south": {
"model": "cobblemon:block/modification_station"
},
"facing=west": {
"model": "cobblemon:block/modification_station",
"y": 90
},
"facing=north": {
"model": "cobblemon:block/modification_station",
"y": 180
},
"facing=east": {
"model": "cobblemon:block/modification_station",
"y": 270
}
}
}
Loaded 100 of 1876 files, more files were not shown because too many files have changed in this diff. Show more