private static boolean isLog(World world, BlockPos pos) { return world.getBlockState(pos).getBlock().isWood(world, pos); }
Block block = world.getBlockState(adj).getBlock(); boolean isWood = block.isWood(world, adj); boolean isLeaf = block.isLeaves(world.getBlockState(adj), world, adj);
public static boolean isTreeBlock(IBlockState blockState, World world, BlockPos pos) { Block block = blockState.getBlock(); return block.isLeaves(blockState, world, pos) || block.isWood(world, pos); }
public boolean isReplaceable(World world, BlockPos pos) { IBlockState state = world.getBlockState(pos); return state.getBlock() != Blocks.AIR && !state.getBlock().isLeaves(state, world, pos) && state.getBlock() != Blocks.NETHERRACK && state.getBlock() != Blocks.SOUL_SAND && state.getBlock() != NaturaNether.netherTaintedSoil && !state.getBlock().isWood(world, pos); }
public static boolean isTreeBlock(IBlockState blockState, World world, BlockPos pos) { Block block = blockState.getBlock(); return block.isLeaves(blockState, world, pos) || block.isWood(world, pos); }
@Override public ICrop getCropAt(World world, BlockPos pos, IBlockState blockState) { Block block = blockState.getBlock(); if (!block.isWood(world, pos)) { return null; } return new CropDestroy(world, blockState, pos, null); }
@Override public ICrop getCropAt(World world, BlockPos pos, IBlockState blockState) { Block block = blockState.getBlock(); if (!block.isWood(world, pos)) { return null; } return new CropDestroy(world, blockState, pos, null); }
@Override public ICrop getCropAt(World world, BlockPos pos, IBlockState blockState) { Block block = blockState.getBlock(); if (!block.isWood(world, pos)) { return null; } return new CropDestroy(world, blockState, pos, null); }
public boolean isReplaceable(World worldIn, BlockPos positionIn) { IBlockState state = worldIn.getBlockState(positionIn); return state.getBlock().isAir(state, worldIn, positionIn) || state.getBlock().isLeaves(state, worldIn, positionIn) || state.getBlock().isWood(worldIn, positionIn); }
public static boolean isTreeBlock(IBlockState blockState, World world, BlockPos pos) { Block block = blockState.getBlock(); return block.isLeaves(blockState, world, pos) || block.isWood(world, pos); }
public default boolean isWood(IBlockAccess world, BlockPos pos, IPartInfo part) { return part.getState().getBlock().isWood(world, pos); }
private boolean isWood(World world, BlockPos pos) { return world.getBlockState(pos).getBlock().isWood(world, pos); }
private Collection<ICrop> getHarvestBlocks(World world, BlockPos position) { Set<BlockPos> seen = new HashSet<>(); Stack<ICrop> crops = new Stack<>(); if (!world.isBlockLoaded(position)) { return Collections.emptyList(); } // Determine what type we want to harvest. IBlockState blockState = world.getBlockState(position); Block block = blockState.getBlock(); if (!block.isWood(world, position) && !isBlockTraversable(blockState, traversalBlocks) && !isFruitBearer(world, position, blockState)) { return crops; } List<BlockPos> candidates = processHarvestBlock(world, crops, seen, position, position); List<BlockPos> temp = new ArrayList<>(); while (!candidates.isEmpty() && crops.size() < 20) { for (BlockPos candidate : candidates) { temp.addAll(processHarvestBlock(world, crops, seen, position, candidate)); } candidates.clear(); candidates.addAll(temp); temp.clear(); } return crops; }
public boolean isReplaceable(World world, BlockPos pos) { IBlockState state = world.getBlockState(pos); return state.getBlock().isAir(state, world, pos) || state.getBlock().isLeaves(state, world, pos) || state.getBlock().isReplaceable(world, pos) || state.getBlock().isWood(world, pos) || this.canGrowInto(state.getBlock()); }
@Override @ModDependentMethod(modId = LPConstants.mcmpModID) public boolean isWood(IBlockAccess world, BlockPos pos) { Block block = mcmpBlockAccess.getBlock(); return block != null ? block.isWood(world, pos) : super.isWood(world, pos); }
/** * Checks if a stack is a type of log. * * @param stack the stack to check. * @return true if it is a log type. */ private boolean isStackLog(@Nullable final ItemStack stack) { return !ItemStackUtils.isEmpty(stack) && stack.getItem() instanceof ItemBlock && ((ItemBlock) stack.getItem()).getBlock().isWood(world, new BlockPos(0, 0, 0)); }
public static boolean isValidPodLocation(World world, BlockPos pos, EnumFacing direction) { pos = pos.offset(direction); if (!world.isBlockLoaded(pos)) { return false; } IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); if (block == Blocks.LOG) { return state.getValue(BlockOldLog.VARIANT) == BlockPlanks.EnumType.JUNGLE; } else { return block.isWood(world, pos); } }
public static boolean canPlaceTree(IBlockState blockState, World world, BlockPos pos) { BlockPos downPos = pos.down(); Block block = world.getBlockState(downPos).getBlock(); return !(block.isReplaceable(world, downPos) && blockState.getMaterial().isLiquid()) && !block.isLeaves(blockState, world, downPos) && !block.isWood(world, downPos); }
public boolean isReplaceable(World world, BlockPos pos) { IBlockState state = world.getBlockState(pos); return state.getBlock().isAir(state, world, pos) || state.getBlock().isLeaves(state, world, pos) || state.getBlock().isWood(world, pos) || canGrowInto(state.getBlock()); }
public void register() { //AlleleManager.alleleRegistry.registerAllele(this); IFlowerRegistry flowerRegistry = FlowerManager.flowerRegistry; for (Block block : getAcceptableBlocks()) { flowerRegistry.registerAcceptableFlower(block, getUID()); } switch (this) { case ROCK: flowerRegistry.registerAcceptableFlowerRule((blockState, world, pos, flowerType) -> blockState.getMaterial() == Material.ROCK, getUID()); break; case LEAVES: flowerRegistry.registerAcceptableFlowerRule((blockState, world, pos, flowerType) -> blockState.getBlock().isLeaves(blockState, world, pos), getUID()); break; case WOOD: flowerRegistry.registerAcceptableFlowerRule((blockState, world, pos, flowerType) -> blockState.getBlock().isWood(world, pos), getUID()); break; } AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.FLOWER_PROVIDER); }