mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-31 13:37:40 +01:00
Add setSpeed calls to fix armorstand not working with movecontrol
This commit is contained in:
parent
78f7ee15a4
commit
2247a81150
@ -61,6 +61,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,6 +82,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bg = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
||||
this.a.l(this.a.bg);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -59,6 +59,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,6 +84,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bf = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
||||
this.a.l(this.a.bf);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -60,6 +60,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,6 +47,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bg = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
||||
this.a.k(this.a.bg);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -62,6 +62,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,6 +49,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bj = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
||||
this.a.o(this.a.bj);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -64,6 +64,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(EntityTypes<? extends EntityArmorStand> types, World world, NPC npc) {
|
||||
super(types, world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,6 +48,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bd = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.a.o(this.a.bd);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -57,6 +57,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(EntityTypes<? extends EntityArmorStand> types, World world, NPC npc) {
|
||||
super(types, world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,6 +48,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.bb = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.a.o(this.a.bb);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
@ -50,8 +50,8 @@ public class ArmorStandController extends MobEntityController {
|
||||
|
||||
public static class EntityArmorStandNPC extends EntityArmorStand implements NPCHolder, ForwardingMobAI {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityTypes<? extends EntityArmorStand> types, World world) {
|
||||
this(types, world, null);
|
||||
}
|
||||
@ -61,6 +61,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ public class EntityMoveControl extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.aT = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.a.q(this.a.aT);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
if (((EntitySlime) a).isAggressive()) {
|
||||
|
@ -49,8 +49,8 @@ public class ArmorStandController extends MobEntityController {
|
||||
|
||||
public static class EntityArmorStandNPC extends ArmorStand implements NPCHolder, ForwardingMobAI {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
|
||||
this(types, level, null);
|
||||
}
|
||||
@ -60,6 +60,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (ai != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,7 @@ public class EntityMoveControl extends MoveControl {
|
||||
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
|
||||
}
|
||||
this.entity.zza = (float) (this.speed * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.entity.setSpeed(this.entity.zza);
|
||||
if (entity instanceof Slime && jumpTicks-- <= 0) {
|
||||
this.jumpTicks = new Random().nextInt(20) + 10;
|
||||
if (((Slime) entity).isAggressive()) {
|
||||
|
@ -51,8 +51,8 @@ public class ArmorStandController extends MobEntityController {
|
||||
|
||||
public static class EntityArmorStandNPC extends ArmorStand implements NPCHolder, ForwardingMobAI {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
|
||||
this(types, level, null);
|
||||
}
|
||||
@ -62,6 +62,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,7 @@ public class EntityMoveControl extends MoveControl {
|
||||
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
|
||||
}
|
||||
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.entity.setSpeed(this.entity.zza);
|
||||
if (entity instanceof Slime && jumpTicks-- <= 0) {
|
||||
this.jumpTicks = new Random().nextInt(20) + 10;
|
||||
if (((Slime) entity).isAggressive()) {
|
||||
|
@ -51,8 +51,8 @@ public class ArmorStandController extends MobEntityController {
|
||||
|
||||
public static class EntityArmorStandNPC extends ArmorStand implements NPCHolder, ForwardingMobAI {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
|
||||
this(types, level, null);
|
||||
}
|
||||
@ -62,6 +62,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,6 +111,7 @@ public class EntityMoveControl extends MoveControl {
|
||||
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
|
||||
}
|
||||
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.entity.setSpeed(this.entity.zza);
|
||||
if (entity instanceof Slime && jumpTicks-- <= 0) {
|
||||
this.jumpTicks = new Random().nextInt(20) + 10;
|
||||
if (((Slime) entity).isAggressive()) {
|
||||
|
@ -51,6 +51,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
|
||||
this(types, level, null);
|
||||
}
|
||||
@ -60,6 +61,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,7 @@ public class EntityMoveControl extends MoveControl {
|
||||
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
|
||||
}
|
||||
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.entity.setSpeed(entity.zza);
|
||||
if (entity instanceof Slime && jumpTicks-- <= 0) {
|
||||
this.jumpTicks = new Random().nextInt(20) + 10;
|
||||
if (((Slime) entity).isAggressive()) {
|
||||
|
@ -49,8 +49,8 @@ public class ArmorStandController extends MobEntityController {
|
||||
|
||||
public static class EntityArmorStandNPC extends ArmorStand implements NPCHolder, ForwardingMobAI {
|
||||
private MobAI ai;
|
||||
|
||||
private final CitizensNPC npc;
|
||||
|
||||
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
|
||||
this(types, level, null);
|
||||
}
|
||||
@ -60,6 +60,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,7 @@ public class EntityMoveControl extends MoveControl {
|
||||
NMS.setHeadYaw(entity.getBukkitEntity(), entity.getYRot());
|
||||
}
|
||||
this.entity.zza = (float) (this.speedMod * entity.getAttribute(Attributes.MOVEMENT_SPEED).getBaseValue());
|
||||
this.entity.setSpeed(entity.zza);
|
||||
if (entity instanceof Slime && jumpTicks-- <= 0) {
|
||||
this.jumpTicks = new Random().nextInt(20) + 10;
|
||||
if (((Slime) entity).isAggressive()) {
|
||||
|
@ -58,6 +58,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
public EntityArmorStandNPC(World world, NPC npc) {
|
||||
super(world);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,6 +81,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
this.a.ba = (float) (this.e * this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue());
|
||||
this.a.k(this.a.ba);
|
||||
if (a instanceof EntitySlime && h-- <= 0) {
|
||||
this.h = new Random().nextInt(20) + 10;
|
||||
this.h /= 3;
|
||||
|
Loading…
Reference in New Issue
Block a user