diff --git a/gradle.properties b/gradle.properties index 1af5665..a4b2207 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,8 +14,8 @@ mod_author=possible_triangle maven_group=com.possible-triangle jei_version=9.7.0.209 -flywheel_version=0.6.10-105 -create_version=0.5.1.f-332 +flywheel_version=0.6.11-107 +create_version=0.5.1.h-427 registrate_version=MC1.18.2-1.1.3 flightlib_version=0.3.0 kotlin_forge_version=3.12.0 diff --git a/src/main/kotlin/com/possible_triangle/create_jetpack/Content.kt b/src/main/kotlin/com/possible_triangle/create_jetpack/Content.kt index e0dae42..20a38ad 100644 --- a/src/main/kotlin/com/possible_triangle/create_jetpack/Content.kt +++ b/src/main/kotlin/com/possible_triangle/create_jetpack/Content.kt @@ -8,8 +8,11 @@ import com.possible_triangle.create_jetpack.item.JetpackItem import com.simibubi.create.AllCreativeModeTabs import com.simibubi.create.AllTags.AllItemTags import com.simibubi.create.Create -import com.simibubi.create.content.equipment.armor.* +import com.simibubi.create.content.equipment.armor.AllArmorMaterials +import com.simibubi.create.content.equipment.armor.BacktankBlockEntity +import com.simibubi.create.content.equipment.armor.BacktankInstance import com.simibubi.create.content.equipment.armor.BacktankItem.BacktankBlockItem +import com.simibubi.create.content.equipment.armor.BacktankRenderer import com.simibubi.create.content.kinetics.BlockStressDefaults import com.simibubi.create.foundation.data.CreateRegistrate import com.simibubi.create.foundation.data.SharedProperties @@ -80,7 +83,7 @@ object Content { .register() val JETPACK_BLOCK: BlockEntry = REGISTRATE - .block("jetpack") { JetpackBlock({ JETPACK_ITEM.get() }, it) } + .block("jetpack") { JetpackBlock(it) } .initialProperties { SharedProperties.copperMetal() } .jetpackTransforms { JETPACK_ITEM.get() } .register() @@ -98,7 +101,7 @@ object Content { .register() val NETHERITE_JETPACK_BLOCK: BlockEntry = REGISTRATE - .block("netherite_jetpack") { JetpackBlock({ NETHERITE_JETPACK_ITEM.get() }, it) } + .block("netherite_jetpack") { JetpackBlock(it) } .initialProperties { SharedProperties.netheriteMetal() } .jetpackTransforms { NETHERITE_JETPACK_ITEM.get() } .register() diff --git a/src/main/kotlin/com/possible_triangle/create_jetpack/block/JetpackBlock.kt b/src/main/kotlin/com/possible_triangle/create_jetpack/block/JetpackBlock.kt index ec0ef30..c1da5d4 100644 --- a/src/main/kotlin/com/possible_triangle/create_jetpack/block/JetpackBlock.kt +++ b/src/main/kotlin/com/possible_triangle/create_jetpack/block/JetpackBlock.kt @@ -3,38 +3,9 @@ package com.possible_triangle.create_jetpack.block import com.possible_triangle.create_jetpack.Content import com.simibubi.create.content.equipment.armor.BacktankBlock import com.simibubi.create.content.equipment.armor.BacktankBlockEntity -import net.minecraft.core.BlockPos -import net.minecraft.nbt.ListTag -import net.minecraft.world.item.ItemStack -import net.minecraft.world.level.BlockGetter -import net.minecraft.world.level.ItemLike import net.minecraft.world.level.block.entity.BlockEntityType -import net.minecraft.world.level.block.state.BlockState -class JetpackBlock(private val item: ItemLike, properties: Properties) : BacktankBlock(properties) { - - override fun getCloneItemStack( - world: BlockGetter, - pos: BlockPos, - state: BlockState - ): ItemStack { - val item = ItemStack(item) - val tile = getBlockEntityOptional(world, pos) - - val air = tile.map { it.getAirLevel() }.orElse(0) as Int - item.orCreateTag.putInt("Air", air) - - val enchants = tile.map { it.enchantmentTag }.orElse(ListTag()) - if (!enchants.isEmpty()) { - val enchantmentTagList = item.enchantmentTags - enchantmentTagList.addAll(enchants) - item.orCreateTag.put("Enchantments", enchantmentTagList) - } - - tile.map { it.customName }.ifPresent { item.hoverName = it } - - return item - } +class JetpackBlock(properties: Properties) : BacktankBlock(properties) { override fun getBlockEntityType(): BlockEntityType { return Content.JETPACK_BLOCK_ENTITY.get()