2019-12-16 02:58:10 +00:00
|
|
|
From 2dee4cbf0de58c1b0bb4d85de55cb30e5d167baa 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
|
2019-12-16 02:58:10 +00:00
|
|
|
index 9d0b85d1c1..37ce4d48bc 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
|
2019-04-27 06:26:04 +00:00
|
|
|
@@ -43,6 +43,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);
|
2019-12-11 23:43:22 +00:00
|
|
|
@@ -817,4 +818,13 @@ public class EntityArmorStand extends EntityLiving {
|
2019-04-27 06:26:04 +00:00
|
|
|
|
2019-07-20 04:01:24 +00:00
|
|
|
return this.getEntityType().k().a(f);
|
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
|
2019-12-16 02:58:10 +00:00
|
|
|
index 2b66a08ade..124c3185bc 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
|
2018-07-26 02:49:43 +00:00
|
|
|
@@ -211,4 +211,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
2016-12-21 17:53:41 +00:00
|
|
|
public void setMarker(boolean marker) {
|
|
|
|
getHandle().setMarker(marker);
|
|
|
|
}
|
|
|
|
+
|
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
|
|
|
}
|
|
|
|
--
|
2019-12-16 02:58:10 +00:00
|
|
|
2.24.1
|
2016-12-21 17:53:41 +00:00
|
|
|
|