Search in sources :

Example 1 with AttributeModifier

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

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(final 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_R4.AttributeInstance) AttributeModifier(net.minecraft.server.v1_7_R4.AttributeModifier)

Example 2 with AttributeModifier

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

Example 3 with AttributeModifier

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

the class AttributeAccess method getSpeedAttributeMultiplier.

@Override
public double getSpeedAttributeMultiplier(Player player) {
    final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().a(GenericAttributes.d);
    double val = attr.e() / 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_R1.AttributeInstance) AttributeModifier(net.minecraft.server.v1_6_R1.AttributeModifier)

Example 4 with AttributeModifier

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

Example 5 with AttributeModifier

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