testserver/Spigot-Server-Patches/0161-Add-API-methods-to-con...

55 lines
1.9 KiB
Diff
Raw Normal View History

2018-07-23 08:39:55 +00:00
From 733a688296bb6dd124969295ffb9238c561d6405 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
2018-07-23 08:39:55 +00:00
index cf11a2225b..578d966401 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
2018-07-17 20:32:05 +00:00
@@ -44,6 +44,7 @@ public class EntityArmorStand extends EntityLiving {
public Vector3f rightArmPose;
public Vector3f leftLegPose;
public Vector3f rightLegPose;
+ public boolean canMove = true; // Paper
public EntityArmorStand(World world) {
2018-07-17 20:32:05 +00:00
super(EntityTypes.ARMOR_STAND, world);
@@ -755,4 +756,13 @@ public class EntityArmorStand extends EntityLiving {
public boolean df() {
2017-11-08 16:13:57 +00:00
return false;
}
+
+ // 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-07-23 08:39:55 +00:00
index 2b66a08ade..8a06cb1656 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.18.0