2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-12-21 17:53:41 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2021-03-16 13:04:28 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
2021-06-11 06:29:15 +00:00
|
|
|
index 31bb5df7bc63c993230bf595bd9b66bfaadb4d50..ccdfc8068a8205d6e66ab9458764b1440f8c4b97 100644
|
2021-03-16 13:04:28 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
|
|
|
@@ -38,6 +38,7 @@ import net.minecraft.world.entity.ai.control.ControllerLook;
|
|
|
|
import net.minecraft.world.entity.ai.control.ControllerMove;
|
|
|
|
import net.minecraft.world.entity.ai.control.EntityAIBodyControl;
|
|
|
|
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
|
|
|
+import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat;
|
|
|
|
import net.minecraft.world.entity.ai.goal.PathfinderGoalSelector;
|
|
|
|
import net.minecraft.world.entity.ai.navigation.Navigation;
|
|
|
|
import net.minecraft.world.entity.ai.navigation.NavigationAbstract;
|
|
|
|
@@ -45,6 +46,8 @@ import net.minecraft.world.entity.ai.sensing.EntitySenses;
|
|
|
|
import net.minecraft.world.entity.decoration.EntityHanging;
|
|
|
|
import net.minecraft.world.entity.decoration.EntityLeash;
|
|
|
|
import net.minecraft.world.entity.item.EntityItem;
|
|
|
|
+import net.minecraft.world.entity.monster.EntityBlaze;
|
|
|
|
+import net.minecraft.world.entity.monster.EntityEnderman;
|
|
|
|
import net.minecraft.world.entity.monster.IMonster;
|
|
|
|
import net.minecraft.world.entity.player.EntityHuman;
|
|
|
|
import net.minecraft.world.entity.vehicle.EntityBoat;
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
2021-03-16 13:04:28 +00:00
|
|
|
index 72e53968c5fb03301ddec7a0cf937ac2f8cf0901..2ef991aa7f739d3577fbbf4386064557e8f7c904 100644
|
2021-03-16 07:19:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -28,6 +28,7 @@ import net.minecraft.world.entity.EntitySize;
|
|
|
|
import net.minecraft.world.entity.EntityTypes;
|
|
|
|
import net.minecraft.world.entity.EnumItemSlot;
|
|
|
|
import net.minecraft.world.entity.EnumMainHand;
|
|
|
|
+import net.minecraft.world.entity.EnumMoveType;
|
|
|
|
import net.minecraft.world.entity.player.EntityHuman;
|
|
|
|
import net.minecraft.world.entity.projectile.EntityArrow;
|
|
|
|
import net.minecraft.world.entity.vehicle.EntityMinecartAbstract;
|
|
|
|
@@ -79,6 +80,7 @@ public class EntityArmorStand extends EntityLiving {
|
2016-12-21 17:53:41 +00:00
|
|
|
public Vector3f rightArmPose;
|
|
|
|
public Vector3f leftLegPose;
|
|
|
|
public Vector3f rightLegPose;
|
|
|
|
+ public boolean canMove = true; // Paper
|
|
|
|
|
2019-04-27 06:26:04 +00:00
|
|
|
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
2021-03-16 13:04:28 +00:00
|
|
|
@@ -862,4 +864,13 @@ public class EntityArmorStand extends EntityLiving {
|
2020-08-25 02:22:08 +00:00
|
|
|
private EntitySize s(boolean flag) {
|
|
|
|
return flag ? EntityArmorStand.bp : (this.isBaby() ? EntityArmorStand.bq : this.getEntityType().l());
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
2019-04-27 06:26:04 +00:00
|
|
|
+ public void move(EnumMoveType moveType, Vec3D vec3d) {
|
2016-12-21 17:53:41 +00:00
|
|
|
+ if (this.canMove) {
|
2019-04-27 06:26:04 +00:00
|
|
|
+ super.move(moveType, vec3d);
|
2016-12-21 17:53:41 +00:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2021-03-16 07:19:45 +00:00
|
|
|
index 86c8662b3864b264e26f8c63474fdd39bd6c873c..6f922e4cbb095439fcd76ee0d0c08bc4160b8107 100644
|
2016-12-21 17:53:41 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2021-03-08 23:12:31 +00:00
|
|
|
@@ -229,4 +229,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
2020-08-25 02:22:08 +00:00
|
|
|
public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) {
|
2020-09-10 23:47:58 +00:00
|
|
|
return (getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8)) != 0;
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|
2018-07-26 02:49:43 +00:00
|
|
|
+ // Paper start
|
2016-12-21 17:53:41 +00:00
|
|
|
+ @Override
|
|
|
|
+ public boolean canMove() {
|
|
|
|
+ return getHandle().canMove;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanMove(boolean move) {
|
|
|
|
+ getHandle().canMove = move;
|
|
|
|
+ }
|
2018-07-26 02:49:43 +00:00
|
|
|
+ // Paper end
|
2016-12-21 17:53:41 +00:00
|
|
|
}
|