Search in sources :

Example 26 with AttributeInstance

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

Example 27 with AttributeInstance

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

Example 28 with AttributeInstance

use of net.minecraft.server.v1_9_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_6_R2.AttributeInstance) AttributeModifier(net.minecraft.server.v1_6_R2.AttributeModifier)

Example 29 with AttributeInstance

use of net.minecraft.server.v1_9_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_6_R3.AttributeInstance) AttributeModifier(net.minecraft.server.v1_6_R3.AttributeModifier)

Example 30 with AttributeInstance

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

Aggregations

AttributeInstance (net.minecraft.server.v1_10_R1.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_11_R1.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_12_R1.AttributeInstance)5 AttributeInstance (net.minecraft.server.v1_8_R3.AttributeInstance)5 IOException (java.io.IOException)4 Socket (java.net.Socket)4 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_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_12_R1.EntityLiving)2 EmptyNetHandler (net.citizensnpcs.nms.v1_10_R1.network.EmptyNetHandler)1 EmptyNetworkManager (net.citizensnpcs.nms.v1_10_R1.network.EmptyNetworkManager)1 EmptySocket (net.citizensnpcs.nms.v1_10_R1.network.EmptySocket)1 PlayerControllerJump (net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerJump)1 PlayerControllerLook (net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerLook)1 PlayerControllerMove (net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove)1 PlayerNavigation (net.citizensnpcs.nms.v1_10_R1.util.PlayerNavigation)1