mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 09:23:42 +01:00
52 lines
2.2 KiB
Diff
52 lines
2.2 KiB
Diff
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 armour 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 2574fc58386197160d1fa875dd67031406d86356..4d5870f4bfe4bd33333419687a787ab1d1aa3330 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
@@ -92,6 +92,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);
|
|
@@ -927,4 +928,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 47ca72e264950dd950f037a21bb0ad6cc1700751..06cedeea447f53d100e32a6eba6f83b4719cb231 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
@@ -228,4 +228,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
|
|
}
|