You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

106 lines
4.4 KiB

package dev.pfaff.dense
import dev.pfaff.dense.armor.CondensedVoidBoots
import dev.pfaff.dense.armor.CondensedVoidChestplate
import dev.pfaff.dense.armor.CondensedVoidHelmet
import dev.pfaff.dense.armor.CondensedVoidLeggings
import dev.pfaff.dense.block.NetherStarBlock
import dev.pfaff.dense.item.*
import dev.pfaff.dense.status_effect.FlightEffect
import dev.pfaff.dense.status_effect.HealthEffect
import dev.pfaff.dense.tool.*
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig
import me.sargunvohra.mcmods.autoconfig1u.serializer.Toml4jConfigSerializer
//import mu.KotlinLogging
import net.minecraft.block.Block
import net.minecraft.item.BlockItem
import net.minecraft.item.Item
import net.minecraft.util.Identifier
import net.minecraft.util.registry.Registry
import org.apache.logging.log4j.LogManager
import top.theillusivec4.curios.api.CuriosApi
import top.theillusivec4.curios.api.SlotTypeInfo
class Dense {
companion object {
/// Mod ID constant
const val MOD_ID = "dense"
// private val logger = KotlinLogging.logger {}
private val logger = LogManager.getLogger(this::class.java)
}
@Suppress("unused")
fun init() {
AutoConfig.register(DenseConfig::class.java, ::Toml4jConfigSerializer);
Items.init()
Blocks.init()
Registry.register(Registry.STATUS_EFFECT, Identifier(MOD_ID, "health"), HealthEffect)
// Registry.register(Registry.STATUS_EFFECT, Identifier(MOD_ID, "flight"), FlightEffect)
// logger.info { "Initializing Curios" }
// CuriosApi.enqueueSlotType(SlotTypeInfo.BuildScheme.REGISTER, SlotTypeInfo.Builder("upgrade_helmet").size(3).cosmetic().build())
// CuriosApi.enqueueSlotType(SlotTypeInfo.BuildScheme.REGISTER, SlotTypeInfo.Builder("upgrade_chestplate").size(3).cosmetic().build())
// CuriosApi.enqueueSlotType(SlotTypeInfo.BuildScheme.REGISTER, SlotTypeInfo.Builder("upgrade_leggings").size(3).cosmetic().build())
// CuriosApi.enqueueSlotType(SlotTypeInfo.BuildScheme.REGISTER, SlotTypeInfo.Builder("upgrade_boots").size(3).cosmetic().build())
// logger.info { "Registering event handlers" }
logger.info("Registering event handlers")
// logger.info { "Inited" }
logger.info("Inited")
}
object Items {
internal fun init() {
// logger.info { "Registering items" }
logger.info("Registering items")
// register("void_shard", VoidShardItem)
// register("condensed_void", CondensedVoidItem)
register("nether_star_rod", NetherStarRod)
// register("condensed_void_sword", CondensedVoidSword)
// register("condensed_void_pickaxe", CondensedVoidPickaxe)
// register("condensed_void_axe", CondensedVoidAxe)
// register("condensed_void_shovel", CondensedVoidShovel)
// register("condensed_void_hoe", CondensedVoidHoe)
// register("condensed_void_helmet", CondensedVoidHelmet)
// register("condensed_void_chestplate", CondensedVoidChestplate)
// register("condensed_void_leggings", CondensedVoidLeggings)
// register("condensed_void_boots", CondensedVoidBoots)
// register("upgrade_blank", UpgradeItem())
// register("upgrade_flight", FlightUpgradeItem)
// register("upgrade_speed", SpeedUpgradeItem)
// register("upgrade_jump", JumpUpgradeItem)
// register("upgrade_health", HealthUpgradeItem)
// register("upgrade_void_immunity", VoidImmunityUpgradeItem)
}
private fun <I : Item> register(itemId: String, item: I) {
// logger.debug { "Registering $itemId" }
logger.debug("Registering $itemId")
Registry.register(Registry.ITEM, Identifier(MOD_ID, itemId), item)
}
}
object Blocks {
internal fun init() {
// logger.info { "Registering blocks" }
logger.info("Registering blocks")
register("nether_star_block", NetherStarBlock, NetherStarBlock.ITEM)
}
private fun <B : Block, I: BlockItem> register(blockId: String, block: B, item: I) {
// logger.debug { "Registering $blockId" }
logger.debug("Registering $blockId")
Registry.register(Registry.BLOCK, Identifier(MOD_ID, blockId), block)
Registry.register(Registry.ITEM, Identifier(MOD_ID, blockId), item)
}
}
}