From bb4ae3b3b8a36a90a6ac29746c5b6cb1351fc772 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 8 Jun 2017 18:00:00 +1000 Subject: [PATCH] Update to Minecraft 1.12 --- deprecation-mappings.csrg | 27 ------------------- nms-patches/BlockEnderPortal.patch | 2 +- nms-patches/BlockPortal.patch | 4 +-- nms-patches/ChunkRegionLoader.patch | 2 +- nms-patches/DedicatedServer.patch | 2 +- nms-patches/Entity.patch | 12 ++++----- nms-patches/EntityCreature.patch | 2 +- nms-patches/EntityCreeper.patch | 4 +-- nms-patches/EntityFireball.patch | 4 +-- nms-patches/EntityHanging.patch | 2 +- nms-patches/EntityHorseAbstract.patch | 10 +++---- nms-patches/EntityHuman.patch | 6 ++--- nms-patches/EntityItem.patch | 2 +- nms-patches/EntityLiving.patch | 10 +++---- nms-patches/EntityMinecartAbstract.patch | 4 +-- nms-patches/EntityPlayer.patch | 8 +++--- nms-patches/EntityWither.patch | 4 +-- nms-patches/EntityZombieVillager.patch | 2 +- nms-patches/FoodMetaData.patch | 2 +- nms-patches/HandshakeListener.patch | 4 +-- nms-patches/MobEffectList.patch | 4 +-- nms-patches/NetworkManager.patch | 10 +------ nms-patches/PathfinderGoalHorseTrap.patch | 2 +- nms-patches/PathfinderGoalHurtByTarget.patch | 2 +- nms-patches/PathfinderGoalVillagerFarm.patch | 2 +- nms-patches/PlayerConnection.patch | 9 +++---- nms-patches/World.patch | 4 +-- nms-patches/WorldGenRegistration.patch | 2 +- nms-patches/WorldGenVillagePieces.patch | 2 +- pom.xml | 6 ++--- .../org/bukkit/craftbukkit/CraftSound.java | 3 +++ .../craftbukkit/scoreboard/CraftTeam.java | 4 +-- 32 files changed, 65 insertions(+), 98 deletions(-) delete mode 100644 deprecation-mappings.csrg diff --git a/deprecation-mappings.csrg b/deprecation-mappings.csrg deleted file mode 100644 index 4c3077e03a..0000000000 --- a/deprecation-mappings.csrg +++ /dev/null @@ -1,27 +0,0 @@ -org/bukkit/Bukkit getOnlinePlayers ()[Lorg/bukkit/entity/Player; _INVALID_getOnlinePlayers -org/bukkit/Server getOnlinePlayers ()[Lorg/bukkit/entity/Player; _INVALID_getOnlinePlayers - -org/bukkit/entity/Damageable damage (I)V _INVALID_damage -org/bukkit/entity/Damageable damage (ILorg/bukkit/entity/Entity;)V _INVALID_damage -org/bukkit/entity/Damageable getHealth ()I _INVALID_getHealth -org/bukkit/entity/Damageable getMaxHealth ()I _INVALID_getMaxHealth -org/bukkit/entity/Damageable setHealth (I)V _INVALID_setHealth -org/bukkit/entity/Damageable setMaxHealth (I)V _INVALID_setMaxHealth - -org/bukkit/entity/LivingEntity getLastDamage ()I _INVALID_getLastDamage -org/bukkit/entity/LivingEntity setLastDamage (I)V _INVALID_setLastDamage - -org/bukkit/entity/Minecart getDamage ()I _INVALID_getDamage -org/bukkit/entity/Minecart setDamage (I)V _INVALID_setDamage - -org/bukkit/entity/Projectile getShooter ()Lorg/bukkit/entity/LivingEntity; _INVALID_getShooter -org/bukkit/entity/Projectile setShooter (Lorg/bukkit/entity/LivingEntity;)V _INVALID_setShooter - -org/bukkit/event/entity/EntityDamageEvent getDamage ()I _INVALID_getDamage -org/bukkit/event/entity/EntityDamageEvent setDamage (I)V _INVALID_setDamage - -org/bukkit/event/entity/EntityRegainHealthEvent getAmount ()I _INVALID_getAmount -org/bukkit/event/entity/EntityRegainHealthEvent setAmount (I)V _INVALID_setAmount - -org/bukkit/event/vehicle/VehicleDamageEvent getDamage ()I _INVALID_getDamage -org/bukkit/event/vehicle/VehicleDamageEvent setDamage (I)V _INVALID_setDamage diff --git a/nms-patches/BlockEnderPortal.patch b/nms-patches/BlockEnderPortal.patch index 2a6fd12d09..478cb6af0d 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 62524affbc..f9ccf2aa03 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 b385058406..d4b0ba4916 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 46a58b81ba..32e62d4c31 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 11d140506d..b0f9c0d40b 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 5e75f0a908..7813c99835 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 11864322ef..b29ed0a487 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 620ec367d4..e9e26fd1a7 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 02e4e1d918..1c6ff3029d 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 ae678d96c4..58896b499b 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 24faf19847..deaef2bba5 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 50faa6a41d..078275d7d9 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 84f0863ce4..cd95acf541 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 9c55d1e851..5f5d070600 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 32668f0a0c..b0f91e1570 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 E(Entity entity) { + private Collection 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 909781c9e1..c6a4a11eb6 100644 --- a/nms-patches/EntityWither.patch +++ b/nms-patches/EntityWither.patch @@ -14,8 +14,8 @@ private static final DataWatcherObject 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 4bddae697b..247d022703 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 a83f70c206..121f388b71 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 6d92c5f24e..acc5a36b79 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 ea421e5bee..cfe1bc3b34 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 eac0071a00..6e69467cae 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 54cb52b07e..0aa10ae063 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 97a47f7ff8..bd1581bbd3 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 32dc8bd0a2..2600cea082 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 a2def12947..1fb2584143 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 377a4ccc38..2337b6953f 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 96462f9224..63364bcb4e 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 7a3e2c5397..ca0efd5fad 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 { diff --git a/pom.xml b/pom.xml index 4df53c0bfb..a05827097e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,14 +4,14 @@ org.bukkit craftbukkit jar - 1.12-pre6-SNAPSHOT + 1.12-R0.1-SNAPSHOT CraftBukkit http://www.bukkit.org UTF-8 unknown - 1.12-pre6 + 1.12 1_12_R1 git-Bukkit- @@ -48,7 +48,7 @@ org.xerial sqlite-jdbc - 3.16.1 + 3.18.0 compile diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java index 9588ba11a7..8871c6f3a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -553,6 +553,9 @@ public enum CraftSound { RECORD_WAIT("record.wait"), RECORD_WARD("record.ward"), UI_BUTTON_CLICK("ui.button.click"), + UI_TOAST_CHALLENGE_COMPLETE("ui.toast.challenge_complete"), + UI_TOAST_IN("ui.toast.in"), + UI_TOAST_OUT("ui.toast.out"), WEATHER_RAIN("weather.rain"), WEATHER_RAIN_ABOVE("weather.rain.above"); private final String minecraftKey; diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java index a252b91b24..38db6c3dc2 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -76,7 +76,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { public ChatColor getColor() throws IllegalStateException { CraftScoreboard scoreboard = checkState(); - return CraftChatMessage.getColor(team.getColor()); // PAIL: rename + return CraftChatMessage.getColor(team.getColor()); } @Override @@ -84,7 +84,7 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { Validate.notNull(color, "Color cannot be null"); CraftScoreboard scoreboard = checkState(); - team.setColor(CraftChatMessage.getColor(color)); // PAIL: rename + team.setColor(CraftChatMessage.getColor(color)); } public boolean allowFriendlyFire() throws IllegalStateException {