net.minecraft.block.Block.randomDisplayTick()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中net.minecraft.block.Block.randomDisplayTick()方法的一些代码示例,展示了Block.randomDisplayTick()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.randomDisplayTick()方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:randomDisplayTick

Block.randomDisplayTick介绍

暂无

代码示例

代码示例来源:origin: RS485/LogisticsPipes

@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
  Block block = mcmpBlockAccess.getBlock();
  if (block != null) {
    block.randomDisplayTick(state, world, pos, rand);
  } else {
    super.randomDisplayTick(state, world, pos, rand);
  }
}

代码示例来源:origin: SonarSonic/Calculator

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
  super.randomDisplayTick(state, world, pos, rand);
  if (state.getValue(VARIANTS) == Variants.END_DIAMOND) {
    for (int l = 0; l < 3; ++l) {
      double d6 = pos.getX() + rand.nextFloat();
      double d1 = pos.getY() + rand.nextFloat();
      d6 = pos.getZ() + rand.nextFloat();
      double d3;
      double d4;
      double d5;
      int i1 = rand.nextInt(2) * 2 - 1;
      int j1 = rand.nextInt(2) * 2 - 1;
      d3 = (rand.nextFloat() - 0.5D) * 0.125D;
      d4 = (rand.nextFloat() - 0.5D) * 0.125D;
      d5 = (rand.nextFloat() - 0.5D) * 0.125D;
      double d2 = pos.getZ() + 0.5D + 0.25D * j1;
      d5 = rand.nextFloat() * 1.0F * j1;
      double d0 = pos.getX() + 0.5D + 0.25D * i1;
      d3 = rand.nextFloat() * 1.0F * i1;
      world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5);
    }
  }
}

代码示例来源:origin: amadornes/MCMultiPart

public default void randomDisplayTick(IPartInfo part, Random rand) {
  part.getState().getBlock().randomDisplayTick(part.getState(), part.getPartWorld(), part.getPartPos(), rand);
}

代码示例来源:origin: Glitchfiend/ToughAsNails

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World worldIn, BlockPos pos, Random rand)
{
  // randomly throw up some particles so it looks like the flesh is bubbling
  super.randomDisplayTick(state, worldIn, pos, rand);
  
  if (state.getValue(BURNING) == true)
  {
    if (rand.nextInt(24) == 0)
    {
      worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.BLOCKS, 1.0F + rand.nextFloat(), rand.nextFloat() * 0.7F + 0.3F, false);
    }
    
    worldIn.spawnParticle(EnumParticleTypes.FLAME, (double)((float)pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), (double)((float)pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), (double)((float)pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(state)});
    worldIn.spawnParticle(EnumParticleTypes.FLAME, (double)((float)pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), (double)((float)pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), (double)((float)pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(state)});
    worldIn.spawnParticle(EnumParticleTypes.FLAME, (double)((float)pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), (double)((float)pos.getY() + 0.25F + (rand.nextFloat() / 2.0F)), (double)((float)pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(state)});
    
    worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)((float)pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), (double)((float)pos.getY() + 0.9F), (double)((float)pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(state)});
    
    if (rand.nextInt(2)==0)
    {           
      worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)((float)pos.getX() + 0.75F - (rand.nextFloat() / 2.0F)), (double)((float)pos.getY() + 0.9F), (double)((float)pos.getZ() + 0.75F - (rand.nextFloat() / 2.0F)), 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(state)});
    }
  }
}

代码示例来源:origin: Glitchfiend/ToughAsNails

super.randomDisplayTick(state, worldIn, pos, rand);

相关文章

Block类方法