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());
}
}
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());
}
}
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());
}
}
use of net.minecraft.server.v1_13_R2.AttributeInstance in project Citizens2 by CitizensDev.
the class EntityHumanNPC method initialise.
private void initialise(MinecraftServer minecraftServer) {
Socket socket = new EmptySocket();
NetworkManager conn = null;
try {
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
conn.a(playerConnection);
socket.close();
} catch (IOException e) {
// swallow
}
AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
if (range == null) {
range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE);
}
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
controllerJump = new PlayerControllerJump(this);
controllerLook = new PlayerControllerLook(this);
controllerMove = new PlayerControllerMove(this);
navigation = new PlayerNavigation(this, world);
invulnerableTicks = 0;
// the default (0) breaks step climbing
NMS.setStepHeight(getBukkitEntity(), 1);
setSkinFlags((byte) 0xFF);
}
Aggregations