Search in sources :

Example 11 with AttributeModifier

use of net.minecraft.server.v1_6_R3.AttributeModifier in project NoCheatPlus by NoCheatPlus.

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
    final double val = attr.getValue() / attr.b();
    final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
    if (mod == null) {
        return val;
    } else {
        return val / AttribUtil.getMultiplier(mod.c(), mod.d());
    }
}
Also used : AttributeInstance(net.minecraft.server.v1_9_R1.AttributeInstance) AttributeModifier(net.minecraft.server.v1_9_R1.AttributeModifier)

Example 12 with AttributeModifier

use of net.minecraft.server.v1_6_R3.AttributeModifier in project NoCheatPlus by NoCheatPlus.

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.d);
    final double val = attr.getValue() / attr.b();
    final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
    if (mod == null) {
        return val;
    } else {
        return val / AttribUtil.getMultiplier(mod.c(), mod.d());
    }
}
Also used : AttributeInstance(net.minecraft.server.v1_6_R2.AttributeInstance) AttributeModifier(net.minecraft.server.v1_6_R2.AttributeModifier)

Example 13 with AttributeModifier

use of net.minecraft.server.v1_6_R3.AttributeModifier in project NoCheatPlus by NoCheatPlus.

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.d);
    final double val = attr.getValue() / attr.b();
    final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
    if (mod == null) {
        return val;
    } else {
        return val / AttribUtil.getMultiplier(mod.c(), mod.d());
    }
}
Also used : AttributeInstance(net.minecraft.server.v1_6_R3.AttributeInstance) AttributeModifier(net.minecraft.server.v1_6_R3.AttributeModifier)

Example 14 with AttributeModifier

use of net.minecraft.server.v1_6_R3.AttributeModifier in project NoCheatPlus by NoCheatPlus.

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.d);
    final double val = attr.getValue() / attr.b();
    final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
    if (mod == null) {
        return val;
    } else {
        return val / AttribUtil.getMultiplier(mod.c(), mod.d());
    }
}
Also used : AttributeInstance(net.minecraft.server.v1_7_R1.AttributeInstance) AttributeModifier(net.minecraft.server.v1_7_R1.AttributeModifier)

Example 15 with AttributeModifier

use of net.minecraft.server.v1_6_R3.AttributeModifier in project NoCheatPlus by NoCheatPlus.

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
    final double val = attr.getValue() / attr.b();
    final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
    if (mod == null) {
        return val;
    } else {
        return val / AttribUtil.getMultiplier(mod.c(), mod.d());
    }
}
Also used : AttributeInstance(net.minecraft.server.v1_12_R1.AttributeInstance) AttributeModifier(net.minecraft.server.v1_12_R1.AttributeModifier)

Aggregations

AttributeInstance (net.minecraft.server.v1_10_R1.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_10_R1.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_11_R1.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_11_R1.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_12_R1.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_12_R1.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_6_R1.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_6_R1.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_6_R2.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_6_R2.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_6_R3.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_6_R3.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_7_R1.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_7_R1.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_7_R2.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_7_R2.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_7_R3.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_7_R3.AttributeModifier)1 AttributeInstance (net.minecraft.server.v1_7_R4.AttributeInstance)1 AttributeModifier (net.minecraft.server.v1_7_R4.AttributeModifier)1