diff --git a/CHANGELOG.md b/CHANGELOG.md index a6409ca296..97a59d33d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Put Cryogonal in more snowy biomes. - Ditto and Eevee, Gible, and Riolu families have been made more common. - Lowered spawn rate of Gyarados on the surface. +- Apricorn leaves can now be used in the [Composter](https://minecraft.fandom.com/wiki/Composter) block, these have the same chance to raise the compost pile the Minecraft leaves do. ### Fixes - Fixed killing a Dodrio killing your game. diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt b/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt index e707d8df25..1850fd5ded 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/CobblemonItems.kt @@ -20,14 +20,22 @@ import com.cobblemon.mod.common.pokemon.helditem.CobblemonHeldItemManager import com.cobblemon.mod.common.registry.CompletableRegistry import dev.architectury.registry.registries.RegistrySupplier import net.minecraft.block.Block -import net.minecraft.item.AliasedBlockItem -import net.minecraft.item.BlockItem -import net.minecraft.item.Item -import net.minecraft.item.ItemGroup +import net.minecraft.block.ComposterBlock +import net.minecraft.item.* import net.minecraft.util.registry.Registry object CobblemonItems : CompletableRegistry(Registry.ITEM_KEY) { + init { + this.completed.thenRun { + val compostChance = ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.getFloat(Items.OAK_LEAVES) + // Should always pass unless Mojang reworks leaves to no longer work in the Composter, in that case we already updated w.o doing anything + if (compostChance != ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.defaultReturnValue()) { + ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE[APRICORN_LEAVES.get()] = compostChance + } + } + } + private val pokeballs = mutableListOf>() @JvmField