3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0132-Add-API-methods-to-control-if-armour-stands-can-move.patch

57 Zeilen
1.9 KiB
Diff

2019-12-12 00:43:22 +01:00
From 5503284388857eb1a7a16fb5d85d84f5c66edf6d 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
2019-12-12 00:43:22 +01:00
index 9d0b85d1c..37ce4d48b 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
2019-04-27 08:26:04 +02:00
@@ -43,6 +43,7 @@ public class EntityArmorStand extends EntityLiving {
public Vector3f rightArmPose;
public Vector3f leftLegPose;
public Vector3f rightLegPose;
+ public boolean canMove = true; // Paper
2019-04-27 08:26:04 +02:00
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
super(entitytypes, world);
2019-12-12 00:43:22 +01:00
@@ -817,4 +818,13 @@ public class EntityArmorStand extends EntityLiving {
2019-04-27 08:26:04 +02:00
2019-07-20 06:01:24 +02:00
return this.getEntityType().k().a(f);
}
+
+ // Paper start
+ @Override
2019-04-27 08:26:04 +02:00
+ public void move(EnumMoveType moveType, Vec3D vec3d) {
+ if (this.canMove) {
2019-04-27 08:26:04 +02:00
+ super.move(moveType, vec3d);
+ }
+ }
+ // 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..124c3185b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -211,4 +211,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
public void setMarker(boolean marker) {
getHandle().setMarker(marker);
}
+
+ // Paper start
+ @Override
+ public boolean canMove() {
+ return getHandle().canMove;
+ }
+
+ @Override
+ public void setCanMove(boolean move) {
+ getHandle().canMove = move;
+ }
+ // Paper end
}
--
2019-12-12 00:43:22 +01:00
2.17.1