Browse Source

Use direct log4j until external dependency issue is sorted

Provides a temporary fix for #1.
master
Michael Pfaff 12 months ago
parent
commit
c8a111d266
Signed by: michael GPG Key ID: E53B118B12B5C7F9
  1. 2
      build.gradle
  2. 24
      src/main/kotlin/dev/pfaff/dense/Dense.kt

2
build.gradle

@ -32,7 +32,7 @@ dependencies {
compile 'org.apache.logging.log4j:log4j-api:2.9.1'
compile 'org.apache.logging.log4j:log4j-core:2.9.1'
compile 'org.fusesource.jansi:jansi:1.18'
compile 'io.github.microutils:kotlin-logging-jvm:2.0.2'
implementation 'io.github.microutils:kotlin-logging:2.0.3'
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"

24
src/main/kotlin/dev/pfaff/dense/Dense.kt

@ -11,12 +11,13 @@ 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 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
@ -25,7 +26,8 @@ class Dense {
/// Mod ID constant
const val MOD_ID = "dense"
private val logger = KotlinLogging.logger {}
// private val logger = KotlinLogging.logger {}
private val logger = LogManager.getLogger(this::class.java)
}
@Suppress("unused")
@ -44,15 +46,18 @@ class Dense {
// 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("Registering event handlers")
logger.info { "Inited" }
// logger.info { "Inited" }
logger.info("Inited")
}
object Items {
internal fun init() {
logger.info { "Registering items" }
// logger.info { "Registering items" }
logger.info("Registering items")
// register("void_shard", VoidShardItem)
// register("condensed_void", CondensedVoidItem)
@ -78,19 +83,22 @@ class Dense {
}
private fun <I : Item> register(itemId: String, item: I) {
logger.debug { "Registering $itemId" }
// 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" }
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" }
logger.debug("Registering $blockId")
Registry.register(Registry.BLOCK, Identifier(MOD_ID, blockId), block)
Registry.register(Registry.ITEM, Identifier(MOD_ID, blockId), item)
}

Loading…
Cancel
Save