MatrexsVigil / phc2crops

All rights reserved - None of my artwork is available to be used for FREE in your game EVER. If you want to HIRE ME, please contact me. Thank you. This code is here for people to learn from and to help find bugs ONLY.
https://www.patreon.com/pamsmods
Other
16 stars 23 forks source link

Custom bonemeal via kelp compatibility #47

Open ricksouth opened 2 years ago

ricksouth commented 2 years ago

Hi!

Love the mods you've created. I'm using the vanilla code to have kelp be used as a bonemeal substitute. However with Pam's Harvestcraft installed this does not work anymore. Do you have an idea on what to change to make it compatible with your custom crops?

The code used:

    public static boolean applyBonemeal(ItemStack itemstack, World world, BlockPos pos, PlayerEntity player) {
        BlockState blockstate = world.getBlockState(pos);
        int hook = ForgeEventFactory.onApplyBonemeal(player, world, pos, blockstate, itemstack);
        if (hook != 0) return hook > 0;

        if (blockstate.getBlock() instanceof IGrowable) {
            IGrowable igrowable = (IGrowable)blockstate.getBlock();
            if (igrowable.isValidBonemealTarget(world, pos, blockstate, world.isClientSide)) {
                if (world instanceof ServerWorld) {
                    if (igrowable.isBonemealSuccess(world, world.random, pos, blockstate)) {
                        igrowable.performBonemeal((ServerWorld)world, world.random, pos, blockstate);
                    }

                    if (!player.isCreative()) {
                        itemstack.shrink(1);
                    }
                }

                return true;
            }
        }

        return false;
    }
codewolf219 commented 2 years ago

Having a similar issue: Minecraft 1.16.5 Pams Crops 1.0.2 Mystical Agriculture 4.2.0

I have Mystical Agriculture installed, and both Mystical Fertilizer and Mystical Essence do not work on crops - here is the line for the useOn for fertilizer: https://github.com/BlakeBr0/MysticalAgriculture/blob/b4c0bebc690504192591cd8392bf11655498efa6/src/main/java/com/blakebr0/mysticalagriculture/item/MysticalFertilizerItem.java#L43

After process of elimination, this starts working when I disable Pams Crops.

Same as above, love the mod/mods - thank you for spending so much time on them.