mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 05:55:44 +01:00
Move Bukkit.Aware loading/saving to correct location
This commit is contained in:
parent
f7cdb53c0e
commit
b1ba874912
@ -86,7 +86,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -348,11 +396,20 @@
|
@@ -343,16 +391,26 @@
|
||||||
|
nbttagcompound.setBoolean("NoAI", this.isNoAI());
|
||||||
|
}
|
||||||
|
|
||||||
|
+ nbttagcompound.setBoolean("Bukkit.Aware", this.aware); // CraftBukkit
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(NBTTagCompound nbttagcompound) {
|
public void a(NBTTagCompound nbttagcompound) {
|
||||||
super.a(nbttagcompound);
|
super.a(nbttagcompound);
|
||||||
@ -109,7 +115,19 @@
|
|||||||
NBTTagList nbttaglist;
|
NBTTagList nbttaglist;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -406,6 +463,11 @@
|
@@ -399,6 +457,11 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ if (nbttagcompound.hasKey("Bukkit.Aware")) {
|
||||||
|
+ this.aware = nbttagcompound.getBoolean("Bukkit.Aware");
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@@ -406,6 +469,11 @@
|
||||||
super.a(damagesource, flag);
|
super.a(damagesource, flag);
|
||||||
this.lootTableKey = null;
|
this.lootTableKey = null;
|
||||||
}
|
}
|
||||||
@ -121,7 +139,7 @@
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LootTableInfo.Builder a(boolean flag, DamageSource damagesource) {
|
protected LootTableInfo.Builder a(boolean flag, DamageSource damagesource) {
|
||||||
@@ -465,11 +527,17 @@
|
@@ -465,11 +533,17 @@
|
||||||
ItemStack itemstack1 = this.getEquipment(enumitemslot);
|
ItemStack itemstack1 = this.getEquipment(enumitemslot);
|
||||||
boolean flag = this.a(itemstack, itemstack1, enumitemslot);
|
boolean flag = this.a(itemstack, itemstack1, enumitemslot);
|
||||||
|
|
||||||
@ -140,7 +158,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.setSlot(enumitemslot, itemstack);
|
this.setSlot(enumitemslot, itemstack);
|
||||||
@@ -554,11 +622,11 @@
|
@@ -554,11 +628,11 @@
|
||||||
if (entityhuman != null) {
|
if (entityhuman != null) {
|
||||||
double d0 = entityhuman.h(this);
|
double d0 = entityhuman.h(this);
|
||||||
|
|
||||||
@ -154,7 +172,7 @@
|
|||||||
this.die();
|
this.die();
|
||||||
} else if (d0 < 1024.0D) {
|
} else if (d0 < 1024.0D) {
|
||||||
this.ticksFarFromPlayer = 0;
|
this.ticksFarFromPlayer = 0;
|
||||||
@@ -573,6 +641,7 @@
|
@@ -573,6 +647,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected final void doTick() {
|
protected final void doTick() {
|
||||||
++this.ticksFarFromPlayer;
|
++this.ticksFarFromPlayer;
|
||||||
@ -162,7 +180,7 @@
|
|||||||
this.world.getMethodProfiler().enter("sensing");
|
this.world.getMethodProfiler().enter("sensing");
|
||||||
this.bw.a();
|
this.bw.a();
|
||||||
this.world.getMethodProfiler().exit();
|
this.world.getMethodProfiler().exit();
|
||||||
@@ -951,12 +1020,24 @@
|
@@ -951,12 +1026,24 @@
|
||||||
if (!this.isAlive()) {
|
if (!this.isAlive()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (this.getLeashHolder() == entityhuman) {
|
} else if (this.getLeashHolder() == entityhuman) {
|
||||||
@ -187,7 +205,7 @@
|
|||||||
this.setLeashHolder(entityhuman, true);
|
this.setLeashHolder(entityhuman, true);
|
||||||
itemstack.subtract(1);
|
itemstack.subtract(1);
|
||||||
return true;
|
return true;
|
||||||
@@ -1002,6 +1083,7 @@
|
@@ -1002,6 +1089,7 @@
|
||||||
|
|
||||||
if (this.leashHolder != null) {
|
if (this.leashHolder != null) {
|
||||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||||
@ -195,7 +213,7 @@
|
|||||||
this.unleash(true, true);
|
this.unleash(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1017,7 +1099,9 @@
|
@@ -1017,7 +1105,9 @@
|
||||||
|
|
||||||
this.leashHolder = null;
|
this.leashHolder = null;
|
||||||
if (!this.world.isClientSide && flag1) {
|
if (!this.world.isClientSide && flag1) {
|
||||||
@ -205,7 +223,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
|
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
|
||||||
@@ -1086,6 +1170,7 @@
|
@@ -1086,6 +1176,7 @@
|
||||||
|
|
||||||
this.setLeashHolder(EntityLeash.a(this.world, blockposition), true);
|
this.setLeashHolder(EntityLeash.a(this.world, blockposition), true);
|
||||||
} else {
|
} else {
|
||||||
@ -213,7 +231,7 @@
|
|||||||
this.unleash(false, true);
|
this.unleash(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1193,7 +1278,14 @@
|
@@ -1193,7 +1284,14 @@
|
||||||
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@ -229,27 +247,3 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
||||||
@@ -1252,4 +1344,23 @@
|
|
||||||
public boolean a(Item item) {
|
|
||||||
return this.getItemInMainHand().getItem() == item || this.getItemInOffHand().getItem() == item;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ @Override
|
|
||||||
+ public NBTTagCompound save(NBTTagCompound nbttagcompound) {
|
|
||||||
+ super.save(nbttagcompound);
|
|
||||||
+
|
|
||||||
+ nbttagcompound.setBoolean("Bukkit.Aware", this.aware);
|
|
||||||
+ return nbttagcompound;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void f(NBTTagCompound nbttagcompound) { // PAIL rename load
|
|
||||||
+ super.f(nbttagcompound);
|
|
||||||
+
|
|
||||||
+ if (nbttagcompound.hasKey("Bukkit.Aware")) {
|
|
||||||
+ this.aware = nbttagcompound.getBoolean("Bukkit.Aware");
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // CraftBukkit end
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user