aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKyle Wood <[email protected]>2021-04-24 22:07:27 -0500
committerKyle Wood <[email protected]>2021-04-25 18:37:52 -0500
commit4390af779c5e804c6a3e36959a8e4f8a75e3279e (patch)
tree872f096235569eca5ca3645ecd33a8a7a5018c17
parent3093b81fee3064603c368ab934eddf66ce304433 (diff)
downloadPaper-4390af779c5e804c6a3e36959a8e4f8a75e3279e.tar.gz
Paper-4390af779c5e804c6a3e36959a8e4f8a75e3279e.zip
New patches
-rw-r--r--Spigot-API-Patches/0001-Convert-project-to-Gradle.patch169
-rw-r--r--Spigot-Server-Patches/0001-Setup-Gradle-project.patch798
-rw-r--r--Spigot-Server-Patches/0002-Fix-remap.patch123
-rw-r--r--Spigot-Server-Patches/0003-Switch-to-AtomicInteger-for-chatSpamTickCount.patch47
4 files changed, 1137 insertions, 0 deletions
diff --git a/Spigot-API-Patches/0001-Convert-project-to-Gradle.patch b/Spigot-API-Patches/0001-Convert-project-to-Gradle.patch
new file mode 100644
index 0000000000..c7c27ef48d
--- /dev/null
+++ b/Spigot-API-Patches/0001-Convert-project-to-Gradle.patch
@@ -0,0 +1,169 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kyle Wood <[email protected]>
+Date: Thu, 10 Dec 2020 20:50:33 -0800
+Subject: [PATCH] Convert project to Gradle
+
+
+diff --git a/.gitignore b/.gitignore
+index e431e3435737e28394d81b56568a08b3c3148b9b..c484aff2c192bf42059b5689327909e4af654401 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,3 +1,5 @@
++.gradle/
++
+ # Eclipse stuff
+ /.classpath
+ /.project
+diff --git a/README.md b/README.md
+deleted file mode 100644
+index 31c5e1cdd15ceb0d79b293073dafc974b308d9d9..0000000000000000000000000000000000000000
+--- a/README.md
++++ /dev/null
+@@ -1,91 +0,0 @@
+-Bukkit
+-======
+-A plugin API for [Minecraft](https://minecraft.net/) servers, currently maintained by [SpigotMC](http://www.spigotmc.org/).
+-
+-#### Index
+-* [Bug Reporting](#bug-reporting)
+-* [Compilation](#compilation)
+-* [Contributing](#contributing)
+-* [Bukkit's Goals](#bukkits-goals)
+-* [Code Requirements](#code-requirements)
+-
+-Bug Reporting
+--------------
+-The development team is very open to both bug and feature requests / suggestions. You can submit these on the [JIRA Issue Tracker](http://hub.spigotmc.org/jira/).
+-
+-Compilation
+------------
+-Bukkit is a Java program which uses [Maven 3](http://maven.apache.org/) for compilation. To compile fresh from Git, simply perform the following steps:
+-
+-* Install Maven and Git using your preferred installation methods.
+-* `git clone https://hub.spigotmc.org/stash/scm/spigot/bukkit.git`.
+-* `mvn -P development clean install`.
+-
+-Some IDEs such as [NetBeans](https://netbeans.org/) can perform these steps for you. Any Maven capable Java IDE can be used to develop with Bukkit, however the current team's personal preference is to use NetBeans.
+-
+-Contributing
+-------------
+-Contributions of all sorts are welcome. To manage community contributions, we use the pull request functionality of Stash. In to gain access to Stash and create a pull request, you will first need to perform the following steps:
+-
+-* Create an account on [JIRA](http://hub.spigotmc.org/jira/).
+-* Fill in the [SpigotMC CLA](http://www.spigotmc.org/go/cla) and wait up to 24 hours for your Stash account to be activated. Please ensure that your username and email addresses match.
+-* Log into Stash using your JIRA credentials.
+-
+-Once you have performed these steps you can create a fork, push your code changes, and then submit it for review.
+-
+-If you submit a PR involving both Bukkit and CraftBukkit, each PR should link the other.
+-
+-Although the minimum requirement for compilation & usage is Java 8, we prefer all contributions to be written in Java 7 style code unless there is a compelling reason otherwise.
+-
+-Bukkit's Goals
+---------------
+-As a rough guideline, ask yourself the following questions to determine if the proposed change fits the Bukkit project's goals. Please remember that this is only a rough guideline
+-and it may or may not reflect the definitive answer to this question.
+-Discussions about proposed changes are held in the [Spigot IRC](https://www.spigotmc.org/wiki/irc-guide/).
+-
+-* Does it expose an implementation detail of the server software, or the protocol or file formats?
+-
+- 1. If your change revolves around an implementation detail then it is not proper API design. Examples of bad API design would be along the lines of
+- a packet API or an NBT storage API.
+-* Does it result in unexpected behaviour as defined by the Vanilla specification?
+- 1. One of the goals of the Bukkit project is to be an extended Minecraft Server. Meaning if you choose to run the Bukkit server without any plugin, it should function
+- exactly as the Minecraft Server would with some rare exceptions. If your change alters the behaviour of the server in such a way that you would not have the same experience as you
+- would in Vanilla, your change does not fit with the Bukkit project's goals.
+-* Does it expose an issue or vulnerability when operating within the Vanilla environment?
+- 1. One of the goals of the Bukkit project is to be able to operate within the limitations of the Vanilla environment. If your change results in, or exposes, the ability to, for example,
+- crash the client invalid data is set, it does not fit the Bukkit project's needs.
+-
+-If you answered yes to any of these questions, chances are high your change does not fit within the Bukkit project's goals and will likely not be accepted.
+-Regardless, there are a few other important questions that need to be asked before you start working on a change:
+-* Is this change reasonably supportable and maintainable?
+- 1. *Are there tests for this change? Does this change rely on magic numbers?*
+-* Is this change reasonably future proof?
+-
+-Code Requirements
+------------------
+-* For the most part, CraftBukkit and Bukkit use the [Sun/Oracle coding standards](http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html).
+-* No tabs; use 4 spaces instead.
+- * Empty lines should contain no spaces.
+-* No trailing whitespaces.
+-* No 80 character column limit, or 'weird' mid-statement newlines unless absolutely necessary.
+- * The 80 character column limit still applies to documentation.
+-* No one-line methods.
+-* All major additions should have documentation.
+-* Try to follow test driven development where available.
+-* All code should be free of magic values. If this is not possible, it should be marked with a TODO comment indicating it should be addressed in the future.
+- * If magic values are absolutely necessary for your change, what those values represent should be documented in the code as well as an explanation in the Pull Request description on why those values are necessary.
+-* No unnecessary code changes. Look through all your changes before you submit it.
+-* Do not attempt to fix multiple problems with a single patch or pull request.
+-* Avoid moving or renaming classes.
+-* All non-private methods and constructors must have specified nullability through [annotations](https://github.com/JetBrains/java-annotations)
+-
+-Bukkit/CraftBukkit employs [JUnit 4](http://www.vogella.com/articles/JUnit/article.html) for testing. Pull Requests(PR) should attempt to integrate within that framework as appropriate.
+-Bukkit is a large project and what seems simple to a PR author at the time of writing may easily be overlooked by other authors and updates. Including unit tests with your PR
+-will help to ensure the PR can be easily maintained over time and encourage the Spigot team to pull the PR.
+-
+-* There needs to be a new line at the end of every file.
+-* Imports should be organised in a logical manner.
+- * Do not group packages
+- * __Absolutely no wildcard imports outside of tests.__
+-
+-Any questions about these requirements can be asked in #spigot-dev in IRC.
+diff --git a/build.gradle.kts b/build.gradle.kts
+new file mode 100644
+index 0000000000000000000000000000000000000000..5cf81a0fdc112223d19a20c9be597b60e8a35173
+--- /dev/null
++++ b/build.gradle.kts
+@@ -0,0 +1,50 @@
++plugins {
++ `java-library`
++ checkstyle
++}
++
++java {
++ withSourcesJar()
++ withJavadocJar()
++}
++
++dependencies {
++ // api dependencies are listed transitively to API consumers
++ api("commons-lang:commons-lang:2.6")
++ api("com.google.guava:guava:21.0")
++ api("com.google.code.gson:gson:2.8.0")
++ api("net.md-5:bungeecord-chat:1.16-R0.4")
++ api("org.yaml:snakeyaml:1.27")
++
++ val annotations = "org.jetbrains:annotations-java5:20.1.0"
++ compileOnly(annotations)
++ testCompileOnly(annotations)
++
++ testImplementation("junit:junit:4.13.1")
++ testImplementation("org.hamcrest:hamcrest-library:1.3")
++ testImplementation("org.ow2.asm:asm-tree:9.1")
++
++ checkstyle("com.puppycrawl.tools:checkstyle:8.39")
++}
++
++tasks.jar {
++ manifest {
++ attributes += mapOf(
++ "Automatic-Module-Name" to "org.bukkit"
++ )
++ }
++}
++
++tasks.withType<Javadoc>().configureEach {
++ (options as StandardJavadocDocletOptions).links(
++ "https://guava.dev/releases/21.0/api/docs/",
++ "https://javadoc.io/doc/org.yaml/snakeyaml/1.27/",
++ "https://javadoc.io/doc/org.jetbrains/annotations-java5/20.1.0/",
++ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/"
++ )
++}
++
++checkstyle {
++ configFile = file("checkstyle.xml")
++ sourceSets = listOf(project.sourceSets.main.get(), project.sourceSets.test.get())
++}
diff --git a/Spigot-Server-Patches/0001-Setup-Gradle-project.patch b/Spigot-Server-Patches/0001-Setup-Gradle-project.patch
new file mode 100644
index 0000000000..8fcb482a5a
--- /dev/null
+++ b/Spigot-Server-Patches/0001-Setup-Gradle-project.patch
@@ -0,0 +1,798 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kyle Wood <[email protected]>
+Date: Thu, 10 Dec 2020 20:54:19 -0800
+Subject: [PATCH] Setup Gradle project
+
+
+diff --git a/.gitignore b/.gitignore
+index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a2f617b57 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,3 +1,6 @@
++.gradle/
++build/
++
+ # Eclipse stuff
+ /.classpath
+ /.project
+diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
+deleted file mode 100644
+index fd928f73a43f283ed379df98987600b0149eed55..0000000000000000000000000000000000000000
+--- a/CONTRIBUTING.md
++++ /dev/null
+@@ -1,53 +0,0 @@
+-Creating a Pull Request
+------------------------
+-##### Pull Request Title Example
+-The first line in a Pull Request(PR) message is an imperative statement briefly explaining what the PR is achieving.
+-If the PR fixes a bug, or implements a new feature as requested from the [JIRA](http://hub.spigotmc.org/jira/), then it should reference that ticket.
+-This is accomplished by simply type SPIGOT-####, where #### is the ticket number. (i.e. SPIGOT-3510).
+-You can reference multiple tickets in a single commit message; for example: "SPIGOT-1, SPIGOT-2" without the quotes.
+-
+-__For Example:__
+-* SPIGOT-3510: Velocity broken for certain entities
+-* MC-111753, SPIGOT-2971: Brewing stand not reloading
+-
+-As you can see, Minecraft tickets can be referenced by including the appropriate ticket number (i.e. MC-111753).
+-Where a pull request is spread across multiple repositories, please keep the title and first line of the commit message the same for each.
+-
+-##### Pull Request Message Expectations
+-The body of a PR needs to describe how the ticket was resolved, or if there was no ticket, describe the problem itself.
+-If a PR is for both Bukkit and CraftBukkit it should include a link to the appropriate PR. [Read this to learn how to link to a PR.](https://confluence.atlassian.com/bitbucketserver053/markdown-syntax-guide-938022413.html?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash#Markdownsyntaxguide-Linkingtopullrequests)
+-
+-##### Submitting the Changes
+-* Push your changes to a topic branch in your fork of the repository.
+-* Submit a pull request to the relevant repository in the Spigot organization.
+- * Make sure your pull request meets our [code requirements.](README.md)
+-* If you are fixing a JIRA ticket, be sure to update the ticket with a link to the pull request.
+- * All bug fixes must be accompanied by a JIRA ticket.
+-* Ensure all changes (including in patches) have our Minimal Diff Policy in mind.
+-
+-##### Pull Request Feedback
+-Spigot has a lot of Pull Requests open. Some of these are old and no longer maintained. As a general rule, we do not delete PRs because they are old or abandoned.
+-
+-You will eventually receive feedback on your Pull Requests. If the criticism is rough, do not take it personally. We have all started out, or just made bad PRs.
+-Take the advice and use it to make yourself better. If you think someone is being malicious contact an [admin](https://www.spigotmc.org/XenStaff/#Administrator).
+-
+-Feedback goes both ways. If you believe a feature should be present then be prepared to argue your case.
+-Per our Code Requirements, formatting issues are almost always required to be fixed before a PR is accepted.
+-
+-Although we have many discussions on Stash, there are also many discussions in the #spigot-dev channel of IRC.
+-Join us there if you plan on contributing to Spigot!
+-
+-##### Tips to Get Your Pull Request Accepted
+-Making sure to follow the conventions!
+-
+-* Your change should fit with Bukkit's goals.
+-* Make sure you follow our conventions to the letter.
+-* Check for formatting errors. They may be invisible, but [we notice.](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/298/diff)
+-* Provide proper JavaDocs where appropriate.
+- * JavaDocs should detail every limitation, caveat, and gotcha the code has.
+-* Provide proper accompanying documentation where appropriate.
+-* Test your code and provide adequate testing material and/or proof.
+- * For example: adding an event? Test it with a plugin and provide us with the source.
+-* Make sure you follow our conventions to the letter.
+-
+-__Note:__ The project is often on a code freeze leading up to the release of a Minecraft update in order to give the team a static code base to work with.
+diff --git a/README.md b/README.md
+deleted file mode 100644
+index b63c7eeddece8dc421ae4a0a254ed7bee9ad71c1..0000000000000000000000000000000000000000
+--- a/README.md
++++ /dev/null
+@@ -1,284 +0,0 @@
+-CraftBukkit
+-======
+-An implementation of the [Bukkit](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit) plugin API for [Minecraft](https://minecraft.net/) servers, currently maintained by [SpigotMC](http://www.spigotmc.org/).
+-
+-#### Index
+-
+-* [Bug Reporting](#bug-reporting)
+-* [Compilation](#compilation)
+-* [Contributing](#contributing)
+-* [Code Requirements](#code-requirements)
+- * [Applying Patches](#applying-patches)
+- * [Making Changes to Minecraft](#making-changes-to-minecraft)
+- * [Minimal Diff Policy](#minimal-diff-policy)
+- * [CraftBukkit Comments](#craftbukkit-comments)
+-* [Creating Pull Requests](#creating-pull-requests)
+-* [Useful Resources](#useful-resources)
+-
+-Bug Reporting
+--------------
+-The development team is very open to both bug and feature requests / suggestions. You can submit these on the [JIRA Issue Tracker](http://hub.spigotmc.org/jira/).
+-
+-Compilation
+------------
+-CraftBukkit is a Java program which uses [Maven 3](http://maven.apache.org/) for compilation. To compile fresh from Git, simply perform the following steps:
+-
+-* Install Git using your preferred installation methods.
+-* Download and run [BuildTools](https://www.spigotmc.org/wiki/buildtools/)
+-
+-Some IDEs such as [NetBeans](https://netbeans.org/) can perform these steps for you. Any Maven capable Java IDE can be used to develop with CraftBukkit, however the current team's personal preference is to use NetBeans.
+-
+-Contributing
+-------------
+-Contributions of all sorts are welcome. To manage community contributions, we use the pull request functionality of Stash. In to gain access to Stash and create a pull request, you will first need to perform the following steps:
+-
+-* Create an account on [JIRA](http://hub.spigotmc.org/jira/).
+-* Fill in the [SpigotMC CLA](http://www.spigotmc.org/go/cla) and wait up to 24 hours for your Stash account to be activated. Please ensure that your username and email addresses match.
+-* Log into Stash using your JIRA credentials.
+-
+-Once you have performed these steps you can create a fork, push your code changes, and then submit it for review.
+-
+-If you submit a PR involving both Bukkit and CraftBukkit, each PR should link the other.
+-
+-Although the minimum requirement for compilation & usage is Java 8, we prefer all contributions to be written in Java 7 style code unless there is a compelling reason otherwise.
+-
+-Code Requirements
+------------------
+-* For the most part, CraftBukkit and Bukkit use the [Sun/Oracle coding standards](http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html).
+-* No tabs; use 4 spaces instead.
+- * Empty lines should contain no spaces.
+-* No trailing whitespaces.
+-* No 80 character column limit, or 'weird' mid-statement newlines unless absolutely necessary.
+- * The 80 character column limit still applies to documentation.
+-* No one-line methods.
+-* All major additions should have documentation.
+-* Try to follow test driven development where available.
+-* All code should be free of magic values. If this is not possible, it should be marked with a TODO comment indicating it should be addressed in the future.
+- * If magic values are absolutely necessary for your change, what those values represent should be documented in the code as well as an explanation in the Pull Request description on why those values are necessary.
+-* No unnecessary code changes. Look through all your changes before you submit it.
+-* Do not attempt to fix multiple problems with a single patch or pull request.
+-* Do not submit your personal changes to configuration files.
+-* Avoid moving or renaming classes.
+-
+-Bukkit/CraftBukkit employs [JUnit 4](http://www.vogella.com/articles/JUnit/article.html) for testing. Pull Requests(PR) should attempt to integrate within that framework as appropriate.
+-Bukkit is a large project and what seems simple to a PR author at the time of writing may easily be overlooked by other authors and updates. Including unit tests with your PR
+-will help to ensure the PR can be easily maintained over time and encourage the Spigot team to pull the PR.
+-
+-* There needs to be a new line at the end of every file.
+-* Imports should be organised in a logical manner.
+- * Do not group packages
+- * All new imports should be within existing CraftBukkit comments if any are present. If not, make them.
+- * __Absolutely no wildcard imports outside of tests.__
+- * If you only use an import once, don't import it. Use the fully qualified name.
+-
+-Any questions about these requirements can be asked in #spigot-dev in IRC.
+-
+-Applying Patches
+-----------------
+-Any time new patches are created and/or updated in CraftBukkit, you need to apply them to your development environment.
+-
+-1. Pull changes from CraftBukkit repo.
+-2. Run the `applyPatches.sh` script in the CraftBukkit directory.
+- - This script requires a decompile directory from BuildTools. (e.g. <BuildTools Directory>/work/decompile-XXXXXX)
+-3. Your development environment is now up to date with the latest CraftBukkit patches!
+-
+-Making Changes to Minecraft
+----------------------------
+-Importing new NMS classes to CraftBukkit is actually very simple.
+-
+-1. Find the `work/decompile-XXXXXX` folder in your BuildTools folder.
+-2. Find the class you want to add in the `net/minecraft/server` folder and copy it.
+-3. Copy the selected file to the `src/main/java/net/minecraft/server` folder in CraftBukkit.
+-4. Implement changes.
+-5. Run `makePatches.sh` to create a new patch for the new class.
+- * _Be sure that Git recognizes the new file. This might require manually adding the file._
+-6. Commit new patch.
+-
+-Done! You have added a new patch for CraftBukkit!
+-
+-**Making Changes to NMS Classes**
+-
+-Bukkit/CB employs a Minimal Diff policy to help guide when changes should be changed to Minecraft and what those changes should be.
+-This is to ensure that any changes have the smallest impact possible on the update process whenever a new Minecraft version is released.
+-As well as the Minimal Diff Policy, *every* change made to a Minecraft class must be marked with the appropriate CraftBukkit comment.
+-At no point should you rename an existing/obfuscated field or method. All references to existing/obfusacted fields/methods should be marked with the `// PAIL rename` comment.
+-Mapping of new fields/methods are done when there are enough changes to warrant the work. (Any questions can be asked in #spigot-dev in [IRC](https://www.spigotmc.org/wiki/irc-guide/))
+-
+-__*Key Points*__:
+-* All additions to patches must be accompanied by an appropriate comment.
+-* To avoid large patches, avoid adding methods where possible. We prefer making fields public over adding methods in patches.
+- * If you *have* to add a method to a patch, please explain why in the Pull Request description.
+-* __Never__ rename an existing field or method. If you want something renamed, include a ```PAIL rename``` comment
+-* Converting a method/class from one access level to another (i.e. private to public) is fine as long as that method is not overridden in subclasses.
+- * If a method is overridden in its' subclasses, create a new method that calls that method instead (along with appropriate CraftBukkit comments).
+-* If you can use a field to accomplish something, use that over creating a new method.
+-
+-Minimal Diff Policy
+--------------------
+-
+-The Minimal Diff Policy is key to any changes made within Minecraft classes. When people think of the phrase "minimal diffs", they often take it
+-to the extreme - they go completely out of their way to abstract the changes they are trying to make away from editing Minecraft's classes as much as possible.
+-However, this is not what is meant by "minimal diffs". Instead, when trying to understand this policy, it helps to keep in mind its goal: to reduce the impact of changes we make
+-to Minecraft's internals have on our update process.
+-
+-To put it simply, the Minimal Diffs Policy simply means to make the smallest change in a Minecraft class possible without duplicating logic.
+-
+-Here are a few tips you should keep in mind, or common areas you should focus on:
+-
+-* Try to avoid duplicating logic or code when making changes.
+-* Try to keep your changes easily discernible - don't nest or group several unrelated changes together.
+- * All changes must be surrounded by [CraftBukkit comments](#craftbukkit-comments).
+-* If you only use an import once within a class, don't import it and use a fully qualified name instead.
+-* Try to employ "short-circuiting" of logic if at all possible. This means you should force a conditional to be the value needed to side step the code block to achieve your desired effect.
+-
+-__For example, to short circuit this:__
+-```java
+-if (!this.world.isClientSide && !this.isDead && (d0*d0) + d1 + (d2*d2) > 0.0D) {
+- this.die();
+- this.h();
+-}
+-```
+-__You would do this:__
+-```java
+-if (false && !this.world.isClientSide && !this.isDead && (d0*d0) + d1 + (d2*d2) > 0.0D) {
+- this.die();
+- this.h();
+-}
+-```
+-
+-* When adding a validation check, this applies everywhere not just in Minecraft classes, see if the Validate package has a better, more concise method you can use instead.
+- * The Preconditions package works just as well. Either are acceptable; though these are, by no means, the only accepted validation strategies.
+-
+-__For example, you should use:__
+-```java
+-Validate.notNull(sender, "Sender cannot be null");
+-```
+-__Instead of:__
+-```java
+-if (sender == null) {
+- throw new IllegalArgumentException("Sender cannot be null");
+-}
+-```
+-
+-* When the change you are trying to make involves removing code, or delegating it somewhere else, instead of removing it, you should comment it out.
+-
+-__For example:__
+-```java
+-// CraftBukkit start - special case dropping so we can get info from the tile entity
+-public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
+- if (world.random.nextFloat() < f) {
+- ItemStack itemstack = new ItemStack(Item.SKULL, 1, this.getDropData(world, i, j, k));
+- TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(i, j, k);
+-
+- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) {
+- itemstack.setTag(new NBTTagCompound());
+- itemstack.getTag().setString("SkullOwner", tileentityskull.getExtraType());
+- }
+-
+- this.b(world, i, j, k, itemstack);
+- }
+-}
+-// CraftBukkit end
+-
+-public void remove(World world, int i, int j, int k, int l, int i1) {
+- if (!world.isStatic) {
+- /* CraftBukkit start - drop item in code above, not here
+- if ((i1 & 8) == 0) {
+- ItemStack itemstack = new ItemStack(Item.SKULL, 1, this.getDropData(world, i, j, k));
+- TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(i, j, k);
+-
+- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) {
+- itemstack.setTag(new NBTTagCompound());
+- itemstack.getTag().setString("SkullOwner", tileentityskull.getExtraType());
+- }
+-
+- this.b(world, i, j, k, itemstack);
+- }
+- // CraftBukkit end */
+-
+- super.remove(world, i, j, k, l, i1);
+- }
+-}
+-```
+-
+-#### CraftBukkit Comments
+-
+-Changes to a Minecraft class should be clearly marked using CraftBukkit comments.
+-
+-* All CraftBukkit comments should be capitalised appropriately. (i.e. CraftBukkit, not CB/craftBukkit, etc.)
+-* If the change only affects one line of code, use an end of line CraftBukkit comment
+-
+-__Examples:__
+-
+-If the change is obvious, then you need a simple end of line comment.
+-```java
+-if (true || minecraftserver.getAllowNether()) { // CraftBukkit
+-```
+-
+-Every reference to an obfuscated field/method in NMS should be marked with:
+-```java
+-// PAIL rename newName
+-```
+-All PAIL rename comments must include a new name.
+-
+-If, however, the change is something important to note or difficult to discern, you should include a reason at the end of the comment
+-```java
+-public int fireTicks; // PAIL private -> public
+-```
+-Changing access levels must include a PAIL comment indicating the previous access level and the new access level.
+-
+-If adding the CraftBukkit comment negatively affects the readability of the code, then you should place the comment on a new line *above* the change you made.
+-```java
+-// CraftBukkit
+-if (!isEffect && !world.isStatic && world.difficulty >= 2 && world.areChunksLoaded(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2), 10)) {
+-```
+-
+-* If the change affects more than one line, you should use a multi-line CraftBukkit comment.
+-
+-__Example:__
+-
+-The majority of the time, multi-line changes should be accompanied by a reason since they're usually much more complicated than a single line change.
+-*If the change is something important to note or difficult to discern, you should include a reason at the end of line CraftBukkit comment.*
+-```java
+-// CraftBukkit start - special case dropping so we can get info from the tile entity
+-public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
+- if (world.random.nextFloat() < f) {
+- ItemStack itemstack = new ItemStack(Item.SKULL, 1, this.getDropData(world, i, j, k));
+- TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(i, j, k);
+-
+- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0) {
+- itemstack.setTag(new NBTTagCompound());
+- itemstack.getTag().setString("SkullOwner", tileentityskull.getExtraType());
+- }
+-
+- this.b(world, i, j, k, itemstack);
+- }
+-}
+-// CraftBukkit end
+-```
+-Otherwise, if the change is obvious, such as firing an event, then you can simply use a multi-line comment.
+-```java
+- // CraftBukkit start
+- BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null);
+- world.getServer().getPluginManager().callEvent(event);
+-
+- if (!event.isCancelled()) {
+- world.setTypeIdUpdate(i, j, k, Block.FIRE);
+- }
+- // CraftBukkit end
+-```
+-* All CraftBukkit comments should be on the same indentation level the code block it is in.
+-
+-__Imports in Minecraft Classes__
+-* Do not remove unused imports if they are not marked by CraftBukkit comments.
+-
+-Creating Pull Requests
+-----------------------
+-To learn what Spigot expects of a Pull Request please view the [Contributing guidelines](CONTRIBUTING.md)
+-
+-Useful Resources
+-----------------
+-
+-* [An example pull request demonstrating the things we look out for](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/365/overview)
+-* [JIRA, our bug tracker](http://hub.spigotmc.org/jira/)
+-* [Join us on IRC - #spigot-dev @ irc.spi.gt](https://www.spigotmc.org/wiki/irc-guide/)
+diff --git a/build.gradle.kts b/build.gradle.kts
+new file mode 100644
+index 0000000000000000000000000000000000000000..73df2d0ded415fc718ffb1ef7ca63fc9b9fc7ecd
+--- /dev/null
++++ b/build.gradle.kts
+@@ -0,0 +1,65 @@
++import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
++import java.time.Instant
++
++plugins {
++ java
++ id("com.github.johnrengelman.shadow")
++}
++
++val packageVersion = providers.gradleProperty("packageVersion").forUseAtConfigurationTime().get()
++
++repositories {
++ maven("https://libraries.minecraft.net/")
++}
++
++dependencies {
++ implementation(project(":Paper-API"))
++ implementation("jline:jline:2.12.1")
++ implementation("org.apache.logging.log4j:log4j-iostreams:2.8.1")
++ implementation("org.ow2.asm:asm:9.1")
++ implementation("com.googlecode.json-simple:json-simple:1.1.1") {
++ // This includes junit transitively for whatever reason
++ isTransitive = false
++ }
++ runtimeOnly("org.xerial:sqlite-jdbc:3.34.0")
++ runtimeOnly("mysql:mysql-connector-java:5.1.49")
++ testImplementation("junit:junit:4.13.1")
++ testImplementation("org.hamcrest:hamcrest-library:1.3")
++}
++
++tasks.jar {
++ manifest {
++ attributes(mapOf(
++ "Main-Class" to "org.bukkit.craftbukkit.Main",
++ "Implementation-Title" to "CraftBukkit",
++ "Implementation-Vendor" to Instant.now().epochSecond,
++ "Specification-Title" to "Bukkit",
++ "Specification-Version" to project.version,
++ "Specification-Vendor" to "Bukkit Team"
++ ))
++ for (tld in listOf("net", "com", "org")) {
++ attributes(mapOf(
++ "Sealed" to "true"
++ ), "$tld/bukkit")
++ }
++ }
++}
++
++tasks.shadowJar {
++ listOf(
++ "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io",
++ "org.apache.commons.lang3", "org.objectweb.asm"
++ ).forEach { pack ->
++ relocate(pack, "org.bukkit.craftbukkit.libs.$pack")
++ }
++ relocate("org.bukkit.craftbukkit", "org.bukkit.craftbukkit.v$packageVersion") {
++ exclude("org.bukkit.craftbukkit.Main*")
++ }
++ transform(AppendingTransformer::class.java) {
++ resource = "META-INF/services/java.sql.Driver"
++ }
++}
++
++tasks.test {
++ exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
++}
+diff --git a/pom.xml b/pom.xml
+deleted file mode 100644
+index ebce3da9abf550089ead322bc2cef359c803a434..0000000000000000000000000000000000000000
+--- a/pom.xml
++++ /dev/null
+@@ -1,355 +0,0 @@
+-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+- <modelVersion>4.0.0</modelVersion>
+- <groupId>org.spigotmc</groupId>
+- <artifactId>spigot</artifactId>
+- <packaging>jar</packaging>
+- <version>1.16.5-R0.1-SNAPSHOT</version>
+- <name>Spigot</name>
+- <url>https://www.spigotmc.org/</url>
+-
+- <properties>
+- <skipTests>true</skipTests>
+- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+- <api.version>unknown</api.version>
+- <bt.name>git</bt.name>
+- <minecraft.version>1.16.5</minecraft.version>
+- <minecraft_version>1_16_R3</minecraft_version>
+- <maven.compiler.source>1.8</maven.compiler.source>
+- <maven.compiler.target>1.8</maven.compiler.target>
+- </properties>
+-
+- <parent>
+- <groupId>org.spigotmc</groupId>
+- <artifactId>spigot-parent</artifactId>
+- <version>dev-SNAPSHOT</version>
+- <relativePath>../pom.xml</relativePath>
+- </parent>
+-
+- <dependencies>
+- <dependency>
+- <groupId>org.spigotmc</groupId>
+- <artifactId>spigot-api</artifactId>
+- <version>${project.version}</version>
+- <scope>compile</scope>
+- </dependency>
+- <dependency>
+- <groupId>org.spigotmc</groupId>
+- <artifactId>minecraft-server</artifactId>
+- <version>${minecraft.version}-SNAPSHOT</version>
+- <scope>compile</scope>
+- </dependency>
+- <dependency>
+- <groupId>jline</groupId>
+- <artifactId>jline</artifactId>
+- <version>2.12.1</version>
+- <scope>compile</scope>
+- </dependency>
+- <dependency>
+- <groupId>org.apache.logging.log4j</groupId>
+- <artifactId>log4j-iostreams</artifactId>
+- <version>2.8.1</version>
+- <scope>compile</scope>
+- <exclusions>
+- <!-- included in minecraft-server -->
+- <exclusion>
+- <groupId>org.apache.logging.log4j</groupId>
+- <artifactId>log4j-api</artifactId>
+- </exclusion>
+- </exclusions>
+- </dependency>
+- <dependency>
+- <groupId>org.ow2.asm</groupId>
+- <artifactId>asm</artifactId>
+- <version>9.1</version>
+- <scope>compile</scope>
+- </dependency>
+- <!-- deprecated API depend -->
+- <dependency>
+- <groupId>com.googlecode.json-simple</groupId>
+- <artifactId>json-simple</artifactId>
+- <version>1.1.1</version>
+- <scope>compile</scope>
+- </dependency>
+- <dependency>
+- <groupId>org.xerial</groupId>
+- <artifactId>sqlite-jdbc</artifactId>
+- <version>3.34.0</version>
+- <scope>runtime</scope>
+- </dependency>
+- <dependency>
+- <groupId>mysql</groupId>
+- <artifactId>mysql-connector-java</artifactId>
+- <version>5.1.49</version>
+- <scope>runtime</scope>
+- </dependency>
+- <!-- testing -->
+- <dependency>
+- <groupId>junit</groupId>
+- <artifactId>junit</artifactId>
+- <version>4.13.1</version>
+- <scope>test</scope>
+- </dependency>
+- <dependency>
+- <groupId>org.hamcrest</groupId>
+- <artifactId>hamcrest-library</artifactId>
+- <version>1.3</version>
+- <scope>test</scope>
+- </dependency>
+- </dependencies>
+-
+- <!-- This builds a completely 'ready to start' jar with all dependencies inside -->
+- <build>
+- <plugins>
+- <plugin>
+- <groupId>net.md-5</groupId>
+- <artifactId>scriptus</artifactId>
+- <version>0.4.1</version>
+- <executions>
+- <execution>
+- <id>ex-spigot</id>
+- <configuration>
+- <format>${bt.name}-Spigot-%s</format>
+- <scmDirectory>../</scmDirectory>
+- <descriptionProperty>spigot.desc</descriptionProperty>
+- </configuration>
+- <phase>initialize</phase>
+- <goals>
+- <goal>describe</goal>
+- </goals>
+- </execution>
+- <execution>
+- <id>ex-craftbukkit</id>
+- <configuration>
+- <format>-%s</format>
+- <scmDirectory>../../CraftBukkit</scmDirectory>
+- <descriptionProperty>craftbukkit.desc</descriptionProperty>
+- </configuration>
+- <phase>initialize</phase>
+- <goals>
+- <goal>describe</goal>
+- </goals>
+- </execution>
+- </executions>
+- </plugin>
+- <plugin>
+- <groupId>org.apache.maven.plugins</groupId>
+- <artifactId>maven-jar-plugin</artifactId>
+- <version>3.2.0</version>
+- <configuration>
+- <archive>
+- <manifest>
+- <addDefaultEntries>false</addDefaultEntries>
+- </manifest>
+- <manifestEntries>
+- <Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
+- <Implementation-Title>CraftBukkit</Implementation-Title>
+- <Implementation-Version>${spigot.desc}${craftbukkit.desc}</Implementation-Version>
+- <Implementation-Vendor>${project.build.outputTimestamp}</Implementation-Vendor>
+- <Specification-Title>Bukkit</Specification-Title>
+- <Specification-Version>${api.version}</Specification-Version>
+- <Specification-Vendor>Bukkit Team</Specification-Vendor>
+- </manifestEntries>
+- <manifestSections>
+- <manifestSection>
+- <name>net/bukkit/</name>
+- <manifestEntries>
+- <Sealed>true</Sealed>
+- </manifestEntries>
+- </manifestSection>
+- <manifestSection>
+- <name>com/bukkit/</name>
+- <manifestEntries>
+- <Sealed>true</Sealed>
+- </manifestEntries>
+- </manifestSection>
+- <manifestSection>
+- <name>org/bukkit/</name>
+- <manifestEntries>
+- <Sealed>true</Sealed>
+- </manifestEntries>
+- </manifestSection>
+- </manifestSections>
+- </archive>
+- </configuration>
+- </plugin>
+- <plugin>
+- <groupId>org.apache.maven.plugins</groupId>
+- <artifactId>maven-shade-plugin</artifactId>
+- <version>3.2.3</version>
+- <executions>
+- <execution>
+- <phase>package</phase>
+- <goals>
+- <goal>shade</goal>
+- </goals>
+- <configuration>
+- <createSourcesJar>${shadeSourcesJar}</createSourcesJar>
+- <filters>
+- <filter>
+- <artifact>org.spigotmc:minecraft-server</artifact>
+- <excludes>
+- <exclude>com/google/common/**</exclude>
+- <exclude>com/google/gson/**</exclude>
+- <exclude>com/google/thirdparty/**</exclude>
+- </excludes>
+- </filter>
+- </filters>
+- <relocations>
+- <!-- Cannot be relocated as it breaks translation property keys -->
+- <!--
+- <relocation>
+- <pattern>joptsimple</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.joptsimple</shadedPattern>
+- </relocation>
+- -->
+- <relocation>
+- <pattern>jline</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.jline</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>it.unimi</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.it.unimi</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>org.apache.commons.codec</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.codec</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>org.apache.commons.io</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.io</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>org.apache.commons.lang3</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.org.apache.commons.lang3</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>org.objectweb.asm</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.libs.org.objectweb.asm</shadedPattern>
+- </relocation>
+- <relocation>
+- <pattern>org.bukkit.craftbukkit</pattern>
+- <shadedPattern>org.bukkit.craftbukkit.v${minecraft_version}</shadedPattern>
+- <excludes>
+- <exclude>org.bukkit.craftbukkit.Main*</exclude>
+- </excludes>
+- </relocation>
+- <relocation>
+- <pattern>com/mojang/math/(.+/)*(.*)</pattern>
+- <shadedPattern>net/minecraft/server/v${minecraft_version}/$2</shadedPattern>
+- <rawString>true</rawString>
+- </relocation>
+- <relocation>
+- <pattern>net/minecraft/(.+/)*(.*)</pattern>
+- <shadedPattern>net/minecraft/server/v${minecraft_version}/$2</shadedPattern>
+- <rawString>true</rawString>
+- </relocation>
+- </relocations>
+- <transformers>
+- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+- <resource>META-INF/services/java.sql.Driver</resource>
+- </transformer>
+- </transformers>
+- </configuration>
+- </execution>
+- </executions>
+- </plugin>
+- <plugin>
+- <groupId>org.apache.maven.plugins</groupId>
+- <artifactId>maven-compiler-plugin</artifactId>
+- <version>3.8.1</version>
+- <configuration>
+- <!-- we use the Eclipse compiler as it doesn't need a JDK -->
+- <compilerId>eclipse</compilerId>
+- </configuration>
+- <dependencies>
+- <dependency>
+- <groupId>org.codehaus.plexus</groupId>
+- <artifactId>plexus-compiler-eclipse</artifactId>
+- <version>2.8.8</version>
+- </dependency>
+- <dependency>
+- <groupId>org.eclipse.jdt</groupId>
+- <artifactId>ecj</artifactId>
+- <version>3.24.0</version>
+- </dependency>
+- </dependencies>
+- </plugin>
+- <plugin>
+- <groupId>org.apache.maven.plugins</groupId>
+- <artifactId>maven-surefire-plugin</artifactId>
+- <version>2.12.4</version>
+- <configuration>
+- <workingDirectory>${basedir}/target/test-server</workingDirectory>
+- <excludes>
+- <exclude>org/bukkit/craftbukkit/inventory/ItemStack*Test.java</exclude>
+- </excludes>
+- </configuration>
+- </plugin>
+- </plugins>
+- </build>
+-
+- <profiles>
+- <profile>
+- <id>shadeSourcesJar</id>
+- <properties>
+- <shadeSourcesJar>true</shadeSourcesJar>
+- <shadeSourcesContent>true</shadeSourcesContent>
+- </properties>
+- </profile>
+- <profile>
+- <id>development</id>
+- <properties>
+- <skipTests>false</skipTests>
+- </properties>
+- <build>
+- <plugins>
+- <plugin>
+- <groupId>org.apache.maven.plugins</groupId>
+- <artifactId>maven-checkstyle-plugin</artifactId>
+- <version>3.1.1</version>
+- <executions>
+- <execution>
+- <phase>process-classes</phase>
+- <goals>
+- <goal>check</goal>
+- </goals>
+- </execution>
+- </executions>
+- <configuration>
+- <configLocation>checkstyle.xml</configLocation>
+- <includeTestSourceDirectory>true</includeTestSourceDirectory>
+- </configuration>
+- <dependencies>
+- <dependency>
+- <groupId>com.puppycrawl.tools</groupId>
+- <artifactId>checkstyle</artifactId>
+- <version>8.39</version>
+- </dependency>
+- </dependencies>
+- </plugin>
+- <plugin>
+- <groupId>org.codehaus.mojo</groupId>
+- <artifactId>animal-sniffer-maven-plugin</artifactId>
+- <version>1.19</version>
+- <executions>
+- <execution>
+- <phase>process-classes</phase>
+- <goals>
+- <goal>check</goal>
+- </goals>
+- </execution>
+- </executions>
+- <configuration>
+- <signature>
+- <groupId>org.codehaus.mojo.signature</groupId>
+- <artifactId>java18</artifactId>
+- <version>1.0</version>
+- </signature>
+- </configuration>
+- </plugin>
+- </plugins>
+- </build>
+- </profile>
+- </profiles>
+-</project>
diff --git a/Spigot-Server-Patches/0002-Fix-remap.patch b/Spigot-Server-Patches/0002-Fix-remap.patch
new file mode 100644
index 0000000000..f45b1379e9
--- /dev/null
+++ b/Spigot-Server-Patches/0002-Fix-remap.patch
@@ -0,0 +1,123 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kyle Wood <[email protected]>
+Date: Thu, 10 Dec 2020 22:37:28 -0800
+Subject: [PATCH] Fix remap
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+index 4a2fecdfbda34d6360d50e2ac017907a62b4a043..06921838c363fbcde8be9a55741538d3b3c9f6b0 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
++++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+@@ -236,7 +236,7 @@ public class Phantom extends FlyingMob implements Enemy {
+ List<Player> list = Phantom.this.level.getNearbyPlayers(this.attackTargeting, (LivingEntity) Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D));
+
+ if (!list.isEmpty()) {
+- list.sort(Comparator.comparing(Entity::getY).reversed());
++ list.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed()); // Paper remap fix
+ Iterator iterator = list.iterator();
+
+ while (iterator.hasNext()) {
+diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java
+index ad52c3fc6210939a39ef77a382c640a24ee44838..5d811797ce8e14195a23fc71c8a3afbdca7691eb 100644
+--- a/src/test/java/org/bukkit/DyeColorsTest.java
++++ b/src/test/java/org/bukkit/DyeColorsTest.java
+@@ -4,7 +4,6 @@ import static org.hamcrest.Matchers.*;
+ import static org.junit.Assert.*;
+ import java.util.ArrayList;
+ import java.util.List;
+-import net.minecraft.world.item.DyeColor;
+ import org.bukkit.support.AbstractTestingBase;
+ import org.junit.Test;
+ import org.junit.runner.RunWith;
+@@ -29,7 +28,7 @@ public class DyeColorsTest extends AbstractTestingBase {
+ @Test
+ public void checkColor() {
+ Color color = this.dye.getColor();
+- float[] nmsColorArray = DyeColor.byId(this.dye.getWoolData()).getTextureDiffuseColors();
++ float[] nmsColorArray = net.minecraft.world.item.DyeColor.byId(this.dye.getWoolData()).getTextureDiffuseColors();
+ Color nmsColor = Color.fromRGB((int) (nmsColorArray[0] * 255), (int) (nmsColorArray[1] * 255), (int) (nmsColorArray[2] * 255));
+ assertThat(color, is(nmsColor));
+ }
+@@ -37,7 +36,7 @@ public class DyeColorsTest extends AbstractTestingBase {
+ @Test
+ public void checkFireworkColor() {
+ Color color = this.dye.getFireworkColor();
+- int nmsColor = DyeColor.byId(this.dye.getWoolData()).getFireworkColor();
++ int nmsColor = net.minecraft.world.item.DyeColor.byId(this.dye.getWoolData()).getFireworkColor();
+ assertThat(color, is(Color.fromRGB(nmsColor)));
+ }
+ }
+diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java
+index 7970653bc14bed501bc16581027480bd057ca403..86b48662335640012f2cb6a2cb1e7e928d748173 100644
+--- a/src/test/java/org/bukkit/PerMaterialTest.java
++++ b/src/test/java/org/bukkit/PerMaterialTest.java
+@@ -41,7 +41,7 @@ public class PerMaterialTest extends AbstractTestingBase {
+
+ @BeforeClass
+ public static void getFireValues() {
+- PerMaterialTest.fireValues = Util.getInternalState(FireBlock.class, Blocks.FIRE, "flameChances");
++ PerMaterialTest.fireValues = Util.getInternalState(FireBlock.class, Blocks.FIRE, "flameOdds");
+ }
+
+ @Parameters(name = "{index}: {0}")
+@@ -222,7 +222,7 @@ public class PerMaterialTest extends AbstractTestingBase {
+ if (this.material.isBlock()) {
+ assertThat(this.material.isInteractable(),
+ is(!CraftMagicNumbers.getBlock(material).getClass()
+- .getMethod("interact", BlockState.class, net.minecraft.world.level.Level.class, BlockPos.class, Player.class, InteractionHand.class, BlockHitResult.class)
++ .getMethod("use", BlockState.class, net.minecraft.world.level.Level.class, BlockPos.class, Player.class, InteractionHand.class, BlockHitResult.class)
+ .getDeclaringClass().equals(BlockBehaviour.class)));
+ } else {
+ assertFalse(this.material.isInteractable());
+diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java
+index 8c4ad718e113f24a30fd11b345d34d6ca1ef73b0..085b0c17fb54fd8229838fee666120d9e59d942b 100644
+--- a/src/test/java/org/bukkit/entity/EntityTypesTest.java
++++ b/src/test/java/org/bukkit/entity/EntityTypesTest.java
+@@ -5,7 +5,6 @@ import java.util.Set;
+ import java.util.stream.Collectors;
+ import net.minecraft.core.Registry;
+ import net.minecraft.resources.ResourceLocation;
+-import net.minecraft.world.entity.EntityType;
+ import org.bukkit.support.AbstractTestingBase;
+ import org.junit.Assert;
+ import org.junit.Test;
+@@ -16,8 +15,8 @@ public class EntityTypesTest extends AbstractTestingBase {
+ public void testMaps() {
+ Set<EntityType> allBukkit = Arrays.stream(EntityType.values()).filter((b) -> b.getName() != null).collect(Collectors.toSet());
+
+- for (EntityType<?> nms : Registry.ENTITY_TYPE) {
+- ResourceLocation key = EntityType.getKey(nms);
++ for (net.minecraft.world.entity.EntityType<?> nms : Registry.ENTITY_TYPE) {
++ ResourceLocation key = net.minecraft.world.entity.EntityType.getKey(nms);
+
+ org.bukkit.entity.EntityType bukkit = org.bukkit.entity.EntityType.fromName(key.getPath());
+ Assert.assertNotNull("Missing nms->bukkit " + key, bukkit);
+diff --git a/src/test/java/org/bukkit/entity/PandaGeneTest.java b/src/test/java/org/bukkit/entity/PandaGeneTest.java
+index 76e2ad676ae68846bdff3c3ef711751445fb0f3c..bee1bd015f161a00df1311b6ef272739fcff6834 100644
+--- a/src/test/java/org/bukkit/entity/PandaGeneTest.java
++++ b/src/test/java/org/bukkit/entity/PandaGeneTest.java
+@@ -1,6 +1,5 @@
+ package org.bukkit.entity;
+
+-import net.minecraft.world.entity.animal.Panda;
+ import org.bukkit.craftbukkit.entity.CraftPanda;
+ import org.junit.Assert;
+ import org.junit.Test;
+@@ -10,7 +9,7 @@ public class PandaGeneTest {
+ @Test
+ public void testBukkit() {
+ for (Panda.Gene gene : Panda.Gene.values()) {
+- Panda.Gene nms = CraftPanda.toNms(gene);
++ net.minecraft.world.entity.animal.Panda.Gene nms = CraftPanda.toNms(gene);
+
+ Assert.assertNotNull("NMS gene null for " + gene, nms);
+ Assert.assertEquals("Recessive status did not match " + gene, gene.isRecessive(), nms.isRecessive());
+@@ -20,7 +19,7 @@ public class PandaGeneTest {
+
+ @Test
+ public void testNMS() {
+- for (Panda.Gene gene : Panda.Gene.values()) {
++ for (net.minecraft.world.entity.animal.Panda.Gene gene : net.minecraft.world.entity.animal.Panda.Gene.values()) {
+ org.bukkit.entity.Panda.Gene bukkit = CraftPanda.fromNms(gene);
+
+ Assert.assertNotNull("Bukkit gene null for " + gene, bukkit);
diff --git a/Spigot-Server-Patches/0003-Switch-to-AtomicInteger-for-chatSpamTickCount.patch b/Spigot-Server-Patches/0003-Switch-to-AtomicInteger-for-chatSpamTickCount.patch
new file mode 100644
index 0000000000..34c94f0209
--- /dev/null
+++ b/Spigot-Server-Patches/0003-Switch-to-AtomicInteger-for-chatSpamTickCount.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Kyle Wood <[email protected]>
+Date: Sat, 24 Apr 2021 20:50:38 -0500
+Subject: [PATCH] Switch to AtomicInteger for chatSpamTickCount
+
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+index 70b5ac18bcab5bbb46b1e206b512e5a1c8131748..861efdeb98bd7321afffe4780df7df1fadb2d9d9 100644
+--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+@@ -222,8 +222,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
+ private boolean keepAlivePending;
+ private long keepAliveChallenge;
+ // CraftBukkit start - multithreaded fields
+- private volatile int chatSpamTickCount;
+- private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(ServerGamePacketListenerImpl.class, "chatThrottle");
++ private final java.util.concurrent.atomic.AtomicInteger chatSpamTickCount = new java.util.concurrent.atomic.AtomicInteger(0); // Paper - switch to AtomicInteger
+ // CraftBukkit end
+ private int dropSpamTickCount;
+ private final Int2ShortMap expectedAcks = new Int2ShortOpenHashMap();
+@@ -351,7 +350,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
+
+ this.server.getProfiler().pop();
+ // CraftBukkit start
+- for (int spam; (spam = this.chatSpamTickCount) > 0 && !ServerGamePacketListenerImpl.chatSpamField.compareAndSet(this, spam, spam - 1); ) ;
++ for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; // Paper - switch to AtomicInteger
+ /* Use thread-safe field access instead
+ if (this.chatThrottle > 0) {
+ --this.chatThrottle;
+@@ -702,7 +701,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
+ public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
+ // CraftBukkit start
+- if (ServerGamePacketListenerImpl.chatSpamField.addAndGet(this, 1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
++ if (this.chatSpamTickCount.incrementAndGet() > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - switch to AtomicInteger
+ this.disconnect(new TranslatableComponent("disconnect.spam", new Object[0]));
+ return;
+ }
+@@ -1811,7 +1810,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
+ // Spigot end
+ // CraftBukkit start - replaced with thread safe throttle
+ // this.chatThrottle += 20;
+- if (counted && ServerGamePacketListenerImpl.chatSpamField.addAndGet(this, 20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Spigot
++ if (counted && this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Spigot // Paper - switch to AtomicInteger
+ if (!isSync) {
+ Waitable waitable = new Waitable() {
+ @Override