@Nonnull @Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side) { return side.getAxis() == EnumFacing.Axis.Y ? BlockFaceShape.CENTER_BIG : BlockFaceShape.MIDDLE_POLE_THICK; } }
switch( this.quad.orientation.getAxis() )
@Nonnull @Override public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing side) { return side.getAxis() == EnumFacing.Axis.Y ? BlockFaceShape.CENTER_BIG : BlockFaceShape.MIDDLE_POLE_THICK; }
private static EnumMap<EnumFacing, List<Vec3d>> generateCornersForFacings() { EnumMap<EnumFacing, List<Vec3d>> result = new EnumMap<>( EnumFacing.class ); for( EnumFacing facing : EnumFacing.values() ) { List<Vec3d> corners; float offset = ( facing.getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ) ? 0 : 1; switch( facing.getAxis() ) { default: case X: corners = Lists.newArrayList( new Vec3d( offset, 1, 1 ), new Vec3d( offset, 0, 1 ), new Vec3d( offset, 0, 0 ), new Vec3d( offset, 1, 0 ) ); break; case Y: corners = Lists.newArrayList( new Vec3d( 1, offset, 1 ), new Vec3d( 1, offset, 0 ), new Vec3d( 0, offset, 0 ), new Vec3d( 0, offset, 1 ) ); break; case Z: corners = Lists.newArrayList( new Vec3d( 0, 1, offset ), new Vec3d( 0, 0, offset ), new Vec3d( 1, 0, offset ), new Vec3d( 1, 1, offset ) ); break; } if( facing.getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ) { corners = Lists.reverse( corners ); } result.put( facing, ImmutableList.copyOf( corners ) ); } return result; }
@Nonnull @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) { return X_AABB; } else { return Z_AABB; } }
@Nonnull @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) return X_AABB; else return Z_AABB; }
@Nonnull @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { if(state.getValue(BotaniaStateProps.CARDINALS).getAxis() == EnumFacing.Axis.X) { return X_AABB; } else { return Z_AABB; } }
@Override public void setOrientation( final EnumFacing forward, final EnumFacing up ) { if( this.w instanceof World ) { if( this.facingProp != null ) { ( (World) this.w ).setBlockState( this.pos, this.w.getBlockState( this.pos ).withProperty( this.facingProp, up ) ); } else { // TODO 1.10.2-R - Temp ( (World) this.w ).setBlockState( this.pos, this.w.getBlockState( this.pos ).withProperty( BlockQuartzPillar.AXIS_ORIENTATION, up.getAxis() ) ); } } else { throw new IllegalStateException( this.w.getClass().getName() + " received, expected World" ); } } }
@Nonnull @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing side, float par6, float par7, float par8, int meta, EntityLivingBase placer) { if (meta == 2) { // Pillar quartz variant switch (side.getAxis()) { case Y: return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Y); case Z: return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_Z); case X: return getDefaultState().withProperty(BotaniaStateProps.QUARTZ_VARIANT, QuartzVariant.PILLAR_X); } } return getStateFromMeta(meta); }
if( ( side.getAxis() != EnumFacing.Axis.Y ) && ( a == EnumFacing.NORTH || a == EnumFacing.EAST || a == EnumFacing.WEST || a == EnumFacing.SOUTH ) ) else if( side.getAxis() == EnumFacing.Axis.Y && ( a == EnumFacing.EAST || a == EnumFacing.WEST ) ) EnumFacing perpendicular = a.rotateAround( side.getAxis() ); for( EnumFacing cornerCandidate : EnumSet.of( perpendicular, perpendicular.getOpposite() ) )
@Override protected void onImpact(@Nonnull RayTraceResult var1) { if(!world.isRemote) { if(var1 != null) { EnumFacing dir = var1.sideHit; if(dir != null && dir.getAxis() != EnumFacing.Axis.Y) { BlockPos pos = var1.getBlockPos().offset(dir); while(pos.getY() > 0) { IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); if(block.isAir(state, world, pos)) { IBlockState stateSet = ModBlocks.solidVines.getDefaultState().withProperty(propMap.get(dir.getOpposite()), true); world.setBlockState(pos, stateSet, 1 | 2); world.playEvent(2001, pos, Block.getStateId(stateSet)); pos = pos.down(); } else break; } } } this.world.setEntityState(this, (byte)3); setDead(); } }
@Override public boolean shouldSideBeRendered(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos, @Nonnull EnumFacing side) { return super.shouldSideBeRendered(state, worldIn, pos, side) && !(side.getAxis() != EnumFacing.Axis.Y && worldIn.getBlockState(pos.offset(side)).getBlock() instanceof BlockCarpet); }
protected @Nonnull BlockPos getNeighbor(@Nonnull BlockPos pos, @Nonnull Random rand) { EnumFacing face = NNList.FACING.get(rand.nextInt(NNList.FACING.size())); if (face.getAxis() != Axis.Y && rand.nextBoolean()) { return pos.offset(face).offset(face.rotateY()); } else { return pos.offset(face); } }
@Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(@Nonnull IBlockState bs, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos, @Nonnull EnumFacing side) { if (side.getAxis() != EnumFacing.Axis.Y) { final BlockPos otherPos = pos.offset(side); IBlockState otherBlockState = worldIn.getBlockState(otherPos); if (otherBlockState.getBlock() instanceof BlockPaintedFence && getPaintSource(bs, worldIn, pos) == getPaintSource(otherBlockState, worldIn, otherPos)) { return false; } } return super.shouldSideBeRendered(bs, worldIn, pos, side); }
if(side.getAxis() != Axis.Y) { float sideAngle = side.getHorizontalAngle() - potatoFacing.getHorizontalAngle(); side = EnumFacing.fromAngle(sideAngle);
@Override public boolean setLogBlock(ITreeGenome genome, World world, BlockPos pos, EnumFacing facing) { AlleleBoolean fireproofAllele = (AlleleBoolean) genome.getActiveAllele(EnumTreeChromosome.FIREPROOF); boolean fireproof = fireproofAllele.getValue(); IBlockState logBlock = TreeManager.woodAccess.getBlock(woodType, WoodBlockKind.LOG, fireproof); BlockLog.EnumAxis axis = BlockLog.EnumAxis.fromFacingAxis(facing.getAxis()); return world.setBlockState(pos, logBlock.withProperty(BlockLog.LOG_AXIS, axis)); }