diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BannerBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BannerBlockEntity.kt new file mode 100644 index 000000000..b6b8917d3 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BannerBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class BannerBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:banner") + + override fun build(connection: PlayConnection): BannerBlockEntity { + return BannerBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BarrelBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BarrelBlockEntity.kt new file mode 100644 index 000000000..55dd3b5b7 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BarrelBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class BarrelBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:barrel") + + override fun build(connection: PlayConnection): BarrelBlockEntity { + return BarrelBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BeaconBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BeaconBlockEntity.kt new file mode 100644 index 000000000..43ed5fd44 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BeaconBlockEntity.kt @@ -0,0 +1,33 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection +import de.bixilon.minosoft.util.nbt.tag.CompoundTag + +class BeaconBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + override fun updateNBT(nbt: CompoundTag) { + // ToDO: {Secondary: -1, Paper.Range: -1.0D, Primary: -1, x: -90, y: 4, Levels: 0, z: 212, id: "minecraft:beacon"} + } + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:beacon") + + override fun build(connection: PlayConnection): BeaconBlockEntity { + return BeaconBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BeehiveBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BeehiveBlockEntity.kt new file mode 100644 index 000000000..4c2a6571c --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BeehiveBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class BeehiveBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:beehive") + + override fun build(connection: PlayConnection): BeehiveBlockEntity { + return BeehiveBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BellBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BellBlockEntity.kt new file mode 100644 index 000000000..ffdfeb359 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BellBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class BellBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:bell") + + override fun build(connection: PlayConnection): BellBlockEntity { + return BellBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BlastBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BlastFurnaceBlockEntity.kt similarity index 74% rename from src/main/java/de/bixilon/minosoft/data/entities/block/BlastBlockEntity.kt rename to src/main/java/de/bixilon/minosoft/data/entities/block/BlastFurnaceBlockEntity.kt index 240d17716..c5f4c7695 100644 --- a/src/main/java/de/bixilon/minosoft/data/entities/block/BlastBlockEntity.kt +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BlastFurnaceBlockEntity.kt @@ -15,20 +15,14 @@ package de.bixilon.minosoft.data.entities.block import de.bixilon.minosoft.data.mappings.ResourceLocation import de.bixilon.minosoft.protocol.network.connection.PlayConnection -import de.bixilon.minosoft.util.nbt.tag.CompoundTag -class BlastBlockEntity(connection: PlayConnection) : BlockEntity(connection) { +class BlastFurnaceBlockEntity(connection: PlayConnection) : BlockEntity(connection) { - - override fun updateNBT(nbt: CompoundTag) { - - } - - companion object : BlockEntityFactory { + companion object : BlockEntityFactory { override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:blast_furnace") - override fun build(connection: PlayConnection): BlastBlockEntity { - return BlastBlockEntity(connection) + override fun build(connection: PlayConnection): BlastFurnaceBlockEntity { + return BlastFurnaceBlockEntity(connection) } } } diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BlockEntity.kt index cd91f6948..2f5f3171a 100644 --- a/src/main/java/de/bixilon/minosoft/data/entities/block/BlockEntity.kt +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BlockEntity.kt @@ -20,5 +20,5 @@ abstract class BlockEntity( val connection: PlayConnection, ) { - abstract fun updateNBT(nbt: CompoundTag) + open fun updateNBT(nbt: CompoundTag) {} } diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/BrewingStandBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/BrewingStandBlockEntity.kt new file mode 100644 index 000000000..7b7fe4843 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/BrewingStandBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class BrewingStandBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:brewing_stand") + + override fun build(connection: PlayConnection): BrewingStandBlockEntity { + return BrewingStandBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/ChestBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/ChestBlockEntity.kt new file mode 100644 index 000000000..ebd467134 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/ChestBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class ChestBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:chest") + + override fun build(connection: PlayConnection): ChestBlockEntity { + return ChestBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/CommandBlockBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/CommandBlockBlockEntity.kt new file mode 100644 index 000000000..6d94abd84 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/CommandBlockBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class CommandBlockBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:command_block") + + override fun build(connection: PlayConnection): CommandBlockBlockEntity { + return CommandBlockBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/ComparatorBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/ComparatorBlockEntity.kt new file mode 100644 index 000000000..920cb019d --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/ComparatorBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class ComparatorBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:comparator") + + override fun build(connection: PlayConnection): ComparatorBlockEntity { + return ComparatorBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/ConduitBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/ConduitBlockEntity.kt new file mode 100644 index 000000000..a7e0aee46 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/ConduitBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class ConduitBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:conduit") + + override fun build(connection: PlayConnection): ConduitBlockEntity { + return ConduitBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/DaylightDetectorBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/DaylightDetectorBlockEntity.kt new file mode 100644 index 000000000..018071e5d --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/DaylightDetectorBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class DaylightDetectorBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:daylight_detector") + + override fun build(connection: PlayConnection): DaylightDetectorBlockEntity { + return DaylightDetectorBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/DefaultBlockEntityMetaDataFactory.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/DefaultBlockEntityMetaDataFactory.kt index 520c3981b..01a9efedc 100644 --- a/src/main/java/de/bixilon/minosoft/data/entities/block/DefaultBlockEntityMetaDataFactory.kt +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/DefaultBlockEntityMetaDataFactory.kt @@ -25,9 +25,33 @@ object DefaultBlockEntityMetaDataFactory { BedBlockEntity, HopperBlockEntity, SignBlockEntity, - BlastBlockEntity, + BlastFurnaceBlockEntity, FurnaceBlockEntity, CampfireBlockEntity, + JigsawBlockEntity, + LecternBlockEntity, + BellBlockEntity, + SmokerBlockEntity, + ConduitBlockEntity, + BarrelBlockEntity, + ShulkerBoxBlockEntity, + StructureBlockBlockEntity, + CommandBlockBlockEntity, + ComparatorBlockEntity, + BannerBlockEntity, + DaylightDetectorBlockEntity, + BeaconBlockEntity, + SkullBlockEntity, + EnchantingTableBlockEntity, + BrewingStandBlockEntity, + MobSpawnerBlockEntity, + DispenserBlockEntity, + DropperBlockEntity, + EnderChestBlockEntity, + JukeboxBlockEntity, + ChestBlockEntity, + TrappedChestBlockEntity, + BeehiveBlockEntity, ) val ret: MutableMap> = mutableMapOf() diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/DispenserBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/DispenserBlockEntity.kt new file mode 100644 index 000000000..867e3f4c8 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/DispenserBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class DispenserBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:dispenser") + + override fun build(connection: PlayConnection): DispenserBlockEntity { + return DispenserBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/DropperBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/DropperBlockEntity.kt new file mode 100644 index 000000000..ddda8a645 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/DropperBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class DropperBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:dropper") + + override fun build(connection: PlayConnection): DropperBlockEntity { + return DropperBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/EnchantingTableBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/EnchantingTableBlockEntity.kt new file mode 100644 index 000000000..e152fac63 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/EnchantingTableBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class EnchantingTableBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:enchanting_table") + + override fun build(connection: PlayConnection): EnchantingTableBlockEntity { + return EnchantingTableBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/EnderChestBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/EnderChestBlockEntity.kt new file mode 100644 index 000000000..da7406def --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/EnderChestBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class EnderChestBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:ender_chest") + + override fun build(connection: PlayConnection): EnderChestBlockEntity { + return EnderChestBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/FurnaceBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/FurnaceBlockEntity.kt index 80d6066bc..48b7a74d8 100644 --- a/src/main/java/de/bixilon/minosoft/data/entities/block/FurnaceBlockEntity.kt +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/FurnaceBlockEntity.kt @@ -15,15 +15,9 @@ package de.bixilon.minosoft.data.entities.block import de.bixilon.minosoft.data.mappings.ResourceLocation import de.bixilon.minosoft.protocol.network.connection.PlayConnection -import de.bixilon.minosoft.util.nbt.tag.CompoundTag class FurnaceBlockEntity(connection: PlayConnection) : BlockEntity(connection) { - - override fun updateNBT(nbt: CompoundTag) { - - } - companion object : BlockEntityFactory { override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:furnace") diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/HopperBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/HopperBlockEntity.kt index 65207149a..86dfae9fe 100644 --- a/src/main/java/de/bixilon/minosoft/data/entities/block/HopperBlockEntity.kt +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/HopperBlockEntity.kt @@ -15,15 +15,10 @@ package de.bixilon.minosoft.data.entities.block import de.bixilon.minosoft.data.mappings.ResourceLocation import de.bixilon.minosoft.protocol.network.connection.PlayConnection -import de.bixilon.minosoft.util.nbt.tag.CompoundTag class HopperBlockEntity(connection: PlayConnection) : BlockEntity(connection) { - override fun updateNBT(nbt: CompoundTag) { - - } - companion object : BlockEntityFactory { override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:hopper") diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/JigsawBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/JigsawBlockEntity.kt new file mode 100644 index 000000000..625812b88 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/JigsawBlockEntity.kt @@ -0,0 +1,48 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection +import de.bixilon.minosoft.util.nbt.tag.CompoundTag + +class JigsawBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + var joint: String = "rollable" + private set + var name: ResourceLocation = ResourceLocation("minecraft:empty") + private set + var pool: ResourceLocation = ResourceLocation("minecraft:empty") + private set + var finalState: ResourceLocation = ResourceLocation("minecraft:empty") + private set + var target: ResourceLocation = ResourceLocation("minecraft:empty") + private set + + + override fun updateNBT(nbt: CompoundTag) { + nbt.getStringTag("joint")?.value?.let { joint = it } + nbt.getStringTag("name")?.value?.let { name = ResourceLocation.getPathResourceLocation(it) } + nbt.getStringTag("pool")?.value?.let { pool = ResourceLocation.getPathResourceLocation(it) } + nbt.getStringTag("finalState")?.value?.let { finalState = ResourceLocation.getPathResourceLocation(it) } + nbt.getStringTag("target")?.value?.let { target = ResourceLocation.getPathResourceLocation(it) } + } + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:jigsaw") + + override fun build(connection: PlayConnection): JigsawBlockEntity { + return JigsawBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/JukeboxBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/JukeboxBlockEntity.kt new file mode 100644 index 000000000..59f580fc7 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/JukeboxBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class JukeboxBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:jukebox") + + override fun build(connection: PlayConnection): JukeboxBlockEntity { + return JukeboxBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/LecternBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/LecternBlockEntity.kt new file mode 100644 index 000000000..838e5e78b --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/LecternBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class LecternBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:lectern") + + override fun build(connection: PlayConnection): LecternBlockEntity { + return LecternBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/MobSpawnerBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/MobSpawnerBlockEntity.kt new file mode 100644 index 000000000..774fce003 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/MobSpawnerBlockEntity.kt @@ -0,0 +1,34 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection +import de.bixilon.minosoft.util.nbt.tag.CompoundTag + +class MobSpawnerBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + + override fun updateNBT(nbt: CompoundTag) { + // ToDo: {MaxNearbyEntities: 6s, RequiredPlayerRange: 16s, SpawnCount: 4s, x: -80, y: 4, SpawnData: {id: "minecraft:zombie"}, z: 212, id: "minecraft:mob_spawner", MaxSpawnDelay: 800s, SpawnRange: 4s, Delay: 0s, MinSpawnDelay: 200s} + } + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:mob_spawner") + + override fun build(connection: PlayConnection): MobSpawnerBlockEntity { + return MobSpawnerBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/ShulkerBoxBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/ShulkerBoxBlockEntity.kt new file mode 100644 index 000000000..945931e68 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/ShulkerBoxBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class ShulkerBoxBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:shulker_box") + + override fun build(connection: PlayConnection): ShulkerBoxBlockEntity { + return ShulkerBoxBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/SkullBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/SkullBlockEntity.kt new file mode 100644 index 000000000..84b6898b8 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/SkullBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class SkullBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:skull") + + override fun build(connection: PlayConnection): SkullBlockEntity { + return SkullBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/SmokerBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/SmokerBlockEntity.kt new file mode 100644 index 000000000..82c5896cb --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/SmokerBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class SmokerBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:smoker") + + override fun build(connection: PlayConnection): SmokerBlockEntity { + return SmokerBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/StructureBlockBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/StructureBlockBlockEntity.kt new file mode 100644 index 000000000..11a3dd396 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/StructureBlockBlockEntity.kt @@ -0,0 +1,33 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection +import de.bixilon.minosoft.util.nbt.tag.CompoundTag + +class StructureBlockBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + override fun updateNBT(nbt: CompoundTag) { + // ToDo: {mirror: "NONE", metadata: "asd", ignoreEntities: 1b, powered: 0b, seed: 0l, author: "Bixilon", rotation: "NONE", posX: 0, mode: "DATA", posY: 1, sizeX: 0, integrity: 1.0F, posZ: 0, showair: 0b, x: -102, name: "", y: 4, z: 212, id: "minecraft:structure_block", sizeY: 0, sizeZ: 0, showboundingbox: 1b} + } + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:structure_block") + + override fun build(connection: PlayConnection): StructureBlockBlockEntity { + return StructureBlockBlockEntity(connection) + } + } +} diff --git a/src/main/java/de/bixilon/minosoft/data/entities/block/TrappedChestBlockEntity.kt b/src/main/java/de/bixilon/minosoft/data/entities/block/TrappedChestBlockEntity.kt new file mode 100644 index 000000000..09221fdc1 --- /dev/null +++ b/src/main/java/de/bixilon/minosoft/data/entities/block/TrappedChestBlockEntity.kt @@ -0,0 +1,28 @@ +/* + * Minosoft + * Copyright (C) 2021 Moritz Zwerger + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program.If not, see . + * + * This software is not affiliated with Mojang AB, the original developer of Minecraft. + */ + +package de.bixilon.minosoft.data.entities.block + +import de.bixilon.minosoft.data.mappings.ResourceLocation +import de.bixilon.minosoft.protocol.network.connection.PlayConnection + +class TrappedChestBlockEntity(connection: PlayConnection) : BlockEntity(connection) { + + companion object : BlockEntityFactory { + override val RESOURCE_LOCATION: ResourceLocation = ResourceLocation("minecraft:trapped_chest") + + override fun build(connection: PlayConnection): TrappedChestBlockEntity { + return TrappedChestBlockEntity(connection) + } + } +}