mojira.dev
MC-4482

Saplings placed on Farmland are not affected by Bonemeal

You can't use bone meal on a sapling placed on tilled dirt. If you try, one bone meal will be consumed but nothing will happen.

Tried on both 1.4.5 and 1.4.6

Related issues

Comments

CubeTheThird

Can confirm, though not sure if intended.

FireHunterX

I saw a post earlier about saplings not growing under a roof, but the saplings I planted on farmland wouldn't grow under normal circumstances. They were under direct sunlight and had plenty of space.

CubeTheThird

This is true, and because the proper conditions seem to be met, it is indeed not a duplicate of that other bug.

Tails

Used up whole stack of bonemeal, nothing happened - confirmed.

bugi74

Fixes
(Note, the reversed logic is just to reduce indentation for the code that follows. If the y check is also removed, it was unnecessary (as there is already one earlier).)

WorldGenTrees.generate()

...
        blockId = world.getBlockId(x, y - 1, z);
        //if ((blockId == Block.grass.blockID || blockId == Block.dirt.blockID) && y < 256 - height - 1) {
        if (blockId != Block.grass.blockID && blockId != Block.dirt.blockID && blockId != Block.tilledField.blockID )
            return false;
        ...

WorldGenForest.generate()

int groundBlockId = par1World.getBlockId(x, y - 1, z);
        //if ((groundBlockId == Block.grass.blockID || groundBlockId == Block.dirt.blockID) && y < 256 - var6 - 1) {
        if (groundBlockId != Block.grass.blockID && groundBlockId != Block.dirt.blockID && groundBlockId != Block.tilledField.blockID)
            return false;
        ...

WorldGenBigTree.validTreeLocation()

...
        int blockId = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]);
        //if (blockId != 2 && blockId != 3)
        if (blockId != Block.grass.blockID && blockId != Block.dirt.blockID && blockId != Block.tilledField.blockID)
            return false;
        ...

WorldGenHugeTrees.generate()

...
                var12 = world.getBlockId(var10, var8, var11);
                if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID
                        && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID
                        && var12 != Block.tilledField.blockID) {       // ADDED
                    var7 = false;
                }
            ...
        ...
        int groundBlockId = world.getBlockId(x, y - 1, z);
        //if ((groundBlockId == Block.grass.blockID || groundBlockId == Block.dirt.blockID) && y < 256 - var6 - 1) {
        if (groundBlockId != Block.grass.blockID && groundBlockId != Block.dirt.blockID && groundBlockId != Block.tilledField.blockID)
            return false;
        ...

WorldGenTaiga2

...
        int groundBlockId = world.getBlockId(x, y - 1, z);
        //if ((groundBlockId == Block.grass.blockID || groundBlockId == Block.dirt.blockID) && y < 256 - var6 - 1) {
        if (groundBlockId != Block.grass.blockID && groundBlockId != Block.dirt.blockID && groundBlockId != Block.tilledField.blockID)
            return false;
        ...

WorldGenTaiga1 should also be given the same treatment, although it seems it is only used from world generation (which probably isn't trying to grow trees on farmland).

Background
Saplings (like flowers) are specifically allowed to be planted on three block types:

protected boolean canThisPlantGrowOnThisBlockID(int par1) {
        return par1 == Block.grass.blockID || par1 == Block.dirt.blockID || par1 == Block.tilledField.blockID;
    }

However, the tree generators only check for two of the block types, perhaps because trees are older stuff than farmland and their code was forgotten to be updated (curses of not following proper programming practices).

Apparently mushrooms are not allowed to be planted on tilled dirt (I wonder why not? one can plant them even on iron block), but since they can not be planted there, there is no need to fix their huge version growth, either (for now, at least).

FireHunterX

@Markku: I wouldn't assume that they didn't update the code, I would assume that it was an oversight. People don't really put saplings on farmland.

EclipsEyE

I was using this "issue" as a feature for decoration and landscaping, and now I can't anymore. I would like to know how I could reopen this and request mojang to reverse it for those of us that like to use it for aesthetic purposes. I'm a bit late to the party as I've only just updated to 1.8 and only recently learned about this site.

kumasasa

@@unknown: This was a bug and was fixed and it will not be reverted.
You may of course request a feature change at Minecraft Suggestions on Reddit.

[media]

http://xkcd.com/1172/

EclipsEyE

@[Mod] Kumasasa I personally never saw it as a bug because I figured it was doing no harm, any way thanks for the link.

EclipsEyE

That poster rings so true

EclipsEyE

@Kumasasa random thought, if it were to be reimplemented via minecraftsuggestions, will it be ensured that it won't just be seen as a bug by someone and re-reported as a bug and have it removed again?

kumasasa

This is unlikely yet not impossible 😛

EclipsEyE

@Kumasasa btw, do you know how hard it would be to re-implement this coding-wise?

Sonicwave

@EclipsEyE: I believe that you can place saplings in flower pots without them growing (not the same thing, but the closest to it I guess).

EclipsEyE

@Sonicwave yeah... it would depend on the sapling, anyway, I followed @Kumasasa 's advice and posted it on the minecraftsuggestions reddit http://www.reddit.com/r/minecraftsuggestions/

FireHunterX

migrated

Confirmed

Minecraft 1.4.5, Snapshot 12w49a, Snapshot 12w50a, Minecraft 1.4.6, Minecraft 1.4.7, ..., Snapshot 13w09c, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.2, Minecraft 1.6.2

Minecraft 13w36a

Retrieved