net.minecraft.util.math.BlockPos#toImmutable ( )源码实例Demo

下面列出了net.minecraft.util.math.BlockPos#toImmutable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: GregTech   文件: TreeChopTask.java
public TreeChopTask(BlockPos startPos, World world, EntityPlayerMP player, ItemStack toolStack) {
    this.startBlockPos = startPos.toImmutable();
    this.currentPos.setPos(startPos);
    this.woodBlockPos.add(startPos.toImmutable());
    this.world = world;
    this.itemStack = toolStack.copy();
    this.player = player;
}
 
源代码2 项目: AgriCraft   文件: DebugModeClearGrass.java
@Override
public void debugActionBlockClicked(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    pos = pos.toImmutable();
    for (int x = -radius; x < radius; x++) {
        for (int z = -radius; z < radius; z++) {
            BlockPos loc = pos.add(x, 0, z);
            Block block = world.getBlockState(loc).getBlock();
            if (block instanceof BlockBush) {
                world.destroyBlock(loc, false);
            }
        }
    }
}