mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-15 07:01:36 +08:00
55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From fcb63753987197c3522f2bfe8ea9edc55992e26f Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 94b1602a4..f95b2c573 100644
|
|
--- 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);
|
|
@@ -770,4 +771,13 @@ public class EntityArmorStand extends EntityLiving {
|
|
return this.yaw;
|
|
}
|
|
// CraftBukkit end
|
|
+
|
|
+ // 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
|
|
index 2b66a08ad..8a06cb165 100644
|
|
--- 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;
|
|
+ }
|
|
}
|
|
--
|
|
2.14.2
|
|
|