Search in sources :

Example 11 with DoorBlock

use of net.minecraft.block.DoorBlock in project MCMOD-Industria by M-Marvin.

the class BlockBurnedBlock method scann.

@SuppressWarnings("deprecation")
public static int scann(World world, BlockPos pos, List<BlockPos> posList, int depth) {
    if (depth < 8 && !posList.contains(pos)) {
        int dist = 8;
        posList.add(pos);
        for (Direction d : Direction.values()) {
            BlockPos scanPos = pos.relative(d);
            BlockState scanState = world.getBlockState(scanPos);
            if (canHoldBurnedBlocks(world, pos, scanState)) {
                return depth + 1;
            } else if ((scanState.isSolidRender(world, pos) || scanState.getBlock() instanceof FenceBlock || scanState.getBlock() instanceof TrapDoorBlock || scanState.getBlock() instanceof DoorBlock) && !scanState.isAir()) {
                int i = scann(world, scanPos, posList, depth + 1);
                if (i < dist)
                    dist = i;
            }
        }
        return dist;
    }
    return 8;
}
Also used : FenceBlock(net.minecraft.block.FenceBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock) BlockState(net.minecraft.block.BlockState) BlockPos(net.minecraft.util.math.BlockPos) Direction(net.minecraft.util.Direction) DoorBlock(net.minecraft.block.DoorBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock)

Example 12 with DoorBlock

use of net.minecraft.block.DoorBlock in project MCMOD-Industria by M-Marvin.

the class BlockBurnedSlab method scann.

@SuppressWarnings("deprecation")
public static int scann(World world, BlockPos pos, List<BlockPos> posList, int depth) {
    if (depth < 8 && !posList.contains(pos)) {
        int dist = 8;
        posList.add(pos);
        for (Direction d : Direction.values()) {
            BlockPos scanPos = pos.relative(d);
            BlockState scanState = world.getBlockState(scanPos);
            if (BlockBurnedBlock.canHoldBurnedBlocks(world, pos, scanState)) {
                return depth + 1;
            } else if ((scanState.isSolidRender(world, pos) || scanState.getBlock() instanceof FenceBlock || scanState.getBlock() instanceof TrapDoorBlock || scanState.getBlock() instanceof DoorBlock) && !scanState.isAir()) {
                int i = scann(world, scanPos, posList, depth + 1);
                if (i < dist)
                    dist = i;
            }
        }
        return dist;
    }
    return 8;
}
Also used : FenceBlock(net.minecraft.block.FenceBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock) BlockState(net.minecraft.block.BlockState) BlockPos(net.minecraft.util.math.BlockPos) Direction(net.minecraft.util.Direction) DoorBlock(net.minecraft.block.DoorBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock)

Example 13 with DoorBlock

use of net.minecraft.block.DoorBlock in project MCMOD-Industria by M-Marvin.

the class BlockBurnedStairs method scann.

@SuppressWarnings("deprecation")
public static int scann(World world, BlockPos pos, List<BlockPos> posList, int depth) {
    if (depth < 8 && !posList.contains(pos)) {
        int dist = 8;
        posList.add(pos);
        for (Direction d : Direction.values()) {
            BlockPos scanPos = pos.relative(d);
            BlockState scanState = world.getBlockState(scanPos);
            if (BlockBurnedBlock.canHoldBurnedBlocks(world, pos, scanState)) {
                return depth + 1;
            } else if ((scanState.isSolidRender(world, pos) || scanState.getBlock() instanceof FenceBlock || scanState.getBlock() instanceof TrapDoorBlock || scanState.getBlock() instanceof DoorBlock) && !scanState.isAir()) {
                int i = scann(world, scanPos, posList, depth + 1);
                if (i < dist)
                    dist = i;
            }
        }
        return dist;
    }
    return 8;
}
Also used : FenceBlock(net.minecraft.block.FenceBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock) BlockState(net.minecraft.block.BlockState) BlockPos(net.minecraft.util.math.BlockPos) Direction(net.minecraft.util.Direction) DoorBlock(net.minecraft.block.DoorBlock) TrapDoorBlock(net.minecraft.block.TrapDoorBlock)

Aggregations

BlockState (net.minecraft.block.BlockState)13 DoorBlock (net.minecraft.block.DoorBlock)13 BlockPos (net.minecraft.util.math.BlockPos)9 Direction (net.minecraft.util.Direction)6 FenceBlock (net.minecraft.block.FenceBlock)4 TrapDoorBlock (net.minecraft.block.TrapDoorBlock)4 Overwrite (org.spongepowered.asm.mixin.Overwrite)4 SChangeBlockPacket (net.minecraft.network.play.server.SChangeBlockPacket)3 PathPoint (net.minecraft.pathfinding.PathPoint)3 PlayerInteractEvent (org.bukkit.event.player.PlayerInteractEvent)3 ServerPlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.ServerPlayerEntityBridge)2 CakeBlock (net.minecraft.block.CakeBlock)2 INamedContainerProvider (net.minecraft.inventory.container.INamedContainerProvider)2 ItemUseContext (net.minecraft.item.ItemUseContext)2 Path (net.minecraft.pathfinding.Path)2 ActionResultType (net.minecraft.util.ActionResultType)2 AbstractRailBlock (net.minecraft.block.AbstractRailBlock)1 Block (net.minecraft.block.Block)1 WallBlock (net.minecraft.block.WallBlock)1 Material (net.minecraft.block.material.Material)1