diff --git a/src/main/kotlin/mods/betterfoliage/client/integration/ForestryIntegration.kt b/src/main/kotlin/mods/betterfoliage/client/integration/ForestryIntegration.kt index 1459061..d63d153 100644 --- a/src/main/kotlin/mods/betterfoliage/client/integration/ForestryIntegration.kt +++ b/src/main/kotlin/mods/betterfoliage/client/integration/ForestryIntegration.kt @@ -58,6 +58,7 @@ object ForestryLeavesSupport : ILeafRegistry { textureToValue.clear() val allLeaves = ForestryIntegration.TeLleafTextures.getStatic() as Map<*, *> allLeaves.entries.forEach { + Client.logDetail("ForestryLeavesSupport: base leaf type ${it.key.toString()}") listOf( ForestryIntegration.TeLplain.get(it.value) as ResourceLocation, ForestryIntegration.TeLfancy.get(it.value) as ResourceLocation, @@ -72,6 +73,8 @@ object ForestryLeavesSupport : ILeafRegistry { fun registerLeaf(textureLocation: ResourceLocation, atlas: TextureMap) { val texture = atlas[textureLocation.toString()] ?: return var leafType = LeafRegistry.typeMappings.getType(texture) ?: "default" + Client.logDetail("ForestryLeavesSupport: texture ${texture.iconName}") + Client.logDetail("ForestryLeavesSupport: particle $leafType") val generated = atlas.registerSprite( Client.genLeaves.generatedResource(texture.iconName, "type" to leafType) ) diff --git a/src/main/kotlin/mods/betterfoliage/client/texture/LeafRegistry.kt b/src/main/kotlin/mods/betterfoliage/client/texture/LeafRegistry.kt index 35377a8..55e10fe 100644 --- a/src/main/kotlin/mods/betterfoliage/client/texture/LeafRegistry.kt +++ b/src/main/kotlin/mods/betterfoliage/client/texture/LeafRegistry.kt @@ -14,6 +14,7 @@ import net.minecraft.block.state.IBlockState import net.minecraft.client.renderer.texture.TextureAtlasSprite import net.minecraft.client.renderer.texture.TextureMap import net.minecraft.util.EnumFacing +import net.minecraft.util.ResourceLocation import net.minecraft.util.math.BlockPos import net.minecraft.world.IBlockAccess import net.minecraftforge.client.event.TextureStitchEvent @@ -58,6 +59,7 @@ object LeafRegistry : ILeafRegistry { @SubscribeEvent(priority = EventPriority.HIGHEST) fun handlePreStitch(event: TextureStitchEvent.Pre) { particles.clear() + typeMappings.loadMappings(ResourceLocation(BetterFoliageMod.DOMAIN, "leafTextureMappings.cfg")) } override fun get(state: IBlockState, world: IBlockAccess, pos: BlockPos, face: EnumFacing) = @@ -114,14 +116,18 @@ object StandardLeafSupport : override fun processStitch(state: IBlockState, key: List, atlas: TextureMap) = atlas[key[0]] override fun processTexture(states: List, texture: TextureAtlasSprite, atlas: TextureMap) { + logger?.log(Level.DEBUG, "$logName: leaf texture ${texture.iconName}") + logger?.log(Level.DEBUG, "$logName: #states ${states.size}") registerLeaf(texture, atlas) OptifineCTM.getAllCTM(states, texture).forEach { + logger?.log(Level.DEBUG, "$logName: CTM ${texture.iconName}") registerLeaf(it, atlas) } } fun registerLeaf(texture: TextureAtlasSprite, atlas: TextureMap) { var leafType = LeafRegistry.typeMappings.getType(texture) ?: "default" + logger?.log(Level.DEBUG, "$logName: particle $leafType") val generated = atlas.registerSprite( Client.genLeaves.generatedResource(texture.iconName, "type" to leafType) ) diff --git a/src/main/resources/assets/betterfoliage/LeavesBlocksDefault.cfg b/src/main/resources/assets/betterfoliage/LeavesBlocksDefault.cfg index 70d8e10..23ede21 100644 --- a/src/main/resources/assets/betterfoliage/LeavesBlocksDefault.cfg +++ b/src/main/resources/assets/betterfoliage/LeavesBlocksDefault.cfg @@ -1,8 +1,2 @@ // Vanilla -net.minecraft.block.BlockLeaves - -// Forestry -forestry.arboriculture.gadgets.BlockLeaves - -// Thaumcraft -thaumcraft.common.blocks.BlockMagicalLeaves \ No newline at end of file +net.minecraft.block.BlockLeaves \ No newline at end of file diff --git a/src/main/resources/assets/betterfoliage/leafTextureMappings.cfg b/src/main/resources/assets/betterfoliage/leafTextureMappings.cfg index 99adbdb..5419a97 100644 --- a/src/main/resources/assets/betterfoliage/leafTextureMappings.cfg +++ b/src/main/resources/assets/betterfoliage/leafTextureMappings.cfg @@ -3,4 +3,7 @@ spruce=spruce jungle=jungle // Biomes O' Plenty -fir=spruce \ No newline at end of file +fir=spruce + +// Forestry +forestry:conifers=spruce \ No newline at end of file