diff options
Diffstat (limited to 'nms-patches')
28 files changed, 57 insertions, 66 deletions
diff --git a/nms-patches/BlockEnderPortal.patch b/nms-patches/BlockEnderPortal.patch index 2a6fd12d..478cb6af 100644 --- a/nms-patches/BlockEnderPortal.patch +++ b/nms-patches/BlockEnderPortal.patch @@ -12,7 +12,7 @@ @@ -37,6 +39,10 @@ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { - if (!entity.isPassenger() && !entity.isVehicle() && entity.bd() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) { + if (!entity.isPassenger() && !entity.isVehicle() && entity.bf() && !world.isClientSide && entity.getBoundingBox().c(iblockdata.e(world, blockposition).a(blockposition))) { + // CraftBukkit start - Entity in portal + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + world.getServer().getPluginManager().callEvent(event); diff --git a/nms-patches/BlockPortal.patch b/nms-patches/BlockPortal.patch index 62524aff..f9ccf2aa 100644 --- a/nms-patches/BlockPortal.patch +++ b/nms-patches/BlockPortal.patch @@ -19,7 +19,7 @@ + Entity entity = ItemMonsterEgg.spawnCreature(world, EntityTypes.getName(EntityPigZombie.class), (double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 1.1D, (double) blockposition1.getZ() + 0.5D, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL); if (entity != null) { - entity.portalCooldown = entity.aK(); + entity.portalCooldown = entity.aM(); @@ -70,14 +74,16 @@ BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(world, blockposition, EnumDirection.EnumAxis.X); @@ -44,7 +44,7 @@ @@ -108,6 +114,10 @@ public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { - if (!entity.isPassenger() && !entity.isVehicle() && entity.bd()) { + if (!entity.isPassenger() && !entity.isVehicle() && entity.bf()) { + // CraftBukkit start - Entity in portal + EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); + world.getServer().getPluginManager().callEvent(event); diff --git a/nms-patches/ChunkRegionLoader.patch b/nms-patches/ChunkRegionLoader.patch index b3850584..d4b0ba49 100644 --- a/nms-patches/ChunkRegionLoader.patch +++ b/nms-patches/ChunkRegionLoader.patch @@ -191,6 +191,6 @@ + public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { + if (world.addEntity(entity, reason) && entity.isVehicle()) { + // CraftBukkit end - Iterator iterator = entity.bD().iterator(); + Iterator iterator = entity.bF().iterator(); while (iterator.hasNext()) { diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch index 46a58b81..32e62d4c 100644 --- a/nms-patches/DedicatedServer.patch +++ b/nms-patches/DedicatedServer.patch @@ -98,7 +98,7 @@ + thread.setDaemon(true); thread.start(); - DedicatedServer.LOGGER.info("Starting minecraft server version 1.12-pre6"); + DedicatedServer.LOGGER.info("Starting minecraft server version 1.12"); @@ -79,7 +126,7 @@ } diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 11d14050..b0f9c0d4 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -111,7 +111,7 @@ + + if (this.al++ >= i) { + this.al = i; -+ this.portalCooldown = this.aK(); ++ this.portalCooldown = this.aM(); + byte b0; + + if (this.world.worldProvider.getDimensionManager().getDimensionID() == -1) { @@ -144,7 +144,7 @@ + public void Y() { this.world.methodProfiler.a("entityBaseTick"); - if (this.isPassenger() && this.bH().dead) { + if (this.isPassenger() && this.bJ().dead) { @@ -246,6 +361,8 @@ this.lastZ = this.locZ; this.lastPitch = this.pitch; @@ -439,7 +439,7 @@ entityitem.q(); @@ -1589,6 +1863,24 @@ - if (entity.bH() != this) { + if (entity.bJ() != this) { throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { + // CraftBukkit start @@ -460,11 +460,11 @@ + } + } + // CraftBukkit end - if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bC() instanceof EntityHuman)) { + if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bE() instanceof EntityHuman)) { this.passengers.add(0, entity); } else { @@ -1602,6 +1894,22 @@ - if (entity.bH() == this) { + if (entity.bJ() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { + // CraftBukkit start @@ -705,7 +705,7 @@ public float getHeadHeight() { @@ -2295,7 +2728,7 @@ - for (Iterator iterator = this.bD().iterator(); iterator.hasNext(); entity.a(oclass, set)) { + for (Iterator iterator = this.bF().iterator(); iterator.hasNext(); entity.a(oclass, set)) { entity = (Entity) iterator.next(); if (oclass.isAssignableFrom(entity.getClass())) { - set.add(entity); diff --git a/nms-patches/EntityCreature.patch b/nms-patches/EntityCreature.patch index 5e75f0a9..7813c998 100644 --- a/nms-patches/EntityCreature.patch +++ b/nms-patches/EntityCreature.patch @@ -21,7 +21,7 @@ @@ -76,6 +81,7 @@ - this.s(f); + this.q(f); if (f > 10.0F) { + this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.unleash(true, true); diff --git a/nms-patches/EntityCreeper.patch b/nms-patches/EntityCreeper.patch index 11864322..b29ed0a4 100644 --- a/nms-patches/EntityCreeper.patch +++ b/nms-patches/EntityCreeper.patch @@ -56,7 +56,7 @@ - this.aU = true; - this.world.explode(this, this.locX, this.locY, this.locZ, (float) this.explosionRadius * f, flag); - this.die(); -- this.dq(); +- this.ds(); + // CraftBukkit start + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), this.explosionRadius * f, false); + this.world.getServer().getPluginManager().callEvent(event); @@ -64,7 +64,7 @@ + this.aU = true; + this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag); + this.die(); -+ this.dq(); ++ this.ds(); + } else { + fuseTicks = 0; + } diff --git a/nms-patches/EntityFireball.patch b/nms-patches/EntityFireball.patch index 620ec367..e9e26fd1 100644 --- a/nms-patches/EntityFireball.patch +++ b/nms-patches/EntityFireball.patch @@ -52,14 +52,14 @@ this.locX += this.motX; @@ -150,6 +167,11 @@ } else { - this.av(); + this.ax(); if (damagesource.getEntity() != null) { + // CraftBukkit start + if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) { + return false; + } + // CraftBukkit end - Vec3D vec3d = damagesource.getEntity().aH(); + Vec3D vec3d = damagesource.getEntity().aJ(); if (vec3d != null) { @@ -163,6 +185,7 @@ diff --git a/nms-patches/EntityHanging.patch b/nms-patches/EntityHanging.patch index 02e4e1d9..1c6ff302 100644 --- a/nms-patches/EntityHanging.patch +++ b/nms-patches/EntityHanging.patch @@ -143,7 +143,7 @@ + // CraftBukkit end + this.die(); - this.av(); + this.ax(); this.a(damagesource.getEntity()); @@ -151,6 +199,18 @@ diff --git a/nms-patches/EntityHorseAbstract.patch b/nms-patches/EntityHorseAbstract.patch index ae678d96..58896b49 100644 --- a/nms-patches/EntityHorseAbstract.patch +++ b/nms-patches/EntityHorseAbstract.patch @@ -20,8 +20,8 @@ public void loadChest() { InventoryHorseChest inventoryhorsechest = this.inventoryChest; -- this.inventoryChest = new InventoryHorseChest("HorseChest", this.dl()); -+ this.inventoryChest = new InventoryHorseChest("HorseChest", this.dl(), this); // CraftBukkit +- this.inventoryChest = new InventoryHorseChest("HorseChest", this.dn()); ++ this.inventoryChest = new InventoryHorseChest("HorseChest", this.dn(), this); // CraftBukkit this.inventoryChest.a(this.getName()); if (inventoryhorsechest != null) { inventoryhorsechest.b(this); @@ -33,7 +33,7 @@ + return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 } - protected float co() { + protected float cq() { @@ -414,7 +416,7 @@ } @@ -68,7 +68,7 @@ + this.heal(1.0F, RegainReason.REGEN); // CraftBukkit } - if (this.dH()) { + if (this.dJ()) { @@ -723,6 +726,7 @@ if (this.getOwnerUUID() != null) { nbttagcompound.setString("OwnerUUID", this.getOwnerUUID().toString()); @@ -106,5 +106,5 @@ + } + // CraftBukkit end this.canSlide = true; - this.dr(); + this.dt(); } diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch index 24faf198..deaef2bb 100644 --- a/nms-patches/EntityHuman.patch +++ b/nms-patches/EntityHuman.patch @@ -63,7 +63,7 @@ if (this.foodData.c() && this.ticksLived % 10 == 0) { @@ -334,7 +359,7 @@ - this.m((float) attributeinstance.getValue()); + this.k((float) attributeinstance.getValue()); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); - float f1 = (float) (Math.atan(-this.motY * 0.20000000298023224D) * 15.0D); + float f1 = (float) ( org.bukkit.craftbukkit.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0D); // CraftBukkit @@ -153,8 +153,8 @@ } public boolean a(EntityHuman entityhuman) { -- ScoreboardTeamBase scoreboardteambase = this.aW(); -- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aW(); +- ScoreboardTeamBase scoreboardteambase = this.aY(); +- ScoreboardTeamBase scoreboardteambase1 = entityhuman.aY(); + // 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; diff --git a/nms-patches/EntityItem.patch b/nms-patches/EntityItem.patch index 50faa6a4..078275d7 100644 --- a/nms-patches/EntityItem.patch +++ b/nms-patches/EntityItem.patch @@ -74,7 +74,7 @@ + return false; + } + // CraftBukkit end - this.av(); + this.ax(); this.f = (int) ((float) this.f - f); if (this.f <= 0) { @@ -270,6 +289,26 @@ diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch index 84f0863c..cd95acf5 100644 --- a/nms-patches/EntityLiving.patch +++ b/nms-patches/EntityLiving.patch @@ -99,7 +99,7 @@ @@ -274,19 +323,19 @@ - protected void bM() { + protected void bO() { ++this.deathTicks; - if (this.deathTicks == 20) { + if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) @@ -587,12 +587,12 @@ + return this.isAlive() && !this.m_() && this.collides; // CraftBukkit } - protected void av() { + protected void ax() { @@ -2072,7 +2357,27 @@ protected void v() { if (!this.activeItem.isEmpty() && this.isHandRaised()) { this.b(this.activeItem, 16); -- this.a(this.cF(), this.activeItem.a(this.world, this)); +- this.a(this.cH(), this.activeItem.a(this.world, this)); + // CraftBukkit start - fire PlayerItemConsumeEvent + ItemStack itemstack; + if (this instanceof EntityPlayer) { @@ -612,9 +612,9 @@ + itemstack = this.activeItem.a(this.world, this); + } + -+ this.a(this.cF(), itemstack); ++ this.a(this.cH(), itemstack); + // CraftBukkit end - this.cL(); + this.cN(); } @@ -2151,10 +2456,18 @@ diff --git a/nms-patches/EntityMinecartAbstract.patch b/nms-patches/EntityMinecartAbstract.patch index 9c55d1e8..5f5d0706 100644 --- a/nms-patches/EntityMinecartAbstract.patch +++ b/nms-patches/EntityMinecartAbstract.patch @@ -53,7 +53,7 @@ + // CraftBukkit end this.e(-this.u()); this.d(10); - this.av(); + this.ax(); @@ -108,6 +141,15 @@ boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild; @@ -93,7 +93,7 @@ + if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled if (!this.isPassenger() && this.al++ >= i) { this.al = i; - this.portalCooldown = this.aK(); + this.portalCooldown = this.aM(); @@ -266,6 +316,18 @@ } diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index 32668f0a..b0f91e15 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -175,7 +175,7 @@ this.playerConnection.sendPacket(new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, flag)); - if (flag) { -- ScoreboardTeamBase scoreboardteambase = this.aW(); +- ScoreboardTeamBase scoreboardteambase = this.aY(); + // CraftBukkit start - fire PlayerDeathEvent + if (this.dead) { + return; @@ -205,7 +205,7 @@ + + if (deathMessage != null && deathMessage.length() > 0 && flag) { // TODO: allow plugins to override? + if (deathMessage.equals(deathmessage)) { -+ ScoreboardTeamBase scoreboardteambase = this.aW(); ++ ScoreboardTeamBase scoreboardteambase = this.aY(); + + if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != ScoreboardTeamBase.EnumNameTagVisibility.ALWAYS) { + if (scoreboardteambase.getDeathMessageVisibility() == ScoreboardTeamBase.EnumNameTagVisibility.HIDE_FOR_OTHER_TEAMS) { @@ -224,7 +224,7 @@ this.releaseShoulderEntities(); - if (!this.world.getGameRules().getBoolean("keepInventory") && !this.isSpectator()) { -- this.cT(); +- this.cV(); - this.inventory.o(); + // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. + if (!event.getKeepInventory()) { @@ -287,7 +287,7 @@ - private Collection<ScoreboardObjective> E(Entity entity) { + private Collection<ScoreboardScore> E(Entity entity) { // CraftBukkit - String s = entity instanceof EntityHuman ? entity.getName() : entity.bl(); + String s = entity instanceof EntityHuman ? entity.getName() : entity.bn(); ScoreboardTeam scoreboardteam = this.getScoreboard().getPlayerTeam(this.getName()); @@ -420,7 +539,10 @@ diff --git a/nms-patches/EntityWither.patch b/nms-patches/EntityWither.patch index 909781c9..c6a4a11e 100644 --- a/nms-patches/EntityWither.patch +++ b/nms-patches/EntityWither.patch @@ -14,8 +14,8 @@ private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b); @@ -192,13 +198,38 @@ - if (this.dk() > 0) { - i = this.dk() - 1; + if (this.dm() > 0) { + i = this.dm() - 1; if (i <= 0) { - this.world.createExplosion(this, this.locX, this.locY + (double) this.getHeadHeight(), this.locZ, 7.0F, false, this.world.getGameRules().getBoolean("mobGriefing")); - this.world.a(1023, new BlockPosition(this), 0); diff --git a/nms-patches/EntityZombieVillager.patch b/nms-patches/EntityZombieVillager.patch index 4bddae69..247d0227 100644 --- a/nms-patches/EntityZombieVillager.patch +++ b/nms-patches/EntityZombieVillager.patch @@ -11,7 +11,7 @@ @@ -60,6 +61,11 @@ public void B_() { if (!this.world.isClientSide && this.isConverting()) { - int i = this.ds(); + int i = this.du(); + // CraftBukkit start - Use wall time instead of ticks for villager conversion + int elapsedTicks = MinecraftServer.currentTick - this.lastTick; + this.lastTick = MinecraftServer.currentTick; diff --git a/nms-patches/FoodMetaData.patch b/nms-patches/FoodMetaData.patch index a83f70c2..121f388b 100644 --- a/nms-patches/FoodMetaData.patch +++ b/nms-patches/FoodMetaData.patch @@ -64,7 +64,7 @@ this.a(f); this.foodTickTimer = 0; } - } else if (flag && this.foodLevel >= 18 && entityhuman.dh()) { + } else if (flag && this.foodLevel >= 18 && entityhuman.dj()) { ++this.foodTickTimer; if (this.foodTickTimer >= 80) { - entityhuman.heal(1.0F); diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch index 6d92c5f2..acc5a36b 100644 --- a/nms-patches/HandshakeListener.patch +++ b/nms-patches/HandshakeListener.patch @@ -57,8 +57,8 @@ + } + // CraftBukkit end + - if (packethandshakinginsetprotocol.b() > 333) { - chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12-pre6"}); + if (packethandshakinginsetprotocol.b() > 335) { + chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.12"}); this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); @@ -26,6 +71,7 @@ this.b.close(chatmessage); diff --git a/nms-patches/MobEffectList.patch b/nms-patches/MobEffectList.patch index ea421e5b..cfe1bc3b 100644 --- a/nms-patches/MobEffectList.patch +++ b/nms-patches/MobEffectList.patch @@ -53,8 +53,8 @@ + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); + // CraftBukkit end } - } else if ((this != MobEffects.HEAL || entityliving.ca()) && (this != MobEffects.HARM || !entityliving.ca())) { - if (this == MobEffects.HARM && !entityliving.ca() || this == MobEffects.HEAL && entityliving.ca()) { + } else if ((this != MobEffects.HEAL || entityliving.cc()) && (this != MobEffects.HARM || !entityliving.cc())) { + if (this == MobEffects.HARM && !entityliving.cc() || this == MobEffects.HEAL && entityliving.cc()) { entityliving.damageEntity(DamageSource.MAGIC, (float) (6 << i)); } } else { diff --git a/nms-patches/NetworkManager.patch b/nms-patches/NetworkManager.patch index eac0071a..6e69467c 100644 --- a/nms-patches/NetworkManager.patch +++ b/nms-patches/NetworkManager.patch @@ -18,15 +18,7 @@ this.n = ichatbasecomponent; } -@@ -306,14 +306,14 @@ - if (this.j() != null) { - this.i().a(this.j()); - } else if (this.i() != null) { -- this.i().a(new ChatMessage("multiplayer.disconnect.banned", new Object[0])); -+ this.i().a(new ChatMessage("multiplayer.disconnect.generic", new Object[0])); - } - } - +@@ -313,7 +313,7 @@ } } diff --git a/nms-patches/PathfinderGoalHorseTrap.patch b/nms-patches/PathfinderGoalHorseTrap.patch index 54cb52b0..0aa10ae0 100644 --- a/nms-patches/PathfinderGoalHorseTrap.patch +++ b/nms-patches/PathfinderGoalHorseTrap.patch @@ -18,7 +18,7 @@ } @@ -42,7 +43,7 @@ - entityhorseskeleton.cU(); + entityhorseskeleton.cW(); entityhorseskeleton.setTamed(true); entityhorseskeleton.setAgeRaw(0); - entityhorseskeleton.world.addEntity(entityhorseskeleton); diff --git a/nms-patches/PathfinderGoalHurtByTarget.patch b/nms-patches/PathfinderGoalHurtByTarget.patch index 97a47f7f..bd1581bb 100644 --- a/nms-patches/PathfinderGoalHurtByTarget.patch +++ b/nms-patches/PathfinderGoalHurtByTarget.patch @@ -7,7 +7,7 @@ - this.e.setGoalTarget(this.e.getLastDamager()); + this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason this.g = this.e.getGoalTarget(); - this.b = this.e.bR(); + this.b = this.e.bT(); this.h = 300; @@ -66,6 +66,6 @@ } diff --git a/nms-patches/PathfinderGoalVillagerFarm.patch b/nms-patches/PathfinderGoalVillagerFarm.patch index 32dc8bd0..2600cea0 100644 --- a/nms-patches/PathfinderGoalVillagerFarm.patch +++ b/nms-patches/PathfinderGoalVillagerFarm.patch @@ -11,7 +11,7 @@ + } + // CraftBukkit end } else if (this.f == 1 && iblockdata.getMaterial() == Material.AIR) { - InventorySubcontainer inventorysubcontainer = this.c.do_(); + InventorySubcontainer inventorysubcontainer = this.c.dq(); @@ -49,19 +53,28 @@ boolean flag = false; diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index a2def129..1fb25841 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -339,8 +339,8 @@ + speed = player.abilities.walkSpeed * 10f; + } + - if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cN())) { - float f2 = this.player.cN() ? 300.0F : 100.0F; + if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cP())) { + float f2 = this.player.cP() ? 300.0F : 100.0F; - if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) { + if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) { @@ -417,7 +417,7 @@ + this.B = d12 >= -0.03125D; this.B &= !this.minecraftServer.getAllowFlight() && !this.player.abilities.canFly; - this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cN() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); + this.B &= !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.cP() && !worldserver.c(this.player.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); @@ -394,10 +675,76 @@ } @@ -701,7 +701,6 @@ } public void a(IChatBaseComponent ichatbasecomponent) { -- PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent); + // CraftBukkit start - Rarely it would send a disconnect line twice + if (this.processedDisconnect) { + return; @@ -709,7 +708,7 @@ + this.processedDisconnect = true; + } + // CraftBukkit end -+ PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent.toPlainText()); // CraftBukkit - Don't toString(). + PlayerConnection.LOGGER.info("{} lost connection: {}", this.player.getName(), ichatbasecomponent.toPlainText()); + // CraftBukkit start - Replace vanilla quit message handling with our own. + /* this.minecraftServer.aD(); diff --git a/nms-patches/World.patch b/nms-patches/World.patch index 377a4ccc..2337b695 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -374,7 +374,7 @@ + for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { + entity = (Entity) this.entityList.get(this.tickPosition); + // CraftBukkit end - Entity entity1 = entity.bH(); + Entity entity1 = entity.bJ(); if (entity1 != null) { @@ -1128,7 +1360,7 @@ @@ -471,7 +471,7 @@ entity.M = entity.locX; entity.N = entity.locY; @@ -1265,6 +1512,7 @@ - entity.aC(); + entity.aE(); } else { entity.B_(); + entity.postTick(); // CraftBukkit diff --git a/nms-patches/WorldGenRegistration.patch b/nms-patches/WorldGenRegistration.patch index 96462f92..63364bcb 100644 --- a/nms-patches/WorldGenRegistration.patch +++ b/nms-patches/WorldGenRegistration.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/server/WorldGenRegistration.java +++ b/net/minecraft/server/WorldGenRegistration.java @@ -157,7 +157,7 @@ - entitywitch.cU(); + entitywitch.cW(); entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F); entitywitch.prepare(world.D(new BlockPosition(i, j, k)), (GroupDataEntity) null); - world.addEntity(entitywitch); diff --git a/nms-patches/WorldGenVillagePieces.patch b/nms-patches/WorldGenVillagePieces.patch index 7a3e2c53..ca0efd5f 100644 --- a/nms-patches/WorldGenVillagePieces.patch +++ b/nms-patches/WorldGenVillagePieces.patch @@ -29,7 +29,7 @@ @@ -1672,14 +1672,14 @@ entityzombievillager.prepare(world.D(new BlockPosition(entityzombievillager)), (GroupDataEntity) null); entityzombievillager.setProfession(this.c(i1, 0)); - entityzombievillager.cU(); + entityzombievillager.cW(); - world.addEntity(entityzombievillager); + world.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason } else { |