SonarSonic / Calculator

Minecraft Forge Mod
MIT License
52 stars 33 forks source link

Advanced greenhouse can't harvester seeds from mystical agriculture and agricraft. #374

Closed Armagedon13 closed 5 years ago

Armagedon13 commented 6 years ago

Forge Version: 1.12.2 14.23.4.2738 Calculator Version: 1.12.2 5.0.8-4 SonarCore Version: 1.12.2 5.0.15-13 Mode: Singleplayer 1.12.2 Description: Advanced Greenhouse destroy the seeds from mystical agriculture and with agricraft not harvest it.

SOL3675 commented 5 years ago

Any Greenhouse doesn't work with Mystical Agriculture seeds, because it using an old getDrops method. https://github.com/SonarSonic/Sonar-Core/blob/1.12.2/src/main/java/sonar/core/integration/planting/vanilla/Harvester.java Mystical Agriculture using new one, that is void method, so that no return statements. That is why your seeds are vanished.

@Deprecated
    public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
    {
        NonNullList<ItemStack> ret = NonNullList.create();
        getDrops(ret, world, pos, state, fortune);
        return ret;
    }

public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
    {
        Random rand = world instanceof World ? ((World)world).rand : RANDOM;

        int count = quantityDropped(state, fortune, rand);
        for (int i = 0; i < count; i++)
        {
            Item item = this.getItemDropped(state, rand, fortune);
            if (item != Items.AIR)
            {
                drops.add(new ItemStack(item, 1, this.damageDropped(state)));
            }
        }
    }
SonarSonic commented 5 years ago

Fixed in dev, Agricraft support added, and switched to new drops method for vanilla crops.