diff --git a/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch index 7e5ca9a179..146869c0ad 100644 --- a/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch +++ b/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch @@ -202,7 +202,7 @@ diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; * underscores, hyphens, and forward slashes. * */ diff --git a/Spigot-API-Patches/Add-sun-related-API.patch b/Spigot-API-Patches/Add-sun-related-API.patch index b3cd1380c1..586c0c4e03 100644 --- a/Spigot-API-Patches/Add-sun-related-API.patch +++ b/Spigot-API-Patches/Add-sun-related-API.patch @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + /** - * Returns whether the world has an ongoing storm. + * Gets the full in-game time on this world since the world generation * diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/Spigot-API-Patches/Adventure.patch b/Spigot-API-Patches/Adventure.patch index 2d698c606e..bd627f0591 100644 --- a/Spigot-API-Patches/Adventure.patch +++ b/Spigot-API-Patches/Adventure.patch @@ -308,7 +308,7 @@ diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; * underscores, hyphens, and forward slashes. * */ @@ -318,8 +318,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * The namespace representing all inbuilt keys. @@ -0,0 +0,0 @@ public final class NamespacedKey { - public static NamespacedKey minecraft(@NotNull String key) { - return new NamespacedKey(MINECRAFT, key); + public static NamespacedKey fromString(@NotNull String key) { + return fromString(key, null); } + + // Paper start diff --git a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch index 64f87ae33d..25a82c3c3c 100644 --- a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch @@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -0,0 +0,0 @@ public class CraftBlockEntityState extends CraftBlockState this.tileEntity = tileEntityClass.cast(world.getHandle().getTileEntity(this.getPosition())); - Preconditions.checkState(this.tileEntity != null, "Tile is null, asynchronous access? " + block); + Preconditions.checkState(this.tileEntity != null, "Tile is null, asynchronous access? %s", block); + // Paper start + this.snapshotDisabled = DISABLE_SNAPSHOT; diff --git a/Spigot-Server-Patches/Add-sun-related-API.patch b/Spigot-Server-Patches/Add-sun-related-API.patch index 20fe3bb188..ec4f07fb6b 100644 --- a/Spigot-Server-Patches/Add-sun-related-API.patch +++ b/Spigot-Server-Patches/Add-sun-related-API.patch @@ -32,8 +32,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Override - public boolean createExplosion(double x, double y, double z, float power) { - return createExplosion(x, y, z, power, false, true); + public long getGameTime() { + return world.worldData.getTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java diff --git a/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch b/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch index b7bd347a19..7be8315621 100644 --- a/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch +++ b/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch @@ -166,4 +166,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Paper end - private final Spigot spigot = new Spigot() + // Spigot start diff --git a/Spigot-Server-Patches/Adventure.patch b/Spigot-Server-Patches/Adventure.patch index 9a2b420fd6..ba4098d772 100644 --- a/Spigot-Server-Patches/Adventure.patch +++ b/Spigot-Server-Patches/Adventure.patch @@ -1826,14 +1826,6 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ import org.bukkit.Particle; - import org.bukkit.Sound; - import org.bukkit.Statistic; - import org.bukkit.WeatherType; --import org.bukkit.World; - import org.bukkit.block.data.BlockData; - import org.bukkit.configuration.serialization.DelegateDeserialization; - import org.bukkit.conversations.Conversation; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override @@ -2410,11 +2402,12 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.inventory; +@@ -0,0 +0,0 @@ + package org.bukkit.craftbukkit.inventory; import com.google.common.collect.ImmutableList; - import com.google.common.collect.Lists; -import com.google.common.collect.ImmutableMap.Builder; + import com.google.common.collect.Lists; + +import com.google.common.collect.ImmutableMap; // Paper import java.util.ArrayList; diff --git a/Spigot-Server-Patches/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/Spigot-Server-Patches/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch index 9ad6a06d86..8a16518afa 100644 --- a/Spigot-Server-Patches/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch +++ b/Spigot-Server-Patches/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch @@ -11,8 +11,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -0,0 +0,0 @@ public abstract class ChunkMapDistance { - long i = sectionposition.r().pair(); ObjectSet objectset = (ObjectSet) this.c.get(i); + if (objectset == null) return; // CraftBukkit - SPIGOT-6208 - objectset.remove(entityplayer); - if (objectset.isEmpty()) { diff --git a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch index a8cd8e38bb..b9229ed8a9 100644 --- a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch @@ -443,10 +443,11 @@ diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -0,0 +0,0 @@ package org.spigotmc; +@@ -0,0 +0,0 @@ + package org.spigotmc; import java.util.Collection; - import java.util.List; ++import java.util.List; + +import net.minecraft.server.Activity; import net.minecraft.server.AxisAlignedBB; @@ -634,7 +635,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ private static void activateChunkEntities(Chunk chunk) { -- for ( List slice : chunk.entitySlices ) +- for ( java.util.List slice : chunk.entitySlices ) - { - for ( Entity entity : (Collection) slice ) + // Paper start diff --git a/Spigot-Server-Patches/Fix-unregistering-entities-from-unloading-chunks.patch b/Spigot-Server-Patches/Fix-unregistering-entities-from-unloading-chunks.patch index e753c5fa81..18e9b12652 100644 --- a/Spigot-Server-Patches/Fix-unregistering-entities-from-unloading-chunks.patch +++ b/Spigot-Server-Patches/Fix-unregistering-entities-from-unloading-chunks.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } private void removeEntityFromChunk(Entity entity) { -- IChunkAccess ichunkaccess = this.getChunkAt(entity.chunkX, entity.chunkZ, ChunkStatus.FULL, false); +- IChunkAccess ichunkaccess = chunkProvider.getChunkUnchecked(entity.chunkX, entity.chunkZ); // CraftBukkit - SPIGOT-5228: getChunkAt won't find the entity's chunk if it has already been unloaded (i.e. if it switched to state INACCESSIBLE). + Chunk ichunkaccess = entity.getCurrentChunk(); // Paper - getChunkAt(x,z,full,false) is broken by CraftBukkit as it won't return an unloading chunk. Use our current chunk reference as this points to what chunk they need to be removed from anyways - if (ichunkaccess instanceof Chunk) { diff --git a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch index a353e25266..bd1cf11a9f 100644 --- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch @@ -158,9 +158,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end + + // Spigot start private final Spigot spigot = new Spigot() { - diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java diff --git a/Spigot-Server-Patches/Implemented-BlockFailedDispenseEvent.patch b/Spigot-Server-Patches/Implemented-BlockFailedDispenseEvent.patch index a41ecbfef3..bcf7aab3f3 100644 --- a/Spigot-Server-Patches/Implemented-BlockFailedDispenseEvent.patch +++ b/Spigot-Server-Patches/Implemented-BlockFailedDispenseEvent.patch @@ -40,34 +40,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import java.net.InetAddress; import java.util.ArrayList; import java.util.Collections; -@@ -0,0 +0,0 @@ import net.minecraft.server.EntityAnimal; - import net.minecraft.server.EntityAreaEffectCloud; - import net.minecraft.server.EntityDamageSource; - import net.minecraft.server.EntityDamageSourceIndirect; --import net.minecraft.server.EntityEnderCrystal; - import net.minecraft.server.EntityEnderDragon; - import net.minecraft.server.EntityExperienceOrb; - import net.minecraft.server.EntityFireworks; -@@ -0,0 +0,0 @@ import net.minecraft.server.EntityVillager; - import net.minecraft.server.EntityWaterAnimal; - import net.minecraft.server.EnumDirection; - import net.minecraft.server.EnumHand; --import net.minecraft.server.EnumItemSlot; - import net.minecraft.server.Explosion; - import net.minecraft.server.GeneratorAccess; - import net.minecraft.server.IBlockData; --import net.minecraft.server.IChatBaseComponent; - import net.minecraft.server.IInventory; - import net.minecraft.server.IProjectile; - import net.minecraft.server.ItemActionContext; -@@ -0,0 +0,0 @@ import net.minecraft.server.Unit; - import net.minecraft.server.World; - import net.minecraft.server.WorldServer; - import org.bukkit.Bukkit; --import org.bukkit.Location; - import org.bukkit.Material; - import org.bukkit.NamespacedKey; - import org.bukkit.Server; @@ -0,0 +0,0 @@ import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.Vehicle; import org.bukkit.entity.Villager; @@ -76,22 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.Event.Result; -@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityDeathEvent; - import org.bukkit.event.entity.EntityEnterLoveModeEvent; - import org.bukkit.event.entity.EntityPickupItemEvent; - import org.bukkit.event.entity.EntityPlaceEvent; --import org.bukkit.event.entity.EntityPortalEvent; - import org.bukkit.event.entity.EntityPotionEffectEvent; - import org.bukkit.event.entity.EntityShootBowEvent; - import org.bukkit.event.entity.EntitySpawnEvent; -@@ -0,0 +0,0 @@ import org.bukkit.inventory.EquipmentSlot; - import org.bukkit.inventory.InventoryView; - import org.bukkit.inventory.meta.BookMeta; - import org.bukkit.potion.PotionEffect; --import org.bukkit.projectiles.ProjectileSource; - - import org.bukkit.event.entity.SpawnerSpawnEvent; // Spigot - @@ -0,0 +0,0 @@ public class CraftEventFactory { return event; diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index 0ff68181ac..1a91cb496d 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -3993,24 +3993,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public final boolean isEntityTickingReady() { + return this.isEntityTickingReady; - } - ++ } ++ + public final boolean isTickingReady() { + return this.isTickingReady; + } + + public final boolean isFullChunkReady() { + return this.isFullChunkReady; -+ } + } + // Paper end -+ + // CraftBukkit start - public Chunk getFullChunk() { + public final Chunk getFullChunk() { // Paper - final for inline if (!getChunkState(this.oldTicketLevel).isAtLeast(PlayerChunk.State.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks - CompletableFuture> statusFuture = this.getStatusFutureUnchecked(ChunkStatus.FULL); - Either either = (Either) statusFuture.getNow(null); - return either == null ? null : (Chunk) either.left().orElse(null); + return this.getFullChunkUnchecked(); + } +@@ -0,0 +0,0 @@ public class PlayerChunk { + return (either == null) ? null : (Chunk) either.left().orElse(null); } // CraftBukkit end + // Paper start - "real" get full chunk immediately diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index 6439e257d5..afef859a46 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -687,9 +687,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); @@ -0,0 +0,0 @@ public final class CraftServer implements Server { - { return spigot; } + // Spigot end + + // Paper start + @SuppressWarnings({"rawtypes", "unchecked"}) diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index d00326ee00..5a70440870 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -42,9 +42,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.tileEntityListTick.remove(tileTickPosition--); + continue; + // Paper end - } - // Spigot start - finally { + // Spigot start + } finally { + tileentity.tickTimer.stopTiming(); @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { consumer.accept(entity); diff --git a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch index 61d21e3c18..49f6aabff4 100644 --- a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch @@ -134,7 +134,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } - // Kick all players -- for ( EntityPlayer p : (List< EntityPlayer>) MinecraftServer.getServer().getPlayerList().players ) +- for ( EntityPlayer p : (List) MinecraftServer.getServer().getPlayerList().players ) - { - p.playerConnection.disconnect(SpigotConfig.restartMessage); - } diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 6463d4f9d0..bfb2f83e43 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -1846,10 +1846,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java -deleted file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java -+++ /dev/null ++++ b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java @@ -0,0 +0,0 @@ -package org.bukkit.craftbukkit; - @@ -1921,7 +1920,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - String name = "Task: " + plugin + " Runnable: " + taskname; - if (period > 0) { -- name += "(interval:" + period +")"; +- name += "(interval:" + period + ")"; - } else { - name += "(Single)"; - } @@ -2120,13 +2119,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +import co.aikar.timings.NullTimingHandler; import org.bukkit.Bukkit; + import org.bukkit.plugin.Plugin; + import org.bukkit.scheduler.BukkitTask; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot -import org.spigotmc.CustomTimingsHandler; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper +import co.aikar.timings.Timing; // Paper - import org.bukkit.plugin.Plugin; - import org.bukkit.scheduler.BukkitTask; + + public class CraftTask implements BukkitTask, Runnable { // Spigot @@ -0,0 +0,0 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot */ private volatile long period; diff --git a/Spigot-Server-Patches/Tracking-Range-Improvements.patch b/Spigot-Server-Patches/Tracking-Range-Improvements.patch index f181870a56..035839bf0f 100644 --- a/Spigot-Server-Patches/Tracking-Range-Improvements.patch +++ b/Spigot-Server-Patches/Tracking-Range-Improvements.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if ( entity instanceof EntityPlayer ) { return config.playerTrackingRange; -- } else if ( entity.activationType == ActivationRange.ActivationType.MONSTER || entity.activationType == ActivationRange.ActivationType.RAIDER ) +- } else if ( entity.activationType == ActivationRange.ActivationType.MONSTER || entity.activationType == ActivationRange.ActivationType.RAIDER ) - { - return config.monsterTrackingRange; - } else if ( entity instanceof EntityGhast ) diff --git a/work/Bukkit b/work/Bukkit index 1b5ad2af5d..1e843b72bb 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 1b5ad2af5decf1d2cd276ae391d75a8ab1167b15 +Subproject commit 1e843b72bbd67b7b5ec785eae260fb00a5b64292 diff --git a/work/CraftBukkit b/work/CraftBukkit index 8049146227..b7eed25467 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 8049146227e4f8e44013f6b825ee91bdc7e3290f +Subproject commit b7eed25467eb583d77cda6a042387dc48fe14f97 diff --git a/work/Spigot b/work/Spigot index 89d6047d1a..73fb6094f4 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 89d6047d1aea78b9011ba38681663780a63233c9 +Subproject commit 73fb6094f4fa318955bb5bb11a1ec1af12cf90a1