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


Java World.isBlockNormalCube方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:BlockTorch.java

示例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();
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:BlockTorch.java

示例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;
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:BlockTorch.java

示例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();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:BlockTorch.java

示例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;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:BlockTorch.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:BlockTorch.java

示例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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:7,代码来源:BlockTorch.java


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