Even more patches for 1.14
This commit is contained in:
@@ -5,11 +5,11 @@ 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
|
||||
index 6c4cb61dc5..0b60ca82ce 100644
|
||||
index f06bb3ae1..a5b4f9990 100644
|
||||
--- 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 {
|
||||
break;
|
||||
log("Bed Search Radius: " + bedSearchRadius);
|
||||
}
|
||||
}
|
||||
+
|
||||
@@ -20,7 +20,7 @@ index 6c4cb61dc5..0b60ca82ce 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
index c604182dd9..2c54e3e34a 100644
|
||||
index 8fb3ce17a..7031dd0e4 100644
|
||||
--- 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 {
|
||||
@@ -33,36 +33,36 @@ index c604182dd9..2c54e3e34a 100644
|
||||
+ private boolean noTickEquipmentDirty = false;
|
||||
+ // Paper end
|
||||
|
||||
public EntityArmorStand(World world) {
|
||||
super(EntityTypes.ARMOR_STAND, world);
|
||||
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.leftLegPose = EntityArmorStand.bB;
|
||||
this.rightLegPose = EntityArmorStand.bC;
|
||||
this.noclip = this.isNoGravity();
|
||||
this.rightArmPose = EntityArmorStand.bx;
|
||||
this.leftLegPose = EntityArmorStand.by;
|
||||
this.rightLegPose = EntityArmorStand.bz;
|
||||
+ if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
||||
this.setSize(0.5F, 1.975F);
|
||||
this.Q = 0.0F;
|
||||
this.K = 0.0F;
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.bF.set(enumitemslot.b(), itemstack);
|
||||
this.armorItems.set(enumitemslot.b(), itemstack);
|
||||
}
|
||||
|
||||
+ this.noTickEquipmentDirty = true; // Paper - Allow equipment to be updated even when tick disabled
|
||||
}
|
||||
|
||||
public boolean c(int i, ItemStack itemstack) {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
}
|
||||
|
||||
nbttagcompound.set("Pose", this.z());
|
||||
nbttagcompound.set("Pose", this.B());
|
||||
+ nbttagcompound.setBoolean("Paper.CanTick", this.canTick); // Paper - persist no tick setting
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.setBasePlate(nbttagcompound.getBoolean("NoBasePlate"));
|
||||
this.setMarker(nbttagcompound.getBoolean("Marker"));
|
||||
this.bI = !this.isMarker();
|
||||
this.noclip = this.isNoGravity();
|
||||
this.noclip = !this.A();
|
||||
+ // Paper start - persist no tick
|
||||
+ if (nbttagcompound.hasKey("Paper.CanTick")) {
|
||||
+ this.canTick = nbttagcompound.getBoolean("Paper.CanTick");
|
||||
@@ -72,8 +72,8 @@ index c604182dd9..2c54e3e34a 100644
|
||||
|
||||
this.g(nbttagcompound1);
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ // Paper start
|
||||
+ if (!this.canTick) {
|
||||
@@ -92,56 +92,55 @@ index c604182dd9..2c54e3e34a 100644
|
||||
+ // Paper end
|
||||
+
|
||||
super.tick();
|
||||
+
|
||||
+ // Paper start - Split into separate method
|
||||
+ updatePose();
|
||||
+ }
|
||||
+
|
||||
+ public void updatePose() {
|
||||
+ // Paper end
|
||||
Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b);
|
||||
Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.c);
|
||||
|
||||
if (!this.headPose.equals(vector3f)) {
|
||||
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
|
||||
public void setHeadPose(Vector3f vector3f) {
|
||||
this.headPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.b, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.c, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setBodyPose(Vector3f vector3f) {
|
||||
this.bodyPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.c, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.d, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setLeftArmPose(Vector3f vector3f) {
|
||||
this.leftArmPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.d, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.e, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setRightArmPose(Vector3f vector3f) {
|
||||
this.rightArmPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.e, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.f, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setLeftLegPose(Vector3f vector3f) {
|
||||
this.leftLegPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.f, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.g, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public void setRightLegPose(Vector3f vector3f) {
|
||||
this.rightLegPose = vector3f;
|
||||
this.datawatcher.set(EntityArmorStand.g, vector3f);
|
||||
this.datawatcher.set(EntityArmorStand.bs, vector3f);
|
||||
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
|
||||
}
|
||||
|
||||
public Vector3f r() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index bc1ab273bd..cb32d64bd0 100644
|
||||
index 58bfe8c1c..2ed2960c5 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -157,10 +156,10 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
-
|
||||
- switch (enumitemslot.a()) {
|
||||
- case HAND:
|
||||
- itemstack = (ItemStack) this.bB.get(enumitemslot.b());
|
||||
- itemstack = (ItemStack) this.bw.get(enumitemslot.b());
|
||||
- break;
|
||||
- case ARMOR:
|
||||
- itemstack = (ItemStack) this.bC.get(enumitemslot.b());
|
||||
- itemstack = (ItemStack) this.bx.get(enumitemslot.b());
|
||||
- break;
|
||||
- default:
|
||||
- continue;
|
||||
@@ -176,7 +175,7 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
- new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
|
||||
- }
|
||||
- // Paper end
|
||||
- ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)));
|
||||
- ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1));
|
||||
- if (!itemstack.isEmpty()) {
|
||||
- this.getAttributeMap().a(itemstack.a(enumitemslot));
|
||||
- }
|
||||
@@ -187,10 +186,10 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
-
|
||||
- switch (enumitemslot.a()) {
|
||||
- case HAND:
|
||||
- this.bB.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
- this.bw.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
- break;
|
||||
- case ARMOR:
|
||||
- this.bC.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
- this.bx.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
@@ -213,10 +212,10 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
+
|
||||
+ switch (enumitemslot.a()) {
|
||||
+ case HAND:
|
||||
+ itemstack = (ItemStack) this.bB.get(enumitemslot.b());
|
||||
+ itemstack = (ItemStack) this.bw.get(enumitemslot.b());
|
||||
+ break;
|
||||
+ case ARMOR:
|
||||
+ itemstack = (ItemStack) this.bC.get(enumitemslot.b());
|
||||
+ itemstack = (ItemStack) this.bx.get(enumitemslot.b());
|
||||
+ break;
|
||||
+ default:
|
||||
+ continue;
|
||||
@@ -232,7 +231,7 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)));
|
||||
+ ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1));
|
||||
+ if (!itemstack.isEmpty()) {
|
||||
+ this.getAttributeMap().a(itemstack.a(enumitemslot));
|
||||
+ }
|
||||
@@ -243,10 +242,10 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
+
|
||||
+ switch (enumitemslot.a()) {
|
||||
+ case HAND:
|
||||
+ this.bB.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
+ this.bw.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
+ break;
|
||||
+ case ARMOR:
|
||||
+ this.bC.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
+ this.bx.set(enumitemslot.b(), itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
@@ -254,10 +253,10 @@ index bc1ab273bd..cb32d64bd0 100644
|
||||
+ // Paper end
|
||||
+
|
||||
protected float e(float f, float f1) {
|
||||
float f2 = MathHelper.g(f - this.aQ);
|
||||
float f2 = MathHelper.g(f - this.aK);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
|
||||
index 9f5c3b92e3..07ce93f17c 100644
|
||||
index 9f5c3b92e..07ce93f17 100644
|
||||
--- 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 {
|
||||
|
||||
Reference in New Issue
Block a user