当前位置: 首页>>代码示例>>Java>>正文


Java BlockWall类代码示例

本文整理汇总了Java中net.minecraft.block.BlockWall的典型用法代码示例。如果您正苦于以下问题:Java BlockWall类的具体用法?Java BlockWall怎么用?Java BlockWall使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockWall类属于net.minecraft.block包,在下文中一共展示了BlockWall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleFalling

import net.minecraft.block.BlockWall; //导入依赖的package包/类
/**
 * process player falling based on movement packet
 */
public void handleFalling(double p_71122_1_, boolean p_71122_3_)
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.posY - 0.20000000298023224D);
    int k = MathHelper.floor_double(this.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    Block block = this.worldObj.getBlockState(blockpos).getBlock();

    if (block.getMaterial() == Material.air)
    {
        Block block1 = this.worldObj.getBlockState(blockpos.down()).getBlock();

        if (block1 instanceof BlockFence || block1 instanceof BlockWall || block1 instanceof BlockFenceGate)
        {
            blockpos = blockpos.down();
            block = this.worldObj.getBlockState(blockpos).getBlock();
        }
    }

    super.updateFallState(p_71122_1_, p_71122_3_, block, blockpos);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:EntityPlayerMP.java

示例2: handleFalling

import net.minecraft.block.BlockWall; //导入依赖的package包/类
/**
 * process player falling based on movement packet
 */
public void handleFalling(double y, boolean onGroundIn)
{
    int i = MathHelper.floor(this.posX);
    int j = MathHelper.floor(this.posY - 0.20000000298023224D);
    int k = MathHelper.floor(this.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    IBlockState iblockstate = this.world.getBlockState(blockpos);

    if (iblockstate.getMaterial() == Material.AIR)
    {
        BlockPos blockpos1 = blockpos.down();
        IBlockState iblockstate1 = this.world.getBlockState(blockpos1);
        Block block = iblockstate1.getBlock();

        if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate)
        {
            blockpos = blockpos1;
            iblockstate = iblockstate1;
        }
    }

    super.updateFallState(y, onGroundIn, iblockstate, blockpos);
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:27,代码来源:EntityPlayerMP.java

示例3: handleFalling

import net.minecraft.block.BlockWall; //导入依赖的package包/类
/**
 * process player falling based on movement packet
 */
public void handleFalling(double y, boolean onGroundIn)
{
    int i = MathHelper.floor_double(this.posX);
    int j = MathHelper.floor_double(this.posY - 0.20000000298023224D);
    int k = MathHelper.floor_double(this.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    IBlockState iblockstate = this.worldObj.getBlockState(blockpos);

    if (iblockstate.getBlock().isAir(iblockstate, this.worldObj, blockpos))
    {
        BlockPos blockpos1 = blockpos.down();
        IBlockState iblockstate1 = this.worldObj.getBlockState(blockpos1);
        Block block = iblockstate1.getBlock();

        if (block instanceof BlockFence || block instanceof BlockWall || block instanceof BlockFenceGate)
        {
            blockpos = blockpos1;
            iblockstate = iblockstate1;
        }
    }

    super.updateFallState(y, onGroundIn, iblockstate, blockpos);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:EntityPlayerMP.java

示例4: canConnectTo

import net.minecraft.block.BlockWall; //导入依赖的package包/类
protected boolean canConnectTo(IBlockAccess blockAccess, int x, int y, int z) {
	Block block = blockAccess.getBlock(x, y, z);
	if (block == null) {
		return false;
	} else if (block.getMaterial().isOpaque()
			&& block.renderAsNormalBlock()) {
		// We'll connect against full 1x1x1 blocks.
		return true;
	} else if (block instanceof FenceBlock || block instanceof BlockFence
			|| block instanceof BlockPane || block instanceof BlockWall) {
		// Of course we connect to our own.
		// And to vanilla fences, iron bars, glass panes and walls.
		return true;
	}
	return false;
}
 
开发者ID:tyrope,项目名称:fencing,代码行数:17,代码来源:FenceBlock.java

示例5: getPathNodeTypeRaw

import net.minecraft.block.BlockWall; //导入依赖的package包/类
private PathNodeType getPathNodeTypeRaw(IBlockAccess p_189553_1_, int p_189553_2_, int p_189553_3_, int p_189553_4_)
{
    BlockPos blockpos = new BlockPos(p_189553_2_, p_189553_3_, p_189553_4_);
    IBlockState iblockstate = p_189553_1_.getBlockState(blockpos);
    Block block = iblockstate.getBlock();
    Material material = iblockstate.getMaterial();
    return material == Material.AIR ? PathNodeType.OPEN : (block != Blocks.TRAPDOOR && block != Blocks.IRON_TRAPDOOR && block != Blocks.WATERLILY ? (block == Blocks.FIRE ? PathNodeType.DAMAGE_FIRE : (block == Blocks.CACTUS ? PathNodeType.DAMAGE_CACTUS : (block instanceof BlockDoor && material == Material.WOOD && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_WOOD_CLOSED : (block instanceof BlockDoor && material == Material.IRON && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_IRON_CLOSED : (block instanceof BlockDoor && ((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_OPEN : (block instanceof BlockRailBase ? PathNodeType.RAIL : (!(block instanceof BlockFence) && !(block instanceof BlockWall) && (!(block instanceof BlockFenceGate) || ((Boolean)iblockstate.getValue(BlockFenceGate.OPEN)).booleanValue()) ? (material == Material.WATER ? PathNodeType.WATER : (material == Material.LAVA ? PathNodeType.LAVA : (block.isPassable(p_189553_1_, blockpos) ? PathNodeType.OPEN : PathNodeType.BLOCKED))) : PathNodeType.FENCE))))))) : PathNodeType.TRAPDOOR);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:WalkNodeProcessor.java

示例6: isFenceish

import net.minecraft.block.BlockWall; //导入依赖的package包/类
private boolean isFenceish(Coord fenceLocation) {
    final Block block = fenceLocation.getBlock();
    if (block instanceof BlockFence) return true;
    if (block instanceof BlockWall) return true;
    if (block instanceof BlockLog) return true;
    if (block.getMaterial() == Material.iron) return true;
    return false;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:9,代码来源:TileEntityWaterWheel.java

示例7: isFenceish

import net.minecraft.block.BlockWall; //导入依赖的package包/类
private boolean isFenceish(Coord fenceLocation) {
    final Block block = fenceLocation.getBlock();
    if (block instanceof BlockFence) return true;
    if (block instanceof BlockWall) return true;
    if (block instanceof BlockLog) return true;
    if (block.getMaterial() == Material.iron) {
        BlockPos pos = fenceLocation.toBlockPos();
        if (block.isBeaconBase(worldObj, pos, pos)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:14,代码来源:TileEntityWindMill.java

示例8: onNeighborBlockChange

import net.minecraft.block.BlockWall; //导入依赖的package包/类
@Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock) {
    if (neighborBlock instanceof BlockWall) {
        if (world.getBlockState(pos.down()).getBlock() instanceof BlockWall) {
            world.setBlockToAir(pos);
            return;
        }
    }
    TileEntityWrathLamp.doAirCheck(world, pos);
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:11,代码来源:BlockLightAir.java

示例9: isWallLow

import net.minecraft.block.BlockWall; //导入依赖的package包/类
private static boolean isWallLow(int x, int y, int z, Block block, RenderBlocks renderer)
{
    BlockWall blockWall = (BlockWall)block;
    IBlockAccess blockAccess = renderer.blockAccess;
    boolean flag = blockWall.canConnectWallTo(blockAccess, x - 1, y, z);
    boolean flag1 = blockWall.canConnectWallTo(blockAccess, x + 1, y, z);
    boolean flag2 = blockWall.canConnectWallTo(blockAccess, x, y, z - 1);
    boolean flag3 = blockWall.canConnectWallTo(blockAccess, x, y, z + 1);
    boolean flag4 = flag2 && flag3 && !flag && !flag1;
    boolean flag5 = !flag2 && !flag3 && flag && flag1;
    boolean flag6 = blockAccess.isAirBlock(x, y + 1, z);

    return (flag4 || flag5) && flag6;
}
 
开发者ID:Aleksey-Terzi,项目名称:DecorationsTFC,代码行数:15,代码来源:RenderLantern.java

示例10: isWallLow

import net.minecraft.block.BlockWall; //导入依赖的package包/类
private static boolean isWallLow(int x, int y, int z, Block block, RenderBlocks renderer)
{
    BlockWall blockWall = (BlockWall)block;
    IBlockAccess blockAccess = renderer.blockAccess;
       boolean flag = blockWall.canConnectWallTo(blockAccess, x - 1, y, z);
       boolean flag1 = blockWall.canConnectWallTo(blockAccess, x + 1, y, z);
       boolean flag2 = blockWall.canConnectWallTo(blockAccess, x, y, z - 1);
       boolean flag3 = blockWall.canConnectWallTo(blockAccess, x, y, z + 1);
       boolean flag4 = flag2 && flag3 && !flag && !flag1;
       boolean flag5 = !flag2 && !flag3 && flag && flag1;
       boolean flag6 = blockAccess.isAirBlock(x, y + 1, z);

       return (flag4 || flag5) && flag6;
}
 
开发者ID:Aleksey-Terzi,项目名称:LanternsTFC,代码行数:15,代码来源:RenderLantern.java

示例11: func_78612_b

import net.minecraft.block.BlockWall; //导入依赖的package包/类
public boolean func_78612_b(Block p_78612_1_, int p_78612_2_, int p_78612_3_, int p_78612_4_) {
   int var5 = p_78612_1_.func_71857_b();
   if(var5 == -1) {
      return false;
   } else {
      p_78612_1_.func_71902_a(this.field_78669_a, p_78612_2_, p_78612_3_, p_78612_4_);
      this.func_83018_a(p_78612_1_);
      return var5 == 0?this.func_78570_q(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 4?this.func_78621_p(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 31?this.func_78581_r(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 1?this.func_78620_l(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 2?this.func_78572_c(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 20?this.func_78598_k(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 11?this.func_78582_a((BlockFence)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 39?this.func_96445_r(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 5?this.func_78589_i(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 13?this.func_78584_s(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 9?this.func_78586_a((BlockRailBase)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 19?this.func_78603_m(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 23?this.func_78566_o(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 6?this.func_78614_n(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 3?this.func_78590_h((BlockFire)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 8?this.func_78576_j(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 7?this.func_78601_u(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 10?this.func_78565_t((BlockStairs)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 27?this.func_78618_a((BlockDragonEgg)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 32?this.func_82779_a((BlockWall)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 12?this.func_78594_e(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 29?this.func_78577_f(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 30?this.func_78619_g(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 14?this.func_78574_w(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 15?this.func_78610_x((BlockRedstoneRepeater)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 36?this.func_94176_a((BlockRedstoneLogic)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 37?this.func_94171_a((BlockComparator)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 16?this.func_78593_b(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_, false):(var5 == 17?this.func_78608_c(p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_, true):(var5 == 18?this.func_78592_a((BlockPane)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 21?this.func_78580_a((BlockFenceGate)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 24?this.func_78615_a((BlockCauldron)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 33?this.func_82780_a((BlockFlowerPot)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 35?this.func_82775_a((BlockAnvil)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 25?this.func_78585_a((BlockBrewingStand)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 26?this.func_78567_v((BlockEndPortalFrame)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 28?this.func_78616_a((BlockCocoa)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 34?this.func_82778_a((BlockBeacon)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):(var5 == 38?this.func_94172_a((BlockHopper)p_78612_1_, p_78612_2_, p_78612_3_, p_78612_4_):false))))))))))))))))))))))))))))))))))))));
   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:11,代码来源:RenderBlocks.java

示例12: canConnectWallTo

import net.minecraft.block.BlockWall; //导入依赖的package包/类
@Override
public boolean canConnectWallTo(IBlockAccess par1iBlockAccess, int par2,
		int par3, int par4) {
	Block block = par1iBlockAccess.getBlock(par2, par3, par4);
	if (block instanceof BlockWall) {
		return true;
	}
	return super.canConnectWallTo(par1iBlockAccess, par2, par3, par4);
}
 
开发者ID:lawremi,项目名称:PerFabricaAdAstra,代码行数:10,代码来源:WallBlock.java

示例13: getActualState

import net.minecraft.block.BlockWall; //导入依赖的package包/类
@Override
public @Nonnull IBlockState getActualState(@Nonnull IBlockState state, @Nonnull IBlockAccess worldIn, @Nonnull BlockPos pos) {
  EnumFacing.Axis enumfacing$axis = state.getValue(FACING).getAxis();

  if (enumfacing$axis == EnumFacing.Axis.Z
      && (worldIn.getBlockState(pos.west()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.east()).getBlock() instanceof BlockWall)
      || enumfacing$axis == EnumFacing.Axis.X
          && (worldIn.getBlockState(pos.north()).getBlock() instanceof BlockWall || worldIn.getBlockState(pos.south()).getBlock() instanceof BlockWall)) {
    state = state.withProperty(IN_WALL, true);
  }

  return state;
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:14,代码来源:BlockPaintedFenceGate.java

示例14: onItemUse

import net.minecraft.block.BlockWall; //导入依赖的package包/类
@Override
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int facing, float hitX, float hitY, float hitZ) {
    if (world.isRemote) {
        return true;
    }
    if (!item.hasTagCompound()) {
        return false;
    }
    if(player == null) {
        return false;
    }

    String entityId = item.stackTagCompound.getCompoundTag("entity").getString("id");
    Entity entityToSpawn = EntityList.createEntityByName(entityId, world);

    Block blk = world.getBlock(x,y,z);
    double spawnX = x + Facing.offsetsXForSide[facing] + 0.5;
    double spawnY = y + Facing.offsetsYForSide[facing];
    double spawnZ = z + Facing.offsetsZForSide[facing] + 0.5;
    if(facing == ForgeDirection.UP.ordinal() && (blk instanceof BlockFence || blk instanceof BlockWall)) {
        spawnY += 0.5;
    }
    if(entityToSpawn instanceof EntitySlime) {
        ((EntitySlime) entityToSpawn).setSlimeSize(item.stackTagCompound.getCompoundTag("entity").getInteger("slimesize"));
    }
    if(entityToSpawn instanceof EntityZombie){
        if(item.stackTagCompound.getCompoundTag("entity").getBoolean("isBabyZombie"))
            ((EntityZombie) entityToSpawn).setChild(true);
        else
            ((EntityZombie) entityToSpawn).setChild(false);
    }
    entityToSpawn.setLocationAndAngles(spawnX, spawnY, spawnZ, world.rand.nextFloat() * 360.0F, 0);
    world.spawnEntityInWorld(entityToSpawn);
    if(entityToSpawn instanceof EntityLiving) {
        ((EntityLiving)entityToSpawn).playLivingSound();
        ((EntityLiving)entityToSpawn).setHealth(item.stackTagCompound.getCompoundTag("entity").getFloat("health"));
    }

    Entity riddenByEntity = entityToSpawn.riddenByEntity;
    while(riddenByEntity != null) {
        riddenByEntity.setLocationAndAngles(spawnX, spawnY, spawnZ, world.rand.nextFloat() * 360.0F, 0.0F);
        world.spawnEntityInWorld(riddenByEntity);
        if(riddenByEntity instanceof EntityLiving) {
            ((EntityLiving)riddenByEntity).playLivingSound();
        }
        riddenByEntity = riddenByEntity.riddenByEntity;
    }
    item.setTagCompound(null);
    player.setCurrentItemOrArmor(0, item);
    return true;
}
 
开发者ID:SihenZhang,项目名称:CursedLasso,代码行数:52,代码来源:ItemCursedLasso.java

示例15: func_176170_a

import net.minecraft.block.BlockWall; //导入依赖的package包/类
public static int func_176170_a(IBlockAccess blockaccessIn, Entity entityIn, int x, int y, int z, int sizeX, int sizeY, int sizeZ, boolean avoidWater, boolean breakDoors, boolean enterDoors)
{
    boolean flag = false;
    BlockPos blockpos = new BlockPos(entityIn);
    BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

    for (int i = x; i < x + sizeX; ++i)
    {
        for (int j = y; j < y + sizeY; ++j)
        {
            for (int k = z; k < z + sizeZ; ++k)
            {
                blockpos$mutableblockpos.func_181079_c(i, j, k);
                Block block = blockaccessIn.getBlockState(blockpos$mutableblockpos).getBlock();

                if (block.getMaterial() != Material.air)
                {
                    if (block != Blocks.trapdoor && block != Blocks.iron_trapdoor)
                    {
                        if (block != Blocks.flowing_water && block != Blocks.water)
                        {
                            if (!enterDoors && block instanceof BlockDoor && block.getMaterial() == Material.wood)
                            {
                                return 0;
                            }
                        }
                        else
                        {
                            if (avoidWater)
                            {
                                return -1;
                            }

                            flag = true;
                        }
                    }
                    else
                    {
                        flag = true;
                    }

                    if (entityIn.worldObj.getBlockState(blockpos$mutableblockpos).getBlock() instanceof BlockRailBase)
                    {
                        if (!(entityIn.worldObj.getBlockState(blockpos).getBlock() instanceof BlockRailBase) && !(entityIn.worldObj.getBlockState(blockpos.down()).getBlock() instanceof BlockRailBase))
                        {
                            return -3;
                        }
                    }
                    else if (!block.isPassable(blockaccessIn, blockpos$mutableblockpos) && (!breakDoors || !(block instanceof BlockDoor) || block.getMaterial() != Material.wood))
                    {
                        if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof BlockWall)
                        {
                            return -3;
                        }

                        if (block == Blocks.trapdoor || block == Blocks.iron_trapdoor)
                        {
                            return -4;
                        }

                        Material material = block.getMaterial();

                        if (material != Material.lava)
                        {
                            return 0;
                        }

                        if (!entityIn.isInLava())
                        {
                            return -2;
                        }
                    }
                }
            }
        }
    }

    return flag ? 2 : 1;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:80,代码来源:WalkNodeProcessor.java


注:本文中的net.minecraft.block.BlockWall类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。