Refactor Stadium Terminal (Block) to be Stadium Block

This commit is contained in:
Gertimoshka
2025-04-30 08:38:04 +03:00
parent 902f602354
commit 28e59f8bf9
16 changed files with 34 additions and 20 deletions
@@ -38,7 +38,7 @@ object CobblemonBlockEntities : PlatformRegistry<Registry<BlockEntityType<*>>, R
val PC: BlockEntityType<PCBlockEntity> = this.create("pc", BlockEntityType.Builder.of(::PCBlockEntity, CobblemonBlocks.PC).build(null))
@JvmField
val STADIUM: BlockEntityType<StadiumBlockEntity> = this.create("stadium_terminal", BlockEntityType.Builder.of(::StadiumBlockEntity, CobblemonBlocks.STADIUM).build(null))
val STADIUM: BlockEntityType<StadiumBlockEntity> = this.create("stadium_block", BlockEntityType.Builder.of(::StadiumBlockEntity, CobblemonBlocks.STADIUM_BLOCK).build(null))
@JvmField
val LECTERN: BlockEntityType<LecternBlockEntity> = this.create("lectern", BlockEntityType.Builder.of(::LecternBlockEntity, CobblemonBlocks.LECTERN).build(null))
@@ -483,7 +483,7 @@ object CobblemonBlocks : PlatformRegistry<Registry<Block>, ResourceKey<Registry<
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)) 10 else 0 }))
@JvmField
val STADIUM = create("stadium_terminal", StadiumBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2F)))
val STADIUM_BLOCK = create("stadium_block", StadiumBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).strength(2F)))
@JvmField
val LECTERN = create("lectern", LecternBlock(BlockBehaviour.Properties.of().mapColor(MapColor.WOOD).instrument(NoteBlockInstrument.BASS).sound(SoundType.WOOD).strength(2.5F).ignitedByLava()))
@@ -619,7 +619,7 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
@JvmField
val PC = blockItem("pc", CobblemonBlocks.PC)
@JvmField
val STADIUM = blockItem("stadium_terminal", CobblemonBlocks.STADIUM)
val STADIUM_BLOCK = blockItem("stadium_block", CobblemonBlocks.STADIUM_BLOCK)
@JvmField
val PASTURE = blockItem("pasture", CobblemonBlocks.PASTURE)
@JvmField
@@ -39,6 +39,10 @@ object CobblemonPoiTypes: PlatformRegistry<Registry<PoiType>, ResourceKey<Regist
val INCENSE_SWEET_KEY: ResourceKey<PoiType> = createKey("saccharine_honey_log")
@JvmField
val INCENSE_SWEET = create(INCENSE_SWEET_KEY.location().path, PoiType(getBlockStates(CobblemonBlocks.INCENSE_SWEET), 0, 1))
@JvmField
val STADIUM_BLOCK_KEY: ResourceKey<PoiType> = createKey("stadium_block")
@JvmField
val STADIUM_BLOCK = create(STADIUM_BLOCK_KEY.location().path, PoiType(getBlockStates(CobblemonBlocks.STADIUM_BLOCK), 0, 1))
private fun createKey(string: String): ResourceKey<PoiType> = ResourceKey.create(Registries.POINT_OF_INTEREST_TYPE, cobblemonResource(string))
@@ -31,8 +31,8 @@ class StadiumBlockEntity(
var battleDefenition = StadiumSingleBattle()
fun addPlayer(player: ServerPlayer) {
battleDefenition.addPlayer(player)
if (battleDefenition.readyForBattle()) battleDefenition.initializeBattle()
//battleDefenition.addPlayer(player)
//if (battleDefenition.readyForBattle()) battleDefenition.initializeBattle()
}
/*
@@ -258,7 +258,7 @@ object CobblemonClient {
CobblemonBlocks.GIMMIGHOUL_CHEST,
CobblemonBlocks.DISPLAY_CASE,
CobblemonBlocks.LECTERN,
CobblemonBlocks.STADIUM,
CobblemonBlocks.STADIUM_BLOCK,
CobblemonBlocks.SACCHARINE_DOOR,
CobblemonBlocks.SACCHARINE_TRAPDOOR,
CobblemonBlocks.SACCHARINE_SIGN,
@@ -242,7 +242,7 @@ object CobblemonItemGroups {
entries.accept(CobblemonItems.PC)
entries.accept(CobblemonItems.HEALING_MACHINE)
entries.accept(CobblemonItems.PASTURE)
entries.accept(CobblemonItems.STADIUM)
entries.accept(CobblemonItems.STADIUM_BLOCK)
entries.accept(CobblemonItems.GILDED_CHEST)
entries.accept(CobblemonItems.YELLOW_GILDED_CHEST)
@@ -10,6 +10,15 @@ import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.phys.Vec3
class StadiumSingleBattle: StadiumBattleDefenition() {
override fun playerPositions(): MutableList<Pair<Int, Vec3>> {
return mutableListOf()
}
override fun pokemonPositions(): MutableList<Pair<Int, Vec3>> {
return mutableListOf()
}
/*
@JvmField
val MAX_PLAYERS = 2
@@ -60,4 +69,5 @@ class StadiumSingleBattle: StadiumBattleDefenition() {
override fun getCurrentCamera(): BattleCameraEntry {
TODO("Not yet implemented")
}
*/
}
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "cobblemon:block/stadium_block"
}
}
}
@@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "cobblemon:block/stadium_terminal"
}
}
}
@@ -850,7 +850,7 @@
"block.cobblemon.healing_machine.tooltip2": "Charges over time.",
"block.cobblemon.pc": "PC",
"block.cobblemon.lectern": "Lectern",
"block.cobblemon.stadium_terminal": "Stadium Terminal",
"block.cobblemon.stadium_block": "Stadium Block",
"block.cobblemon.restoration_tank": "Restoration Tank",
"block.cobblemon.fossil_analyzer": "Fossil Analyzer",
"block.cobblemon.monitor": "Data Monitor",
@@ -1,6 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "cobblemon:block/stadium_terminal"
"all": "cobblemon:block/stadium_block"
}
}
@@ -0,0 +1,3 @@
{
"parent": "cobblemon:block/stadium_block"
}
@@ -1,3 +0,0 @@
{
"parent": "cobblemon:block/stadium_terminal"
}
@@ -4,7 +4,7 @@
"rolls": 1,
"entries": [{
"type": "minecraft:item",
"name": "cobblemon:stadium_terminal"
"name": "cobblemon:stadium_block"
}],
"conditions": [{
"condition": "minecraft:survives_explosion"