Fix llamas not being controllable with '/npc controllable' (#2412)

Llamas are looped in with horses for certain traits (such as having an inventory) but not in movement. This commit excludes llamas from the `updateHorizontalSpeed` check as they cannot be controlled in vanilla.

Tested with 1.12.2 and 1.16.4.
This commit is contained in:
Camotoy 2020-12-20 22:08:44 -05:00 committed by GitHub
parent 0111600aa8
commit 91fcad1499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -318,7 +318,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
boolean onGround = NMS.isOnGround(npc.getEntity());
float speedMod = npc.getNavigator().getDefaultParameters()
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
if (!Util.isHorse(npc.getEntity().getType())) {
if (!Util.isHorse(npc.getEntity().getType()) || npc.getEntity().getType().name().equals("LLAMA") || npc.getEntity().getType().name().equals("TRADER_LLAMA")) {
// just use minecraft horse physics
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, speedMod);
}