Java Code Examples for net.minecraft.world.World.notifyBlockOfStateChange()

The following are Jave code examples for showing how to use notifyBlockOfStateChange() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   View Source Code Vote up 5 votes
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing.getOpposite());
    worldIn.notifyBlockOfStateChange(blockpos, this);
    worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
 
Example 2
Project: DecompiledMinecraft   File: BlockRedstoneDiode.java   View Source Code Vote up 5 votes
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing.getOpposite());
    worldIn.notifyBlockOfStateChange(blockpos, this);
    worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
 
Example 3
Project: BaseClient   File: BlockRedstoneDiode.java   View Source Code Vote up 5 votes
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing.getOpposite());
    worldIn.notifyBlockOfStateChange(blockpos, this);
    worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
 
Example 4
Project: BaseClient   File: BlockRedstoneDiode.java   View Source Code Vote up 5 votes
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing.getOpposite());
    worldIn.notifyBlockOfStateChange(blockpos, this);
    worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
 
Example 5
Project: CustomWorldGen   File: BlockRedstoneDiode.java   View Source Code Vote up 5 votes
protected void notifyNeighbors(World worldIn, BlockPos pos, IBlockState state)
{
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing.getOpposite());
    if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(worldIn, pos, worldIn.getBlockState(pos), java.util.EnumSet.of(enumfacing.getOpposite())).isCanceled())
        return;
    worldIn.notifyBlockOfStateChange(blockpos, this);
    worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
 
Example 6
Project: CustomWorldGen   File: BlockIce.java   View Source Code Vote up 5 votes
protected void turnIntoWater(World worldIn, BlockPos pos)
{
    if (worldIn.provider.doesWaterVaporize())
    {
        worldIn.setBlockToAir(pos);
    }
    else
    {
        this.dropBlockAsItem(worldIn, pos, worldIn.getBlockState(pos), 0);
        worldIn.setBlockState(pos, Blocks.WATER.getDefaultState());
        worldIn.notifyBlockOfStateChange(pos, Blocks.WATER);
    }
}