2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-12-21 17:53:41 +00: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
|
2020-11-18 03:45:18 +00:00
|
|
|
index 12eba34f647f9ac1d3866cf6a127e928ac245c84..41aedbbe52761f79512a0676b096a1f8a9a49396 100644
|
2016-12-21 17:53:41 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2020-08-25 02:22:08 +00:00
|
|
|
@@ -45,6 +45,7 @@ public class EntityArmorStand extends EntityLiving {
|
2016-12-21 17:53:41 +00:00
|
|
|
public Vector3f rightArmPose;
|
|
|
|
public Vector3f leftLegPose;
|
|
|
|
public Vector3f rightLegPose;
|
|
|
|
+ public boolean canMove = true; // Paper
|
|
|
|
|
2019-04-27 06:26:04 +00:00
|
|
|
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
2020-08-25 02:22:08 +00:00
|
|
|
@@ -821,4 +822,13 @@ public class EntityArmorStand extends EntityLiving {
|
|
|
|
private EntitySize s(boolean flag) {
|
|
|
|
return flag ? EntityArmorStand.bp : (this.isBaby() ? EntityArmorStand.bq : this.getEntityType().l());
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
2019-04-27 06:26:04 +00:00
|
|
|
+ public void move(EnumMoveType moveType, Vec3D vec3d) {
|
2016-12-21 17:53:41 +00:00
|
|
|
+ if (this.canMove) {
|
2019-04-27 06:26:04 +00:00
|
|
|
+ super.move(moveType, vec3d);
|
2016-12-21 17:53:41 +00: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
|
2020-09-10 23:47:58 +00:00
|
|
|
index 7d07f95e669a9da9f2d6f663a75c907e6c829a98..bf2749fd724ac7b67fc0d5887aa307745c5f1835 100644
|
2016-12-21 17:53:41 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2020-08-25 02:22:08 +00:00
|
|
|
@@ -228,4 +228,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
|
|
|
public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) {
|
2020-09-10 23:47:58 +00:00
|
|
|
return (getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8)) != 0;
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|
2018-07-26 02:49:43 +00:00
|
|
|
+ // Paper start
|
2016-12-21 17:53:41 +00:00
|
|
|
+ @Override
|
|
|
|
+ public boolean canMove() {
|
|
|
|
+ return getHandle().canMove;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanMove(boolean move) {
|
|
|
|
+ getHandle().canMove = move;
|
|
|
|
+ }
|
2018-07-26 02:49:43 +00:00
|
|
|
+ // Paper end
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|