@Override public boolean canHandlePlant(Collection<ItemStack> items, World world, BlockPos pos, IBlockState state) { if (!WorldUtil.isBlockAir(state)) { return false; } boolean found = false; for (EnumFacing dir : EnumFacing.HORIZONTALS) { BlockPos toCheck = pos.offset(dir); IBlockState other = world.getBlockState(toCheck); if (other.getBlock() == Blocks.LOG && other.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE) { found = true; break; } } return found && items.stream().anyMatch(this::canPlantStack); }
public BlockAetherFenceGate() { super(EnumType.OAK); this.setHardness(2.0F); this.setResistance(5.0F); this.setSoundType(SoundType.WOOD); }
private static EnumType getVariant(IBlockState bs) { if (bs.getProperties().containsKey(BlockNewLog.VARIANT)) { return bs.getValue(BlockNewLog.VARIANT); } if (bs.getProperties().containsKey(BlockOldLog.VARIANT)) { return bs.getValue(BlockOldLog.VARIANT); } return null; }
@Override public EnumType getWoodType(int meta) { return null; }
@Override public EnumType getWoodType(int meta) { return EnumType.OAK; }
public BlockReinforcedFenceGate(){ super(EnumType.BIRCH); //doesn't matter what gets put in here ObfuscationReflectionHelper.setPrivateValue(Block.class, this, Material.iron, 35); }
private boolean isJungleTree(IBlockState state) { return state.getBlock() == Blocks.LOG && state.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE; }
@Override public EnumType getWoodType(int meta){ return null; }