Search in sources :

Example 16 with AttributeInstance

use of net.minecraft.server.v1_13_R2.AttributeInstance 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 17 with AttributeInstance

use of net.minecraft.server.v1_13_R2.AttributeInstance 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 18 with AttributeInstance

use of net.minecraft.server.v1_13_R2.AttributeInstance 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 19 with AttributeInstance

use of net.minecraft.server.v1_13_R2.AttributeInstance 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 20 with AttributeInstance

use of net.minecraft.server.v1_13_R2.AttributeInstance 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)

Aggregations

IOException (java.io.IOException)7 Socket (java.net.Socket)7 AttributeInstance (net.minecraft.server.v1_10_R1.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_13_R2.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_8_R3.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_11_R1.AttributeInstance)4 AttributeInstance (net.minecraft.server.v1_12_R1.AttributeInstance)4 AttributeInstance (net.minecraft.server.v1_14_R1.AttributeInstance)3 AttributeInstance (net.minecraft.server.v1_15_R1.AttributeInstance)3 EntityHumanNPC (net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_13_R2.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_14_R1.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC)2 EntityHumanNPC (net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)2 EntityLiving (net.minecraft.server.v1_10_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)2 EntityLiving (net.minecraft.server.v1_14_R1.EntityLiving)2 EntityInsentient (net.minecraft.server.v1_15_R1.EntityInsentient)2