net.minecraft.world.World.scheduleBlockUpdate()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(142)

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

World.scheduleBlockUpdate介绍

暂无

代码示例

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public void scheduleBlockUpdate(@Nonnull BlockPos pos, @Nonnull Block blockIn, int delay, int priority) {
  3. wrapped.scheduleBlockUpdate(pos, blockIn, delay, priority);
  4. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public void onBlockPlaced(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase player,
  3. @Nonnull ItemStack stack) {
  4. if (!world.isRemote) {
  5. world.scheduleBlockUpdate(pos, this, rand.nextInt(40) + 1, 0);
  6. }
  7. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public boolean onBlockActivated(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer player, @Nonnull EnumHand hand,
  3. @Nonnull EnumFacing side, float hitX,
  4. float hitY, float hitZ) {
  5. if (world.isRemote) {
  6. return true;
  7. } else {
  8. if (!state.getValue(POWERED)) {
  9. world.scheduleBlockUpdate(pos, this, delay, 0);
  10. }
  11. return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
  12. }
  13. }

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

  1. @Override
  2. public void scheduleBlockUpdate(BlockPos pos, Block block, int delay, int priority) {
  3. if (part.getPartPos().equals(pos)) {
  4. part.scheduleTick(delay);
  5. } else {
  6. getActualWorld().scheduleBlockUpdate(pos, block, delay, priority);
  7. }
  8. }

代码示例来源:origin: vadis365/TheErebus

  1. @Override
  2. public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
  3. if (!world.isRemote) {
  4. if (state.getValue(TYPE) == EnumType.RED_LAMP_OFF && !world.isBlockPowered(pos))
  5. world.scheduleBlockUpdate(pos, this, 0, 4);
  6. else if (state.getValue(TYPE) == EnumType.RED_LAMP_ON && world.isBlockPowered(pos))
  7. world.setBlockState(pos, state.withProperty(TYPE, EnumType.RED_LAMP_OFF), 2);
  8. }
  9. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. BlockPos targetPos2 = airs.remove(rand.nextInt(airs.size()));
  2. world.setBlockState(targetPos1, newState);
  3. world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
  4. world.setBlockState(targetPos2, newState);
  5. world.scheduleBlockUpdate(targetPos2, this, rand.nextInt(40), 0);
  6. world.setBlockToAir(pos);
  7. return;
  8. BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
  9. world.setBlockState(targetPos1, state.withProperty(AGE, 0));
  10. world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
  11. world.setBlockState(pos, newState);
  12. world.scheduleBlockUpdate(pos, this, rand.nextInt(40), 0);
  13. return;
  14. } else if (rnd.nextFloat() < .50f) { // move
  15. BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
  16. world.setBlockState(targetPos1, newState);
  17. world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
  18. world.setBlockToAir(pos);
  19. return;
  20. BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
  21. world.setBlockState(targetPos1, state.withProperty(AGE, 0).withProperty(HARMLESS, true));
  22. world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
  23. world.setBlockState(pos, newState);
  24. world.scheduleBlockUpdate(pos, this, rand.nextInt(40), 0);

代码示例来源:origin: PrinceOfAmber/Cyclic

  1. world.scheduleBlockUpdate(current, block, world.rand.nextInt(TICKS) + 20, 1);
  2. if (!world.isRemote) {
  3. block.updateTick(world, current, bState, world.rand);

代码示例来源:origin: CoFH/ThermalDynamics

  1. IBlockState levelState = block.getDefaultState().withProperty(BlockLiquid.LEVEL, fullBucket ? 0 : (world().rand.nextInt(6) + 1));
  2. world().setBlockState(pos(), levelState, 3);
  3. world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);
  4. } else if (block instanceof BlockFluidClassic) {
  5. IBlockState levelState = block.getDefaultState().withProperty(BlockFluidBase.LEVEL, fullBucket ? 0 : 1);
  6. world().setBlockState(pos(), levelState, 3);
  7. world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);
  8. } else if (block instanceof BlockFluidFinite && fullBucket) {
  9. IBlockState levelState = block.getDefaultState().withProperty(BlockFluidBase.LEVEL, 0);
  10. world().setBlockState(pos(), levelState, 3);
  11. world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);

相关文章

World类方法