Java 类net.minecraft.block.BlockSoulSand 实例源码

项目:ZeldaSwordSkills    文件:ItemArmorBoots.java   
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
    super.onArmorTick(world, player, stack);
    ZSSPlayerInfo info = ZSSPlayerInfo.get(player);
    Block block = world.getBlockState(new BlockPos(player).down()).getBlock();
    boolean flag = !block.getMaterial().blocksMovement() || block.slipperiness > 0.6F || block instanceof BlockSoulSand;
    if (flag && player.isSprinting() && player.motionY < 0.0D && ++info.hoverTime < 40 ) {
        player.posY += -player.motionY;
        player.motionY = 0.0D;
        player.fallDistance = 0.0F;
        if (info.hoverTime % 3 == 0) {
            world.spawnParticle(EnumParticleTypes.CLOUD, player.posX, player.posY - 1, player.posZ, -player.motionX, player.motionY, -player.motionZ);
        }
    } else if (info.hoverTime > 0) {
        info.hoverTime = 0;
        player.setSprinting(false);
        if (world.isRemote && Minecraft.getMinecraft().gameSettings.keyBindSprint.isKeyDown()) {
            KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindSprint.getKeyCode(), false);
        }
    }
}
项目:ForgeHax    文件:NoSlowdown.java   
@Override
public void onEnabled() {
    ForgeHaxHooks.isNoSlowDownActivated = true;
    try {
        ForgeHaxHooks.LIST_BLOCK_FILTER.add(BlockSoulSand.class);
    } catch (Exception e) {}
}
项目:ForgeHax    文件:NoSlowdown.java   
@Override
public void onDisabled() {
    ForgeHaxHooks.isNoSlowDownActivated = false;
    try {
        ForgeHaxHooks.LIST_BLOCK_FILTER.remove(BlockSoulSand.class);
    } catch (Exception e) {}
}