aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0122-Add-API-methods-to-control-if-armor-stands-can-move.patch
blob: 0921060796f3c4a887f12bd63125634a3862f903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 0000000000000000000000000000000000000000 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 armor stands can move


diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 4caa354922110c8662549bae271f1f7cf1a2168f..d33c49c4a4b87a5203f9b4592deff9389e6e870d 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -96,6 +96,7 @@ public class ArmorStand extends LivingEntity {
     public Rotations rightArmPose;
     public Rotations leftLegPose;
     public Rotations rightLegPose;
+    public boolean canMove = true; // Paper
 
     public ArmorStand(EntityType<? extends ArmorStand> type, Level world) {
         super(type, world);
@@ -936,4 +937,13 @@ public class ArmorStand extends LivingEntity {
     public boolean canBeSeenByAnyone() {
         return !this.isInvisible() && !this.isMarker();
     }
+
+    // Paper start
+    @Override
+    public void move(net.minecraft.world.entity.MoverType type, Vec3 movement) {
+        if (this.canMove) {
+            super.move(type, movement);
+        }
+    }
+    // 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 04a7735d278c9e610a33294e65a17796e120fe7e..52ffc401bbb9fa768534a4b871f9cc7dbebb8b20 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -222,4 +222,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
     public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) {
         return (this.getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getFilterFlag() + lockType.ordinal() * 8)) != 0;
     }
+    // Paper start
+    @Override
+    public boolean canMove() {
+        return getHandle().canMove;
+    }
+
+    @Override
+    public void setCanMove(boolean move) {
+        getHandle().canMove = move;
+    }
+    // Paper end
 }