mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-03 06:57:41 +01:00
Use speedModifier in a few more places
This commit is contained in:
parent
2773304f47
commit
f8cc30d7f2
@ -264,7 +264,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
if (destination == null) {
|
||||
NMS.cancelMoveDestination(getEntity());
|
||||
} else {
|
||||
NMS.setDestination(getEntity(), destination.getX(), destination.getY(), destination.getZ(), 1);
|
||||
NMS.setDestination(getEntity(), destination.getX(), destination.getY(), destination.getZ(),
|
||||
getNavigator().getDefaultParameters().speedModifier());
|
||||
}
|
||||
}
|
||||
|
||||
@ -398,8 +399,9 @@ public class CitizensNPC extends AbstractNPC {
|
||||
entity.setRemoveWhenFarAway(false);
|
||||
|
||||
if (type == EntityType.PLAYER || Util.isHorse(type)) {
|
||||
if (SUPPORT_ATTRIBUTES && !hasTrait(AttributeTrait.class) || !getTrait(AttributeTrait.class)
|
||||
.hasAttribute(Util.getRegistryValue(Registry.ATTRIBUTE, "generic.step_height", "step_height"))) {
|
||||
if (SUPPORT_ATTRIBUTES && !hasTrait(AttributeTrait.class)
|
||||
|| !getTrait(AttributeTrait.class).hasAttribute(Util
|
||||
.getRegistryValue(Registry.ATTRIBUTE, "generic.step_height", "step_height"))) {
|
||||
NMS.setStepHeight(entity, 1);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.trait.trait.MobType;
|
||||
import net.citizensnpcs.api.trait.trait.Owner;
|
||||
import net.citizensnpcs.api.trait.trait.PlayerFilter;
|
||||
import net.citizensnpcs.api.trait.trait.Spawned;
|
||||
import net.citizensnpcs.api.trait.trait.Spawned;
|
||||
import net.citizensnpcs.trait.Age;
|
||||
import net.citizensnpcs.trait.Anchors;
|
||||
import net.citizensnpcs.trait.ArmorStandTrait;
|
||||
@ -106,7 +106,7 @@ public class CitizensTraitFactory implements TraitFactory {
|
||||
registerTrait(TraitInfo.create(ItemFrameTrait.class));
|
||||
registerTrait(TraitInfo.create(LookClose.class).optInToStats());
|
||||
registerTrait(TraitInfo.create(PaintingTrait.class));
|
||||
registerTrait(TraitInfo.create(MirrorTrait.class).optInToStats());
|
||||
registerTrait(TraitInfo.create(MirrorTrait.class).optInToStats());
|
||||
registerTrait(TraitInfo.create(MountTrait.class));
|
||||
registerTrait(TraitInfo.create(MobType.class).asDefaultTrait());
|
||||
registerTrait(TraitInfo.create(OcelotModifiers.class));
|
||||
|
@ -115,7 +115,7 @@ public class StraightLineNavigationStrategy extends AbstractPathStrategy {
|
||||
}
|
||||
} else if (npc.getEntity() instanceof LivingEntity) {
|
||||
NMS.setDestination(npc.getEntity(), destVector.getX(), destVector.getY(), destVector.getZ(),
|
||||
params.speed());
|
||||
params.speedModifier());
|
||||
} else {
|
||||
Vector dir = destVector.subtract(currLoc.toVector()).normalize().multiply(0.2);
|
||||
Block in = currLoc.getBlock();
|
||||
|
Loading…
Reference in New Issue
Block a user