content: package thebetweenlands.common.block.plant;
  
  import net.minecraft.block.Block;
  import net.minecraft.block.state.IBlockState;
  import net.minecraft.entity.EntityLivingBase;
  import net.minecraft.item.ItemStack;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.world.World;
  import net.minecraftforge.fml.relauncher.Side;
  import net.minecraftforge.fml.relauncher.SideOnly;
  import thebetweenlands.common.registries.BlockRegistry;
  import thebetweenlands.util.AdvancedStateMap;
  
  public class BlockMarshMarigoldFlower extends BlockStackablePlant {
  	public BlockMarshMarigoldFlower() {
  		this.harvestAll = true;
  		this.setMaxHeight(1);
  	}
  
  	@Override
  	protected boolean isSamePlant(IBlockState blockState) {
  		return super.isSamePlant(blockState) || blockState.getBlock() == BlockRegistry.MARSH_MARIGOLD_STALK;
  	}
  
  	@Override
  	protected boolean canSustainBush(IBlockState state) {
  		return state.getBlock() == BlockRegistry.MARSH_MARIGOLD_STALK;
  	}
  
  	@Override
  	@SideOnly(Side.CLIENT)
  	public Block.EnumOffsetType getOffsetType() {
  		return Block.EnumOffsetType.NONE;
  	}
  
  	@Override
  	public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
  		worldIn.setBlockState(pos, BlockRegistry.MARSH_MARIGOLD_STALK.getDefaultState());
  		worldIn.setBlockState(pos.up(), BlockRegistry.MARSH_MARIGOLD_FLOWER.getDefaultState());
  	}
  
  	@Override
  	public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
  		return BlockRegistry.MARSH_MARIGOLD_STALK.canPlaceBlockAt(worldIn, pos);
  	}
  	
  	@Override
  	@SideOnly(Side.CLIENT)
  	public void setStateMapper(AdvancedStateMap.Builder builder) {
  		super.setStateMapper(builder);
  		builder.ignore(IS_TOP, IS_BOTTOM);
  	}
  }
  