本文整理汇总了Java中net.minecraft.world.World.isBlockNormalCube方法的典型用法代码示例。如果您正苦于以下问题:Java World.isBlockNormalCube方法的具体用法?Java World.isBlockNormalCube怎么用?Java World.isBlockNormalCube使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.isBlockNormalCube方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockPlaced
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate
*/
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
if (this.canPlaceAt(worldIn, pos, facing))
{
return this.getDefaultState().withProperty(FACING, facing);
}
else
{
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
{
if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true))
{
return this.getDefaultState().withProperty(FACING, enumfacing);
}
}
return this.getDefaultState();
}
}
示例2: onBlockPlaced
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Called by ItemBlocks just before a block is actually set in the world, to
* allow for adjustments to the IBlockstate
*/
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ,
int meta, EntityLivingBase placer) {
if (this.canPlaceAt(worldIn, pos, facing)) {
return this.getDefaultState().withProperty(FACING, facing);
} else {
for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing enumfacing = (EnumFacing) enumfacing0;
if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true)) {
return this.getDefaultState().withProperty(FACING, enumfacing);
}
}
return this.getDefaultState();
}
}
示例3: onNeighborChangeInternal
import net.minecraft.world.World; //导入方法依赖的package包/类
protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state) {
if (!this.checkForDrop(worldIn, pos, state)) {
return true;
} else {
EnumFacing enumfacing = (EnumFacing) state.getValue(FACING);
EnumFacing.Axis enumfacing$axis = enumfacing.getAxis();
EnumFacing enumfacing1 = enumfacing.getOpposite();
boolean flag = false;
if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true)) {
flag = true;
} else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1))) {
flag = true;
}
if (flag) {
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
return true;
} else {
return false;
}
}
}
示例4: onBlockPlaced
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate
*/
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
{
if (this.canPlaceAt(worldIn, pos, facing))
{
return this.getDefaultState().withProperty(FACING, facing);
}
else
{
for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
{
EnumFacing enumfacing = (EnumFacing) enumfacing0;
if (worldIn.isBlockNormalCube(pos.offset(enumfacing.getOpposite()), true))
{
return this.getDefaultState().withProperty(FACING, enumfacing);
}
}
return this.getDefaultState();
}
}
示例5: onNeighborChangeInternal
import net.minecraft.world.World; //导入方法依赖的package包/类
protected boolean onNeighborChangeInternal(World worldIn, BlockPos pos, IBlockState state)
{
if (!this.checkForDrop(worldIn, pos, state))
{
return true;
}
else
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
EnumFacing.Axis enumfacing$axis = enumfacing.getAxis();
EnumFacing enumfacing1 = enumfacing.getOpposite();
boolean flag = false;
if (enumfacing$axis.isHorizontal() && !worldIn.isBlockNormalCube(pos.offset(enumfacing1), true))
{
flag = true;
}
else if (enumfacing$axis.isVertical() && !this.canPlaceOn(worldIn, pos.offset(enumfacing1)))
{
flag = true;
}
if (flag)
{
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
return true;
}
else
{
return false;
}
}
}
示例6: canPlaceAt
import net.minecraft.world.World; //导入方法依赖的package包/类
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing)
{
BlockPos blockpos = pos.offset(facing.getOpposite());
boolean flag = facing.getAxis().isHorizontal();
return flag && worldIn.isBlockNormalCube(blockpos, true) || facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}
示例7: canPlaceAt
import net.minecraft.world.World; //导入方法依赖的package包/类
private boolean canPlaceAt(World worldIn, BlockPos pos, EnumFacing facing) {
BlockPos blockpos = pos.offset(facing.getOpposite());
boolean flag = facing.getAxis().isHorizontal();
return flag && worldIn.isBlockNormalCube(blockpos, true)
|| facing.equals(EnumFacing.UP) && this.canPlaceOn(worldIn, blockpos);
}