2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-12-21 18:53:41 +01:00
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Wed, 21 Dec 2016 11:47:25 -0600
|
|
|
|
Subject: [PATCH] Add API methods to control if armour stands can move
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2021-02-16 18:08:29 +01:00
|
|
|
index ad3c2f4b448fe8a49c1c43374cd5cf14114c9b16..4870a6f9f894b2c9d0fea83dad0808ac6448f808 100644
|
2016-12-21 18:53:41 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -45,6 +45,7 @@ public class EntityArmorStand extends EntityLiving {
|
2016-12-21 18:53:41 +01:00
|
|
|
public Vector3f rightArmPose;
|
|
|
|
public Vector3f leftLegPose;
|
|
|
|
public Vector3f rightLegPose;
|
|
|
|
+ public boolean canMove = true; // Paper
|
|
|
|
|
2019-04-27 08:26:04 +02:00
|
|
|
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
2020-12-21 08:56:22 +01:00
|
|
|
@@ -828,4 +829,13 @@ public class EntityArmorStand extends EntityLiving {
|
2020-08-25 04:22:08 +02:00
|
|
|
private EntitySize s(boolean flag) {
|
|
|
|
return flag ? EntityArmorStand.bp : (this.isBaby() ? EntityArmorStand.bq : this.getEntityType().l());
|
2016-12-21 18:53:41 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
2019-04-27 08:26:04 +02:00
|
|
|
+ public void move(EnumMoveType moveType, Vec3D vec3d) {
|
2016-12-21 18:53:41 +01:00
|
|
|
+ if (this.canMove) {
|
2019-04-27 08:26:04 +02:00
|
|
|
+ super.move(moveType, vec3d);
|
2016-12-21 18:53:41 +01:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2021-03-09 00:12:31 +01:00
|
|
|
index 8f38500965a70fb713050321f71c97510703402a..6ff7a59cc7052e900516a89db8daf0720c64a1ac 100644
|
2016-12-21 18:53:41 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2021-03-09 00:12:31 +01:00
|
|
|
@@ -229,4 +229,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
2020-08-25 04:22:08 +02:00
|
|
|
public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) {
|
2020-09-11 01:47:58 +02:00
|
|
|
return (getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8)) != 0;
|
2016-12-21 18:53:41 +01:00
|
|
|
}
|
2018-07-26 04:49:43 +02:00
|
|
|
+ // Paper start
|
2016-12-21 18:53:41 +01:00
|
|
|
+ @Override
|
|
|
|
+ public boolean canMove() {
|
|
|
|
+ return getHandle().canMove;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanMove(boolean move) {
|
|
|
|
+ getHandle().canMove = move;
|
|
|
|
+ }
|
2018-07-26 04:49:43 +02:00
|
|
|
+ // Paper end
|
2016-12-21 18:53:41 +01:00
|
|
|
}
|