本文整理了Java中net.minecraft.world.World.scheduleBlockUpdate()
方法的一些代码示例,展示了World.scheduleBlockUpdate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.scheduleBlockUpdate()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:scheduleBlockUpdate
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void scheduleBlockUpdate(@Nonnull BlockPos pos, @Nonnull Block blockIn, int delay, int priority) {
wrapped.scheduleBlockUpdate(pos, blockIn, delay, priority);
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onBlockPlaced(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityLivingBase player,
@Nonnull ItemStack stack) {
if (!world.isRemote) {
world.scheduleBlockUpdate(pos, this, rand.nextInt(40) + 1, 0);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean onBlockActivated(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer player, @Nonnull EnumHand hand,
@Nonnull EnumFacing side, float hitX,
float hitY, float hitZ) {
if (world.isRemote) {
return true;
} else {
if (!state.getValue(POWERED)) {
world.scheduleBlockUpdate(pos, this, delay, 0);
}
return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
}
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public void scheduleBlockUpdate(BlockPos pos, Block block, int delay, int priority) {
if (part.getPartPos().equals(pos)) {
part.scheduleTick(delay);
} else {
getActualWorld().scheduleBlockUpdate(pos, block, delay, priority);
}
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
if (!world.isRemote) {
if (state.getValue(TYPE) == EnumType.RED_LAMP_OFF && !world.isBlockPowered(pos))
world.scheduleBlockUpdate(pos, this, 0, 4);
else if (state.getValue(TYPE) == EnumType.RED_LAMP_ON && world.isBlockPowered(pos))
world.setBlockState(pos, state.withProperty(TYPE, EnumType.RED_LAMP_OFF), 2);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
BlockPos targetPos2 = airs.remove(rand.nextInt(airs.size()));
world.setBlockState(targetPos1, newState);
world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
world.setBlockState(targetPos2, newState);
world.scheduleBlockUpdate(targetPos2, this, rand.nextInt(40), 0);
world.setBlockToAir(pos);
return;
BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
world.setBlockState(targetPos1, state.withProperty(AGE, 0));
world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
world.setBlockState(pos, newState);
world.scheduleBlockUpdate(pos, this, rand.nextInt(40), 0);
return;
} else if (rnd.nextFloat() < .50f) { // move
BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
world.setBlockState(targetPos1, newState);
world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
world.setBlockToAir(pos);
return;
BlockPos targetPos1 = airs.remove(rand.nextInt(airs.size()));
world.setBlockState(targetPos1, state.withProperty(AGE, 0).withProperty(HARMLESS, true));
world.scheduleBlockUpdate(targetPos1, this, rand.nextInt(40), 0);
world.setBlockState(pos, newState);
world.scheduleBlockUpdate(pos, this, rand.nextInt(40), 0);
代码示例来源:origin: PrinceOfAmber/Cyclic
world.scheduleBlockUpdate(current, block, world.rand.nextInt(TICKS) + 20, 1);
if (!world.isRemote) {
block.updateTick(world, current, bState, world.rand);
代码示例来源:origin: CoFH/ThermalDynamics
IBlockState levelState = block.getDefaultState().withProperty(BlockLiquid.LEVEL, fullBucket ? 0 : (world().rand.nextInt(6) + 1));
world().setBlockState(pos(), levelState, 3);
world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);
} else if (block instanceof BlockFluidClassic) {
IBlockState levelState = block.getDefaultState().withProperty(BlockFluidBase.LEVEL, fullBucket ? 0 : 1);
world().setBlockState(pos(), levelState, 3);
world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);
} else if (block instanceof BlockFluidFinite && fullBucket) {
IBlockState levelState = block.getDefaultState().withProperty(BlockFluidBase.LEVEL, 0);
world().setBlockState(pos(), levelState, 3);
world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0);
内容来源于网络,如有侵权,请联系作者删除!