本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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))))))))))))))))))))))))))))))))))))));
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}