Search in sources :

Example 6 with AttributeModifier

use of net.minecraft.server.v1_7_R4.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_R2.AttributeInstance) AttributeModifier(net.minecraft.server.v1_7_R2.AttributeModifier)

Example 7 with AttributeModifier

use of net.minecraft.server.v1_7_R4.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_R3.AttributeInstance) AttributeModifier(net.minecraft.server.v1_7_R3.AttributeModifier)

Example 8 with AttributeModifier

use of net.minecraft.server.v1_7_R4.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_R2.AttributeInstance) AttributeModifier(net.minecraft.server.v1_9_R2.AttributeModifier)

Example 9 with AttributeModifier

use of net.minecraft.server.v1_7_R4.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_8_R2.AttributeInstance) AttributeModifier(net.minecraft.server.v1_8_R2.AttributeModifier)

Example 10 with AttributeModifier

use of net.minecraft.server.v1_7_R4.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_8_R3.AttributeInstance) AttributeModifier(net.minecraft.server.v1_8_R3.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