2018-04-01 05:30:19 +02:00
|
|
|
From 5dfd9332ae1e106d0216583a14e3e2c0302fb10e 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
|
2018-04-01 05:30:19 +02:00
|
|
|
index c9054fc9..ee3d37a7 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
|
|
|
|
@@ -50,6 +50,7 @@ public class EntityArmorStand extends EntityLiving {
|
|
|
|
public Vector3f rightArmPose;
|
|
|
|
public Vector3f leftLegPose;
|
|
|
|
public Vector3f rightLegPose;
|
|
|
|
+ public boolean canMove = true; // Paper
|
|
|
|
|
|
|
|
public EntityArmorStand(World world) {
|
|
|
|
super(world);
|
2017-10-13 23:07:48 +02:00
|
|
|
@@ -770,4 +771,13 @@ public class EntityArmorStand extends EntityLiving {
|
2017-11-08 17:13:57 +01:00
|
|
|
public boolean cS() {
|
|
|
|
return false;
|
2016-12-21 18:53:41 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void move(EnumMoveType moveType, double x, double y, double z) {
|
|
|
|
+ if (this.canMove) {
|
|
|
|
+ super.move(moveType, x, y, z);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2018-04-01 05:30:19 +02:00
|
|
|
index 2b66a08a..8a06cb16 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
|
|
|
|
@@ -211,4 +211,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
|
|
|
public void setMarker(boolean marker) {
|
|
|
|
getHandle().setMarker(marker);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean canMove() {
|
|
|
|
+ return getHandle().canMove;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanMove(boolean move) {
|
|
|
|
+ getHandle().canMove = move;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2018-04-01 05:30:19 +02:00
|
|
|
2.16.2
|
2016-12-21 18:53:41 +01:00
|
|
|
|