diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java index 2b5f9da86..9ff353749 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java @@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.material.Material; import net.minecraft.util.BlockPos; import net.minecraft.world.biome.BiomeGenOcean; @@ -91,7 +92,7 @@ public class WorldDecorationEvent{ randomPos = event.world.getTopSolidOrLiquidBlock(randomPos); if(PosUtil.getMaterial(PosUtil.offset(randomPos, 0, -1, 0), event.world) == blockBelow){ - if(plant.canPlaceBlockAt(event.world, randomPos)){ + if(plant.canPlaceBlockAt(event.world, randomPos) && WorldUtil.isBlockAir(event.world, randomPos.add(0, 1, 0))){ PosUtil.setBlock(randomPos, event.world, plant, meta, 2); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index a0a47372c..88fe5b648 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -51,6 +51,10 @@ public class WorldUtil{ } } + public static boolean isBlockAir(World world, BlockPos pos){ + return world.isAirBlock(pos); + } + public static BlockPos getCoordsFromSide(EnumFacing side, BlockPos pos, int offset){ return new BlockPos(pos.getX()+side.getFrontOffsetX()*(offset+1), pos.getY()+side.getFrontOffsetY()*(offset+1), pos.getZ()+side.getFrontOffsetZ()*(offset+1)); }