Java Code Examples for net.minecraft.block.state.IBlockState#isFullBlock()
The following examples show how to use
net.minecraft.block.state.IBlockState#isFullBlock() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Injector.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 2
Source File: Harvester.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 3
Source File: Shredder.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 4
Source File: Fabricator.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 5
Source File: Scaffolder.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 6
Source File: Scrubber.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 7
Source File: Processor.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 8
Source File: TidalGenerator.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 9
Source File: Hydroponic.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 10
Source File: Cooker.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 11
Source File: Piezoelectric.java From EmergingTechnology with MIT License | 6 votes |
@Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState north = worldIn.getBlockState(pos.north()); IBlockState east = worldIn.getBlockState(pos.east()); IBlockState south = worldIn.getBlockState(pos.south()); IBlockState west = worldIn.getBlockState(pos.west()); EnumFacing face = (EnumFacing) state.getValue(FACING); if (face == EnumFacing.NORTH && north.isFullBlock() && !south.isFullBlock()) { face = EnumFacing.SOUTH; } else if (face == EnumFacing.SOUTH && south.isFullBlock() && !north.isFullBlock()) { face = EnumFacing.NORTH; } else if (face == EnumFacing.EAST && east.isFullBlock() && !west.isFullBlock()) { face = EnumFacing.WEST; } else if (face == EnumFacing.WEST && west.isFullBlock() && !east.isFullBlock()) { face = EnumFacing.EAST; } worldIn.setBlockState(pos, state.withProperty(FACING, face)); } }
Example 12
Source File: BlockBarrelDistillation.java From Sakura_mod with MIT License | 5 votes |
public void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
Example 13
Source File: InfinitePain.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@SubscribeEvent public static void onLanding(LivingFallEvent event) { EntityLivingBase elb = event.getEntityLiving(); if(elb.hasItemInSlot(EntityEquipmentSlot.FEET) && elb.getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem() == PAIN_BOOTS) { if(event.getDistance() >= minTriggerHeight) { boolean notObstructed = true; double impactPosition = 0; for(int i = (int) elb.posY + 2; i < elb.world.provider.getHeight(); i++) { BlockPos pos = new BlockPos(elb.posX, i, elb.posZ); IBlockState state = elb.world.getBlockState(pos); if(state.isFullBlock() || state.isFullCube()) { notObstructed = false; impactPosition = i; break; } } if(notObstructed) { elb.setPositionAndUpdate(elb.posX, elb.world.provider.getHeight() + heightToAdd, elb.posZ); event.setDamageMultiplier(0); } else { elb.addVelocity(0, (impactPosition - elb.posY) / 2, 0); elb.attackEntityFrom(DamageSource.GENERIC, damageOnImpact); event.setDamageMultiplier(0); } } } }
Example 14
Source File: InfinitePain.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@SubscribeEvent public static void onLandingCreative(PlayerFlyableFallEvent event) { EntityLivingBase elb = event.getEntityLiving(); if(elb.hasItemInSlot(EntityEquipmentSlot.FEET) && elb.getItemStackFromSlot(EntityEquipmentSlot.FEET).getItem() == PAIN_BOOTS) { if(event.getDistance() >= minTriggerHeight) { boolean notObstructed = true; double impactPosition = 0; for(int i = (int) elb.posY + 2; i < elb.world.provider.getHeight(); i++) { BlockPos pos = new BlockPos(elb.posX, i, elb.posZ); IBlockState state = elb.world.getBlockState(pos); if(state.isFullBlock() || state.isFullCube()) { notObstructed = false; impactPosition = i; break; } } if(notObstructed) { elb.setPositionAndUpdate(elb.posX, elb.world.provider.getHeight() + heightToAdd, elb.posZ); } else { elb.addVelocity(0, (impactPosition - elb.posY) / 2, 0); } } } }
Example 15
Source File: BlockTFCompressor.java From TofuCraftReload with MIT License | 5 votes |
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
Example 16
Source File: BlockTFCrasher.java From TofuCraftReload with MIT License | 5 votes |
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
Example 17
Source File: BlockAggregator.java From TofuCraftReload with MIT License | 5 votes |
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
Example 18
Source File: BlockSlab.java From customstuff4 with GNU General Public License v3.0 | 5 votes |
@Override public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) { IBlockState state = this.getActualState(base_state, world, pos); return base_state.isFullBlock() || (state.getValue(net.minecraft.block.BlockSlab.HALF) == net.minecraft.block.BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP) || (state.getValue(net.minecraft.block.BlockSlab.HALF) == net.minecraft.block.BlockSlab.EnumBlockHalf.BOTTOM && side == EnumFacing.DOWN); }
Example 19
Source File: BlockTFOven.java From TofuCraftReload with MIT License | 5 votes |
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }
Example 20
Source File: BlockSaltFurnace.java From TofuCraftReload with MIT License | 5 votes |
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { IBlockState iblockstate = worldIn.getBlockState(pos.north()); IBlockState iblockstate1 = worldIn.getBlockState(pos.south()); IBlockState iblockstate2 = worldIn.getBlockState(pos.west()); IBlockState iblockstate3 = worldIn.getBlockState(pos.east()); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && iblockstate.isFullBlock() && !iblockstate1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && iblockstate1.isFullBlock() && !iblockstate.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && iblockstate2.isFullBlock() && !iblockstate3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && iblockstate3.isFullBlock() && !iblockstate2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } }