2021-06-12 09:24:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Wed, 21 Dec 2016 11:47:25 -0600
|
2024-01-22 19:01:10 +01:00
|
|
|
Subject: [PATCH] Add API methods to control if armor stands can move
|
2021-06-12 09:24:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
2024-05-11 23:48:37 +02:00
|
|
|
index c443fef645702e2a3eae8dcd1526d4bc4d269b0f..dd7ecba4525d90e6b9509d1c3cab24c1615e37a9 100644
|
2021-06-12 09:24:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
2024-04-24 03:25:14 +02:00
|
|
|
@@ -96,6 +96,7 @@ public class ArmorStand extends LivingEntity {
|
2021-06-12 09:24:28 +02:00
|
|
|
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);
|
2024-05-11 23:48:37 +02:00
|
|
|
@@ -942,4 +943,13 @@ public class ArmorStand extends LivingEntity {
|
2021-06-12 09:24:28 +02:00
|
|
|
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
|
2023-12-05 18:20:55 +01:00
|
|
|
index 04a7735d278c9e610a33294e65a17796e120fe7e..52ffc401bbb9fa768534a4b871f9cc7dbebb8b20 100644
|
2021-06-12 09:24:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2023-08-14 01:32:51 +02:00
|
|
|
@@ -222,4 +222,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
2021-06-12 09:24:28 +02:00
|
|
|
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
|
|
|
|
}
|