@@ -26,9 +26,9 @@
|
||||
private static final DataWatcherObject<Float> c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
|
||||
private static final DataWatcherObject<Integer> d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
|
||||
protected static final DataWatcherObject<Byte> bt = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
|
||||
@@ -26,10 +40,10 @@
|
||||
protected static final DataWatcherObject<NBTTagCompound> bv = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
|
||||
@@ -27,10 +41,10 @@
|
||||
protected static final DataWatcherObject<NBTTagCompound> bw = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
|
||||
private long e;
|
||||
public final PlayerInventory inventory = new PlayerInventory(this);
|
||||
- protected InventoryEnderChest enderChest = new InventoryEnderChest();
|
||||
+ protected InventoryEnderChest enderChest = new InventoryEnderChest(this); // CraftBukkit - add "this" to constructor
|
||||
@@ -39,7 +39,7 @@
|
||||
protected int bC;
|
||||
public float bD;
|
||||
public float bE;
|
||||
@@ -57,6 +71,17 @@
|
||||
@@ -58,6 +72,17 @@
|
||||
@Nullable
|
||||
public EntityFishingHook hookedFish;
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
+
|
||||
public EntityHuman(World world, GameProfile gameprofile) {
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.bX = ItemStack.a;
|
||||
@@ -179,7 +204,7 @@
|
||||
this.bY = ItemStack.a;
|
||||
@@ -194,7 +219,7 @@
|
||||
ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
|
||||
|
||||
if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.WATER)) {
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -352,7 +377,8 @@
|
||||
@@ -367,7 +392,8 @@
|
||||
|
||||
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean(GameRules.NATURAL_REGENERATION)) {
|
||||
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
|
||||
if (this.foodData.c() && this.ticksLived % 10 == 0) {
|
||||
@@ -497,6 +523,7 @@
|
||||
@@ -512,6 +538,7 @@
|
||||
|
||||
@Nullable
|
||||
public EntityItem n(boolean flag) {
|
||||
@@ -84,7 +84,7 @@
|
||||
return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && !this.inventory.getItemInHand().isEmpty() ? this.inventory.getItemInHand().getCount() : 1), false, true);
|
||||
}
|
||||
|
||||
@@ -537,6 +564,30 @@
|
||||
@@ -552,6 +579,30 @@
|
||||
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
return entityitem;
|
||||
}
|
||||
}
|
||||
@@ -611,6 +662,14 @@
|
||||
@@ -626,6 +677,14 @@
|
||||
}
|
||||
|
||||
this.setScore(nbttagcompound.getInt("Score"));
|
||||
@@ -128,9 +128,9 @@
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
|
||||
this.f = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
||||
this.g = nbttagcompound.getBoolean("SpawnForced");
|
||||
@@ -661,6 +720,7 @@
|
||||
this.g = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
|
||||
this.bU = nbttagcompound.getBoolean("SpawnForced");
|
||||
@@ -676,6 +735,7 @@
|
||||
if (!this.getShoulderEntityRight().isEmpty()) {
|
||||
nbttagcompound.set("ShoulderEntityRight", this.getShoulderEntityRight());
|
||||
}
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -675,10 +735,10 @@
|
||||
@@ -690,10 +750,10 @@
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -151,7 +151,7 @@
|
||||
}
|
||||
|
||||
if (this.world.getDifficulty() == EnumDifficulty.EASY) {
|
||||
@@ -690,7 +750,13 @@
|
||||
@@ -705,7 +765,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -705,10 +771,29 @@
|
||||
@@ -720,10 +786,29 @@
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
@@ -199,7 +199,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -739,8 +824,13 @@
|
||||
@@ -754,8 +839,13 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
if (!this.isInvulnerable(damagesource)) {
|
||||
f = this.applyArmorModifier(damagesource, f);
|
||||
f = this.applyMagicModifier(damagesource, f);
|
||||
@@ -766,6 +856,7 @@
|
||||
@@ -781,6 +871,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,7 @@
|
||||
}
|
||||
|
||||
public void openSign(TileEntitySign tileentitysign) {}
|
||||
@@ -896,8 +987,15 @@
|
||||
@@ -911,8 +1002,15 @@
|
||||
if (entity instanceof EntityLiving) {
|
||||
f3 = ((EntityLiving) entity).getHealth();
|
||||
if (j > 0 && !entity.isBurning()) {
|
||||
@@ -240,7 +240,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,8 +1023,11 @@
|
||||
@@ -940,8 +1038,11 @@
|
||||
EntityLiving entityliving = (EntityLiving) iterator.next();
|
||||
|
||||
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) {
|
||||
@@ -253,7 +253,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,9 +1036,26 @@
|
||||
@@ -950,9 +1051,26 @@
|
||||
}
|
||||
|
||||
if (entity instanceof EntityPlayer && entity.velocityChanged) {
|
||||
@@ -280,7 +280,7 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -982,7 +1100,14 @@
|
||||
@@ -997,7 +1115,14 @@
|
||||
|
||||
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
|
||||
if (j > 0) {
|
||||
@@ -296,7 +296,7 @@
|
||||
}
|
||||
|
||||
if (this.world instanceof WorldServer && f5 > 2.0F) {
|
||||
@@ -998,6 +1123,11 @@
|
||||
@@ -1013,6 +1138,11 @@
|
||||
if (flag4) {
|
||||
entity.extinguish();
|
||||
}
|
||||
@@ -308,8 +308,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1057,15 +1187,15 @@
|
||||
return this.bV;
|
||||
@@ -1072,15 +1202,15 @@
|
||||
return this.bW;
|
||||
}
|
||||
|
||||
- public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) {
|
||||
@@ -328,7 +328,7 @@
|
||||
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
|
||||
}
|
||||
|
||||
@@ -1093,6 +1223,34 @@
|
||||
@@ -1108,6 +1238,34 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -363,7 +363,7 @@
|
||||
|
||||
this.e(blockposition);
|
||||
this.sleepTicks = 0;
|
||||
@@ -1134,6 +1292,24 @@
|
||||
@@ -1148,6 +1306,24 @@
|
||||
((WorldServer) this.world).everyoneSleeping();
|
||||
}
|
||||
|
||||
@@ -388,19 +388,19 @@
|
||||
this.sleepTicks = flag ? 0 : 100;
|
||||
if (flag2) {
|
||||
optional.ifPresent((blockposition) -> {
|
||||
@@ -1187,9 +1363,11 @@
|
||||
@@ -1201,9 +1377,11 @@
|
||||
if (blockposition != null) {
|
||||
this.f = blockposition;
|
||||
this.g = flag;
|
||||
this.g = blockposition;
|
||||
this.bU = flag;
|
||||
+ this.spawnWorld = this.world.worldData.getName(); // CraftBukkit
|
||||
} else {
|
||||
this.f = null;
|
||||
this.g = false;
|
||||
this.g = null;
|
||||
this.bU = false;
|
||||
+ this.spawnWorld = ""; // CraftBukkit
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1261,7 +1439,11 @@
|
||||
@@ -1275,7 +1453,11 @@
|
||||
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
|
||||
this.aO = f;
|
||||
this.fallDistance = 0.0F;
|
||||
@@ -413,26 +413,28 @@
|
||||
} else {
|
||||
super.e(vec3d);
|
||||
}
|
||||
@@ -1580,24 +1762,29 @@
|
||||
}
|
||||
@@ -1597,26 +1779,31 @@
|
||||
|
||||
protected void releaseShoulderEntities() {
|
||||
- this.spawnEntityFromShoulder(this.getShoulderEntityLeft());
|
||||
- this.setShoulderEntityLeft(new NBTTagCompound());
|
||||
- this.spawnEntityFromShoulder(this.getShoulderEntityRight());
|
||||
- this.setShoulderEntityRight(new NBTTagCompound());
|
||||
+ // CraftBukkit start
|
||||
+ if (this.spawnEntityFromShoulder(this.getShoulderEntityLeft())) {
|
||||
+ this.setShoulderEntityLeft(new NBTTagCompound());
|
||||
+ }
|
||||
+ if (this.spawnEntityFromShoulder(this.getShoulderEntityRight())) {
|
||||
+ this.setShoulderEntityRight(new NBTTagCompound());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
if (this.e + 20L < this.world.getTime()) {
|
||||
- this.spawnEntityFromShoulder(this.getShoulderEntityLeft());
|
||||
- this.setShoulderEntityLeft(new NBTTagCompound());
|
||||
- this.spawnEntityFromShoulder(this.getShoulderEntityRight());
|
||||
- this.setShoulderEntityRight(new NBTTagCompound());
|
||||
+ // CraftBukkit start
|
||||
+ if (this.spawnEntityFromShoulder(this.getShoulderEntityLeft())) {
|
||||
+ this.setShoulderEntityLeft(new NBTTagCompound());
|
||||
+ }
|
||||
+ if (this.spawnEntityFromShoulder(this.getShoulderEntityRight())) {
|
||||
+ this.setShoulderEntityRight(new NBTTagCompound());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- private void spawnEntityFromShoulder(@Nullable NBTTagCompound nbttagcompound) {
|
||||
+ private boolean spawnEntityFromShoulder(@Nullable NBTTagCompound nbttagcompound) { // CraftBukkit void->boolean
|
||||
- private void spawnEntityFromShoulder(NBTTagCompound nbttagcompound) {
|
||||
+ private boolean spawnEntityFromShoulder(NBTTagCompound nbttagcompound) { // CraftBukkit void->boolean
|
||||
if (!this.world.isClientSide && !nbttagcompound.isEmpty()) {
|
||||
- EntityTypes.a(nbttagcompound, this.world).ifPresent((entity) -> {
|
||||
+ return EntityTypes.a(nbttagcompound, this.world).map((entity) -> { // CraftBukkit
|
||||
|
||||
Reference in New Issue
Block a user