2018-08-15 10:26:51 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Riley Park <rileysebastianpark@gmail.com>
|
|
|
|
Date: Wed, 15 Aug 2018 01:26:09 -0700
|
|
|
|
Subject: [PATCH] Allow disabling armour stand ticking
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-08-26 20:11:49 +02:00
|
|
|
index 58f87794d6..06c949ef06 100644
|
2018-08-15 10:26:51 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
2018-08-26 20:11:49 +02:00
|
|
|
break;
|
|
|
|
}
|
2018-08-15 10:26:51 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean armorStandTick = true;
|
|
|
|
+ private void armorStandTick() {
|
|
|
|
+ this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick);
|
|
|
|
+ log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default");
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
2018-08-26 20:11:49 +02:00
|
|
|
index 7647311dfd..35afffedef 100644
|
2018-08-15 10:26:51 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
|
|
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
|
|
|
public Vector3f leftLegPose;
|
|
|
|
public Vector3f rightLegPose;
|
|
|
|
public boolean canMove = true; // Paper
|
|
|
|
+ public boolean canTick = true; // Paper - armour stand ticking
|
|
|
|
|
|
|
|
public EntityArmorStand(World world) {
|
2018-08-17 00:11:35 +02:00
|
|
|
super(EntityTypes.ARMOR_STAND, world);
|
2018-08-15 10:26:51 +02:00
|
|
|
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
2018-08-17 00:11:35 +02:00
|
|
|
this.leftLegPose = EntityArmorStand.bB;
|
|
|
|
this.rightLegPose = EntityArmorStand.bC;
|
2018-08-15 10:26:51 +02:00
|
|
|
this.noclip = this.isNoGravity();
|
|
|
|
+ if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
2018-08-17 00:11:35 +02:00
|
|
|
this.setSize(0.5F, 1.975F);
|
|
|
|
this.Q = 0.0F;
|
2018-08-15 10:26:51 +02:00
|
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
|
|
|
}
|
|
|
|
|
2018-08-17 00:11:35 +02:00
|
|
|
public void tick() {
|
2018-08-15 10:26:51 +02:00
|
|
|
+ if (!this.canTick) return;// Paper
|
2018-08-17 00:11:35 +02:00
|
|
|
super.tick();
|
2018-08-15 10:26:51 +02:00
|
|
|
Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b);
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
2018-08-26 20:11:49 +02:00
|
|
|
index 9f5c3b92e3..07ce93f17c 100644
|
2018-08-15 10:26:51 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
|
|
|
@@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
|
2018-08-17 00:11:35 +02:00
|
|
|
public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) {
|
|
|
|
return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
2018-08-15 10:26:51 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean canTick() {
|
|
|
|
+ return this.getHandle().canTick;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setCanTick(final boolean tick) {
|
|
|
|
+ this.getHandle().canTick = tick;
|
|
|
|
+ }
|
2018-08-17 00:11:35 +02:00
|
|
|
// Paper end
|
2018-08-15 10:26:51 +02:00
|
|
|
}
|
|
|
|
--
|