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


Java World.addBlockEvent方法代码示例

本文整理汇总了Java中net.minecraft.world.World.addBlockEvent方法的典型用法代码示例。如果您正苦于以下问题:Java World.addBlockEvent方法的具体用法?Java World.addBlockEvent怎么用?Java World.addBlockEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


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

示例1: checkForMove

import net.minecraft.world.World; //导入方法依赖的package包/类
private void checkForMove(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    boolean flag = this.shouldBeExtended(worldIn, pos, enumfacing);

    if (flag && !((Boolean)state.getValue(EXTENDED)).booleanValue())
    {
        if ((new BlockPistonStructureHelper(worldIn, pos, enumfacing, true)).canMove())
        {
            worldIn.addBlockEvent(pos, this, 0, enumfacing.getIndex());
        }
    }
    else if (!flag && ((Boolean)state.getValue(EXTENDED)).booleanValue())
    {
        worldIn.setBlockState(pos, state.withProperty(EXTENDED, Boolean.valueOf(false)), 2);
        worldIn.addBlockEvent(pos, this, 1, enumfacing.getIndex());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:BlockPistonBase.java

示例2: checkForMove

import net.minecraft.world.World; //导入方法依赖的package包/类
private void checkForMove(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    boolean flag = this.shouldBeExtended(worldIn, pos, enumfacing);

    if (flag && !((Boolean)state.getValue(EXTENDED)).booleanValue())
    {
        if ((new BlockPistonStructureHelper(worldIn, pos, enumfacing, true)).canMove())
        {
            worldIn.addBlockEvent(pos, this, 0, enumfacing.getIndex());
        }
    }
    else if (!flag && ((Boolean)state.getValue(EXTENDED)).booleanValue())
    {
        worldIn.addBlockEvent(pos, this, 1, enumfacing.getIndex());
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:BlockPistonBase.java

示例3: onNeighborBlockChange

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Called when a neighboring block changes.
 */
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntityBeacon)
    {
        ((TileEntityBeacon)tileentity).updateBeacon();
        worldIn.addBlockEvent(pos, this, 1, 0);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:BlockBeacon.java

示例4: triggerNote

import net.minecraft.world.World; //导入方法依赖的package包/类
public void triggerNote(World worldIn, BlockPos p_175108_2_)
{
    if (worldIn.getBlockState(p_175108_2_.up()).getBlock().getMaterial() == Material.air)
    {
        Material material = worldIn.getBlockState(p_175108_2_.down()).getBlock().getMaterial();
        int i = 0;

        if (material == Material.rock)
        {
            i = 1;
        }

        if (material == Material.sand)
        {
            i = 2;
        }

        if (material == Material.glass)
        {
            i = 3;
        }

        if (material == Material.wood)
        {
            i = 4;
        }

        worldIn.addBlockEvent(p_175108_2_, Blocks.noteblock, i, this.note);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:TileEntityNote.java

示例5: neighborChanged

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
 * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
 * block, etc.
 */
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos p_189540_5_)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntityBeacon)
    {
        ((TileEntityBeacon)tileentity).updateBeacon();
        worldIn.addBlockEvent(pos, this, 1, 0);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:16,代码来源:BlockBeacon.java

示例6: triggerNote

import net.minecraft.world.World; //导入方法依赖的package包/类
public void triggerNote(World worldIn, BlockPos posIn)
{
    if (worldIn.getBlockState(posIn.up()).getMaterial() == Material.AIR)
    {
        Material material = worldIn.getBlockState(posIn.down()).getMaterial();
        int i = 0;

        if (material == Material.ROCK)
        {
            i = 1;
        }

        if (material == Material.SAND)
        {
            i = 2;
        }

        if (material == Material.GLASS)
        {
            i = 3;
        }

        if (material == Material.WOOD)
        {
            i = 4;
        }

        worldIn.addBlockEvent(posIn, Blocks.NOTEBLOCK, i, this.note);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:TileEntityNote.java

示例7: neighborChanged

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
 * change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
 * block, etc.
 */
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);

    if (tileentity instanceof TileEntityBeacon)
    {
        ((TileEntityBeacon)tileentity).updateBeacon();
        worldIn.addBlockEvent(pos, this, 1, 0);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:BlockBeacon.java


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