From a8a4bedd2a9ef3c192ecf76db9afaf0b784ed08d Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 9 Jun 2016 11:43:49 +1000 Subject: Update to Minecraft 1.10 --- nms-patches/EntityHuman.patch | 70 ++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 38 deletions(-) (limited to 'nms-patches/EntityHuman.patch') diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch index 6c5c2bbe..e988303a 100644 --- a/nms-patches/EntityHuman.patch +++ b/nms-patches/EntityHuman.patch @@ -26,11 +26,11 @@ public Container activeContainer; - protected FoodMetaData foodData = new FoodMetaData(); + protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor - protected int bw; - public float bx; + protected int bx; public float by; -@@ -53,6 +66,17 @@ - private final ItemCooldown bV = this.l(); + public float bz; +@@ -52,6 +65,17 @@ + private final ItemCooldown bW = this.l(); public EntityFishingHook hookedFish; + // CraftBukkit start @@ -47,7 +47,7 @@ protected ItemCooldown l() { return new ItemCooldown(); } -@@ -302,7 +326,8 @@ +@@ -307,7 +331,8 @@ if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) { if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) { @@ -57,7 +57,7 @@ } if (this.foodData.c() && this.ticksLived % 10 == 0) { -@@ -326,7 +351,7 @@ +@@ -331,7 +356,7 @@ this.l((float) attributeinstance.getValue()); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); @@ -66,7 +66,7 @@ if (f > 0.1F) { f = 0.1F; -@@ -417,30 +442,36 @@ +@@ -423,28 +448,34 @@ public void b(Entity entity, int i) { if (entity != this) { this.addScore(i); @@ -91,12 +91,10 @@ while (iterator.hasNext()) { - ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next(); -- ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective); + // CraftBukkit start + // ScoreboardObjective scoreboardobjective = (ScoreboardObjective) iterator.next(); -+ // ScoreboardScore scoreboardscore = this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective); -- scoreboardscore.incrementScore(); +- this.getScoreboard().getPlayerScoreForObjective(this.getName(), scoreboardobjective).incrementScore(); + iterator.next().incrementScore(); + // CraftBukkit end } @@ -105,13 +103,11 @@ } - private Collection d(Entity entity) { -- String s = entity instanceof EntityHuman ? entity.getName() : entity.bd(); + private Collection d(Entity entity) { // CraftBukkit -+ String s = entity instanceof EntityHuman ? entity.getName() : entity.getUniqueID().toString(); + String s = entity instanceof EntityHuman ? entity.getName() : entity.bf(); ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName()); - if (scoreboardteam != null) { -@@ -464,7 +495,10 @@ +@@ -469,7 +500,10 @@ int j = scoreboardteam1.m().b(); if (j >= 0 && j < IScoreboardCriteria.m.length) { @@ -123,7 +119,7 @@ } } -@@ -473,6 +507,7 @@ +@@ -478,6 +512,7 @@ @Nullable public EntityItem a(boolean flag) { @@ -131,7 +127,7 @@ return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && this.inventory.getItemInHand() != null ? this.inventory.getItemInHand().count : 1), false, true); } -@@ -517,6 +552,30 @@ +@@ -522,6 +557,30 @@ entityitem.motZ += Math.sin((double) f1) * (double) f; } @@ -162,7 +158,7 @@ ItemStack itemstack1 = this.a(entityitem); if (flag1) { -@@ -615,6 +674,13 @@ +@@ -630,6 +689,13 @@ this.a(true, true, false); } @@ -176,7 +172,7 @@ if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) { this.e = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ")); this.f = nbttagcompound.getBoolean("SpawnForced"); -@@ -652,6 +718,12 @@ +@@ -667,6 +733,12 @@ this.foodData.b(nbttagcompound); this.abilities.a(nbttagcompound); nbttagcompound.set("EnderItems", this.enderChest.h()); @@ -189,7 +185,7 @@ } public boolean damageEntity(DamageSource damagesource, float f) { -@@ -670,7 +742,7 @@ +@@ -685,7 +757,7 @@ if (damagesource.r()) { if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) { @@ -198,21 +194,19 @@ } if (this.world.getDifficulty() == EnumDifficulty.EASY) { -@@ -682,7 +754,7 @@ +@@ -697,16 +769,35 @@ } } -- if (f == 0.0F) { -+ if (false && f == 0.0F) { // CraftBukkit - Don't filter out 0 damage - return false; - } else { - Entity entity = damagesource.getEntity(); -@@ -698,10 +770,29 @@ +- return f == 0.0F ? false : super.damageEntity(damagesource, f); ++ return super.damageEntity(damagesource, f); // CraftBukkit - Don't filter out 0 damage + } + } } public boolean a(EntityHuman entityhuman) { -- ScoreboardTeamBase scoreboardteambase = this.aO(); -- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aO(); +- ScoreboardTeamBase scoreboardteambase = this.aQ(); +- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aQ(); + // CraftBukkit start - Change to check OTHER player's scoreboard team according to API + // To summarize this method's logic, it's "Can parameter hurt this" + org.bukkit.scoreboard.Team team; @@ -240,7 +234,7 @@ } protected void damageArmor(float f) { -@@ -745,7 +836,12 @@ +@@ -750,7 +841,12 @@ return (float) i / (float) this.inventory.armor.length; } @@ -254,7 +248,7 @@ if (!this.isInvulnerable(damagesource)) { f = this.applyArmorModifier(damagesource, f); f = this.applyMagicModifier(damagesource, f); -@@ -765,6 +861,7 @@ +@@ -770,6 +866,7 @@ } } @@ -262,7 +256,7 @@ } public void openSign(TileEntitySign tileentitysign) {} -@@ -887,8 +984,15 @@ +@@ -894,8 +991,15 @@ if (entity instanceof EntityLiving) { f3 = ((EntityLiving) entity).getHealth(); if (j > 0 && !entity.isBurning()) { @@ -280,7 +274,7 @@ } } -@@ -918,8 +1022,11 @@ +@@ -925,8 +1029,11 @@ EntityLiving entityliving = (EntityLiving) iterator.next(); if (entityliving != this && entityliving != entity && !this.r(entityliving) && this.h(entityliving) < 9.0D) { @@ -293,7 +287,7 @@ } } -@@ -928,11 +1035,28 @@ +@@ -935,11 +1042,28 @@ } if (entity instanceof EntityPlayer && entity.velocityChanged) { @@ -322,7 +316,7 @@ } if (flag2) { -@@ -994,7 +1118,8 @@ +@@ -1001,7 +1125,8 @@ if (itemstack3 != null && object instanceof EntityLiving) { itemstack3.a((EntityLiving) object, this); @@ -332,7 +326,7 @@ this.a(EnumHand.MAIN_HAND, (ItemStack) null); } } -@@ -1004,7 +1129,14 @@ +@@ -1011,7 +1136,14 @@ this.a(StatisticList.y, Math.round(f5 * 10.0F)); if (j > 0) { @@ -348,7 +342,7 @@ } if (this.world instanceof WorldServer && f5 > 2.0F) { -@@ -1093,6 +1225,20 @@ +@@ -1100,6 +1232,20 @@ this.stopRiding(); } @@ -369,7 +363,7 @@ this.setSize(0.2F, 0.2F); if (this.world.isLoaded(blockposition)) { EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING); -@@ -1175,6 +1321,23 @@ +@@ -1184,6 +1330,23 @@ this.world.everyoneSleeping(); } @@ -393,7 +387,7 @@ this.sleepTicks = flag ? 0 : 100; if (flag2) { this.setRespawnPosition(this.bedPosition, false); -@@ -1226,9 +1389,11 @@ +@@ -1235,9 +1398,11 @@ if (blockposition != null) { this.e = blockposition; this.f = flag; -- cgit v1.2.3