9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Updated Upstream (Gale/Purpur)

This commit is contained in:
Dreeam
2024-01-21 08:41:41 -05:00
parent 31c020eea2
commit a923ad4c71
32 changed files with 608 additions and 582 deletions

60
.gitignore vendored
View File

@@ -2,58 +2,32 @@
core.*
hs_err_pid*
# Intellij
.idea/
*.iml
*.ipr
*.iws
out/
# Eclipse
.classpath
.project
.settings/
# netbeans
nbproject/
nbactions.xml
# Gradle
!gradle-wrapper.jar
.gradle/
build/
*/build/
# we use maven!
build.xml
# Maven
log/
target/
dependency-reduced-pom.xml
# various other potential build files
build/
bin/
dist/
manifest.mf
# vim
.*.sw[a-p]
# Mac
.DS_Store/
.DS_Store
# vim
.*.sw[a-p]
# Linux temp files
*~
# other stuff
run/
# Intellij
.idea
*.iml
# Gradle
!gradle/wrapper/gradle-wrapper.jar
.gradle
build
# Leaf
build-data
run
build-data/
Leaf-API
Leaf-MojangAPI
Leaf-Server
*.jar
/patches/todo/
paper-api-generator
patches/todo

View File

@@ -4,11 +4,11 @@ Leaf is happy you're willing to contribute to our projects. We are usually
very lenient with all submitted PRs, but there are still some guidelines you
can follow to make the approval process go more smoothly.
## Use a Personal Fork and not Organization
## Use a Personal Fork and not an Organization
Leaf will routinely modify your PR, whether it's a quick rebase or to take care
of any minor nitpicks we might have. Often, it's better for us to solve these
problems for you than make you go back and forth trying to fix it yourself.
problems for you than make you go back and forth trying to fix them yourself.
Unfortunately, if you use an organization for your PR, it prevents Leaf from
modifying it. This requires us to manually merge your PR, resulting in us
@@ -28,12 +28,12 @@ you will most likely use this for WSL), `homebrew` (macOS / Linux), and more:
- `git` (package `git` everywhere);
- A Java 17 or later JDK (packages vary, use Google/DuckDuckGo/etc.).
- [Adoptium](https://adoptium.net/) has builds for most operating systems.
- Paper requires JDK 17 to build, however makes use of Gradle's
[Toolchains](https://docs.gradle.org/current/userguide/toolchains.html)
feature to allow building with only JRE 8 or later installed. (Gradle will
automatically provision JDK 17 for compilation if it cannot find an existing
install).
- [Adoptium](https://adoptium.net/) has builds for most operating systems.
- Leaf requires JDK 17 to build, however, makes use of Gradle's
[Toolchains](https://docs.gradle.org/current/userguide/toolchains.html)
feature to allow building with only JRE 11 or later installed. (Gradle will
automatically provision JDK 17 for compilation if it cannot find an existing
install).
If you're on Windows, check
[the section on WSL](#patching-and-building-is-really-slow-what-can-i-do).
@@ -51,12 +51,13 @@ javac 17.0.1
## Understanding Patches
Leaf is mostly patches and extensions to Pufferfish. These patches/extensions are
Paper is mostly patches and extensions to Spigot. These patches/extensions are
split into different directories which target certain parts of the code. These
directories are:
- `Leaf-API` - Modifications to `Pufferfish-API`;
- `Leaf-Server` - Modifications to `Pufferfish`.
- `Leaf-API` - Modifications to `gale-api`/`Paper-API`;
- `Leaf-MojangAPI` - An API for [Mojang's Brigadier](https://github.com/Mojang/brigadier);
- `Leaf-Server` - Modifications to `Gale`/`Paper`.
Because the entire structure is based on patches and git, a basic understanding
of how to use git is required. A basic tutorial can be found here:
@@ -66,12 +67,12 @@ Assuming you have already forked the repository:
1. Clone your fork to your local machine;
2. Type `./gradlew applyPatches` in a terminal to apply the changes from upstream.
On Windows, leave out the `./` at the beginning for all `gradlew` commands;
3. cd into `Leaf-Server` for server changes, and `Leaf-API` for API changes.
<!--You can also run `./paper server` or `./paper api` for these same directories
On Windows, replace the `./` with `.\` at the beginning for all `gradlew` commands;
3. cd into `Leaf-Server` for server changes, and `Leaf-API` for API changes.
<!--You can also run `./leaf server` or `./leaf api` for these same directories
respectively.
1. You can also run `./paper setup`, which allows you to type `paper <command>`
from anywhere in the Paper structure in most cases.-->
1. You can also run `./leaf setup`, which allows you to type `leaf <command>`
from anywhere in the Leaf structure in most cases.-->
`Leaf-Server` and `Leaf-API` aren't git repositories in the traditional sense:
@@ -86,7 +87,7 @@ Adding patches to Leaf is very simple:
1. Type `git add .` inside these directories to add your changes;
1. Run `git commit` with the desired patch message;
1. Run `./gradlew rebuildPatches` in the main directory to convert your commit into a new
patch;
patch;
1. PR the generated patch file(s) back to this repository.
Your commit will be converted into a patch that you can then PR into Leaf.
@@ -110,27 +111,27 @@ edit it using `git rebase`.
> ideal nor intentional, but it happens. Feel free to fix this in a PR to us!
1. If you have changes you are working on, type `git stash` to store them for
later;
- You can type `git stash pop` to get them back at any point.
later;
- You can type `git stash pop` to get them back at any point.
1. Type `git rebase -i base`;
- It should show something like
[this](https://gist.github.com/zachbr/21e92993cb99f62ffd7905d7b02f3159) in
the text editor you get.
- If your editor does not have a "menu" at the bottom, you're using `vim`.
If you don't know how to use `vim` and don't want to
learn, enter `:q!` and press enter. Before redoing this step, do
`export EDITOR=nano` for an easier editor to use.
- It should show something like
[this](https://gist.github.com/zachbr/21e92993cb99f62ffd7905d7b02f3159) in
the text editor you get.
- If your editor does not have a "menu" at the bottom, you're using `vim`.
If you don't know how to use `vim` and don't want to
learn, enter `:q!` and press enter. Before redoing this step, do
`export EDITOR=nano` for an easier editor to use.
1. Replace `pick` with `edit` for the commit/patch you want to modify, and
"save" the changes;
- Only do this for **one** commit at a time.
"save" the changes;
- Only do this for **one** commit at a time.
1. Make the changes you want to make to the patch;
1. Type `git add .` to add your changes;
1. Type `git commit --amend` to commit;
- **Make sure to add `--amend`** or else a new patch will be created.
- You can also modify the commit message and author here.
- **Make sure to add `--amend`** or else a new patch will be created.
- You can also modify the commit message and author here.
1. Type `git rebase --continue` to finish rebasing;
1. Type `./gradlew rebuildPatches` in the root directory;
- This will modify the appropriate patches based on your commits.
- This will modify the appropriate patches based on your commits.
1. PR your modified patch file(s) back to this repository.
### Method 2 - Fixup commits
@@ -147,31 +148,31 @@ messing with your HEADs.
1. Make your change while at HEAD;
1. Make a temporary commit. You don't need to make a message for this;
1. Type `git rebase -i base`, move (cut) your temporary commit and
move it under the line of the patch you wish to modify;
move it under the line of the patch you wish to modify;
1. Change the `pick` to the appropriate action:
1. `f`/`fixup`: Merge your changes into the patch without touching the
message.
1. `s`/`squash`: Merge your changes into the patch and use your commit message
and subject.
1. `f`/`fixup`: Merge your changes into the patch without touching the
message.
1. `s`/`squash`: Merge your changes into the patch and use your commit message
and subject.
1. Type `./gradlew rebuildPatches` in the root directory;
- This will modify the appropriate patches based on your commits.
- This will modify the appropriate patches based on your commits.
1. PR your modified patch file(s) back to this repository.
#### Automatic method
1. Make your change while at HEAD;
1. Make a fixup commit. `git commit -a --fixup <hashOfPatchToFix>`;
- You can also use `--squash` instead of `--fixup` if you want the commit
message to also be changed.
- You can get the hash by looking at `git log` or `git blame`; your IDE can
assist you too.
- Alternatively, if you only know the name of the patch, you can do
`git commit -a --fixup "Subject of Patch name"`.
- You can also use `--squash` instead of `--fixup` if you want the commit
message to also be changed.
- You can get the hash by looking at `git log` or `git blame`; your IDE can
assist you too.
- Alternatively, if you only know the name of the patch, you can do
`git commit -a --fixup "Subject of Patch name"`.
1. Rebase with autosquash: `git rebase -i --autosquash base`.
This will automatically move your fixup commit to the right place, and you just
need to "save" the changes.
This will automatically move your fixup commit to the right place, and you just
need to "save" the changes.
1. Type `./gradlew rebuildPatches` in the root directory;
- This will modify the appropriate patches based on your commits.
- This will modify the appropriate patches based on your commits.
1. PR your modified patch file(s) back to this repository.
## Rebasing PRs
@@ -183,7 +184,7 @@ These steps assume the `origin` remote is your fork of this repository and `upst
1. Checkout feature/fix branch and rebase on master: `git checkout patch-branch && git rebase master`.
1. Apply updated patches: `./gradlew applyPatches`.
1. If there are conflicts, fix them.
1. If your PR creates new patches instead of modifying exist ones, in both the `Leaf-Server` and `Leaf-API` directories, ensure your newly-created patch is the last commit by either:
1. If your PR creates new patches instead of modifying existing ones, in both the `Leaf-Server` and `Leaf-API` directories, ensure your newly-created patch is the last commit by either:
* Renaming the patch file with a large 4-digit number in front (e.g. 9999-Patch-to-add-some-new-stuff.patch), and re-applying patches.
* Running `git rebase --interactive base` and moving the commits to the end.
1. Rebuild patches: `./gradlew rebuildPatches`.
@@ -203,37 +204,85 @@ when making and submitting changes.
## Formatting
All modifications to non-Leaf files should be marked.
All modifications to non-Leaf files should be marked. The one exception to this is
when modifying javadoc comments, which should not have these markers.
- Multi-line changes start with `// Leaf start` and end with `// Leaf end`;
- You can put a comment with an explanation if it isn't obvious, like this:
`// Leaf start - reason`.
- The comments should generally be about the reason the change was made, what
it was before, or what the change is.
- Multi-line messages should start with `// Leaf start` and use `/* Multi
line message here */` for the message itself.
- One-line changes should have `// Leaf` or `// Leaf - reason`.
- You need to add a comment with a short and identifiable description of the patch:
`// Leaf start - <COMMIT DESCRIPTION>`
- The comments should generally be about the reason the change was made, what
it was before, or what the change is.
- After the general commit description, you can add additional information either
after a `;` or in the next line.
- Multi-line changes start with `// Leaf start - <COMMIT DESCRIPTION>` and end
with `// Leaf end - <COMMIT DESCRIPTION>`.
- One-line changes should have `// Leaf - <COMMIT DESCRIPTION>` at the end of the line.
Here's an example of how to mark changes by Leaf:
```java
entity.getWorld().dontbeStupid(); // Leaf - was beStupid() which is bad
entity.getWorld().dontBeStupid(); // Leaf - Was beStupid(), which is bad
entity.getFriends().forEach(Entity::explode);
entity.a();
entity.b();
// Leaf start - use plugin-set spawn
entity.updateFriends();
// Leaf start - Use plugin-set spawn
// entity.getWorld().explode(entity.getWorld().getSpawn());
Location spawnLocation = ((CraftWorld)entity.getWorld()).getSpawnLocation();
entity.getWorld().explode(new BlockPosition(spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ()));
// Leaf end
// Leaf end - Use plugin-set spawn
```
We generally follow usual Java style (aka. Oracle style), or what is programmed
We generally follow the usual Java style (aka. Oracle style), or what is programmed
into most IDEs and formatters by default. There are a few notes, however:
- It is fine to go over 80 lines as long as it doesn't hurt readability.
There are exceptions, especially in Spigot-related files
There are exceptions, especially in Spigot-related files
- When in doubt or the code around your change is in a clearly different style,
use the same style as the surrounding code.
use the same style as the surrounding code.
### Imports
When adding new imports to a class in a file not created by the current patch, use the fully qualified class name
instead of adding a new import to the top of the file. If you are using a type a significant number of times, you
can add an import with a comment. However, if its only used a couple of times, the FQN is preferred to prevent future
patch conflicts in the import section of the file.
```java
import org.bukkit.event.Event;
// don't add import here, use FQN like below
public class SomeEvent extends Event {
public final org.bukkit.Location newLocation; // Leaf - add location
}
```
## Access Transformers
Sometimes, vanilla or CraftBukkit code already contains a field, method, or type you want to access
but the visibility is too low (e.g. a private field in an entity class). Leaf can use access transformers
to change the visibility or remove the final modifier from fields, methods, and classes. Inside the `build-data/paper.at`
file, you can add ATs that are applied when you `./gradlew applyPatches`. You can read about the format of ATs
[here](https://mcforge.readthedocs.io/en/latest/advanced/accesstransformers/#access-modifiers).
### Important
ATs should be included in the patch file which requires them within the commit message. Do not commit any changes to the
`build-data/paper.at` file, just use it to initially change the visibility of members until you have finalized what you
need. Then, in the commit message for the patch which requires the ATs, add a header at the bottom of the commit message
before any co-authors. It should look like the following after you `./gradlew rebuildPatches`.
```
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Wed, 8 Jun 2022 22:20:16 -0700
Subject: [PATCH] Paper config files
This patch adds Paper configuration files.
Access transformers for this patch are below, but before the co-authors.
== AT ==
public org.spigotmc.SpigotWorldConfig getBoolean(Ljava/lang/String;Z)Z
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
diff --git a/build.gradle.kts b/build.gradle.kts
...
```
## Patch Notes
@@ -309,7 +358,7 @@ what fits best in your situation.
## Configuration files
To use a configurable value in your patch, add a new field in either the
`GlobalConfiguration` or `WorldConfiguration` classes (inside the
`GlobalConfiguration` or `WorldConfiguration` classes (inside the
`io.papermc.paper.configuration` package). Use `GlobalConfiguration` if a value
must remain the same throughout all worlds, or the latter if it can change
between worlds. World-specific configuration options are preferred whenever
@@ -333,7 +382,7 @@ public class GlobalConfiguration {
You set the type of the setting as the field type, and the default value is the
initial field value. The name of the setting defaults to the snake-case of the
field name, so in this case it would be `misc.max-num-of-players`. You can use
the `@Setting` annotation to override that, but generally just try to set the
the `@Setting` annotation to override that, but generally just try to set the
field name to what you want the setting to be called.
#### Accessing the value
@@ -360,13 +409,13 @@ that includes the logic that uses that option in the server somewhere.
## Testing API changes
### Using the Leaf Test Plugin
### Using the Paper Test Plugin
The Leaf project has a `test-plugin` module for easily testing out API changes
The Paper project has a `test-plugin` module for easily testing out API changes
and additions. To use the test plugin, enable it in `test-plugin.settings.gradle.kts`,
which will be generated after running Gradle at least once. After this, you can edit
the test plugin, and run a server with the plugin using `./gradlew runDev` (or any
of the other Leaf run tasks).
of the other Paper run tasks).
### Publishing to Maven local (use in external plugins)
@@ -396,13 +445,13 @@ source directory, you just need to add it to our import script ran during the
patching process.
1. Save (rebuild) any patches you are in the middle of working on! Their
progress will be lost if you do not;
progress will be lost if you do not;
1. Identify the name(s) of the file(s) you want to import.
- A complete list of all possible file names can be found at
`./Leaf-Server/.gradle/caches/paperweight/mc-dev-sources/net/minecraft/`. You might find
[MappingViewer] useful if you need to translate between Mojang and Spigot mapped names.
- A complete list of all possible file names can be found at
`./Leaf-Server/.gradle/caches/paperweight/mc-dev-sources/net/minecraft/`. You might find
[MappingViewer] useful if you need to translate between Mojang and Spigot mapped names.
1. Open the file at `./build-data/dev-imports.txt` and add the name of your file to
the script. Follow the instructions there;
the script. Follow the instructions there;
1. Re-patch the server `./gradlew applyPatches`;
1. Edit away!
@@ -429,9 +478,9 @@ release, either update to Windows 10/11 or move to macOS/Linux/BSD.
In order to speed up patching process on Windows, it's recommended you get WSL
2. This is available in Windows 10 v2004, build 19041 or higher. (You can check
your version by running `winver` in the run window (Windows key + R)). If you're
using an out of date version of Windows 10, update your system with the
[Windows 10 Update Assistant](https://www.microsoft.com/en-us/software-download/windows10) or [Windows 11 Update Assistant](https://www.microsoft.com/en-us/software-download/windows11).
your version by running `winver` in the run window (Windows key + R)). If you're
using an out of date version of Windows 10, update your system with the
[Windows 10 Update Assistant](https://www.microsoft.com/en-us/software-download/windows10) or [Windows 11 Update Assistant](https://www.microsoft.com/en-us/software-download/windows11).
To set up WSL 2, follow the information here:
<https://docs.microsoft.com/en-us/windows/wsl/install>
@@ -446,4 +495,4 @@ everything like usual.
> in Windows like described here:
> <https://docs.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer>
[MappingViewer]: https://nms.screamingsandals.org/
[MappingViewer]: https://mappings.cephx.dev/

View File

@@ -74,5 +74,12 @@ paperweight {
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Leaf-Server"))
}
patchTasks.register("generatedApi") {
isBareDirectory = true
upstreamDirPath = "paper-api-generator/generated"
patchDir = layout.projectDirectory.dir("patches/generated-api")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}
}
}

View File

@@ -1,7 +1,7 @@
group = org.dreeam.leaf
version = 1.20.4-R0.1-SNAPSHOT
galeCommit = d4340c647e85de9bdf5f29eb56b25e1b04fd1f66
galeCommit = 469ba1180160d3c9bf3fae917262ab56dfad1cf3
org.gradle.caching = true
org.gradle.parallel = true

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Commit: de54530c93353462042e18e37f791298257ce2f7
Commit: 3d52f066c1bf1fc61d86164993fd7cac94ca5dce
Patches below are removed in this patch:
Pufferfish-API-Changes.patch
@@ -16,29 +16,6 @@ Remove-Timings.patch
Add-log-suppression-for-LibraryLoader.patch
Fire-Immunity-API.patch
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 0c4dbb9ef63fa8575b5546239443cb2bd91ba847..b347224c223569297ee67ac630a710fdf28748ea 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -198,6 +198,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));
+ // Purpur start
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
+ // Purpur end
+
/**
* @deprecated removed in 1.20.2
*/
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
--- a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
@@ -578,10 +555,10 @@ index b39a5ca6f4fa32d76acafd1fdd5b5af8954e34a4..1e7e16d33a57d930276a07096a58be2f
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index d3081d4445af73c2c7b23c5fc60861f184ac808e..e4f0d5ee85371374453b837947c7f84c7731128c 100644
index bf4b94ea2577e9d7e344385209fc0644a4e6bfbb..eea802fbee51e919595f6501161bf2fd58d6a1c1 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4174,6 +4174,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4172,6 +4172,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -1298,10 +1275,10 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 0217f98a74140bbae454d467de27c12b6060ca75..444b021691ea90ee3c87f4e47d4e8c48ef404a8f 100644
index f680545b6b59bf8d2ad154b0472dda4cba42a162..3709ff939acdcaec124c2875a37c4a07745cdaab 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -355,4 +355,15 @@ public interface ItemFactory {
@@ -353,4 +353,15 @@ public interface ItemFactory {
*/
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
// Paper end - enchantWithLevels API
@@ -1978,7 +1955,7 @@ index 36e3fbc727cd748aa138f52976154ba32954cd87..623bebf9964cff02728bf4270f082b6a
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index 523818cbb0d6c90481ec97123e7fe0e2ff4eea14..bfeb8171a723d84b94bfaacd8aaf7d4d48ecd051 100644
index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199899bd364 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -10,6 +10,7 @@ import java.util.function.Predicate;

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Github Actions <no-reply@github.com>
Date: Sun, 21 Jan 2024 08:34:10 -0500
Subject: [PATCH] Purpur generated-api Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Commit: 3d52f066c1bf1fc61d86164993fd7cac94ca5dce
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 069f2668f5229b0368b796e65eef1648fba0a097..9b991201a2f6cc9feccccf7f4e7bcded64117764 100644
--- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -442,6 +442,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
+ // Purpur start
+ GoalKey<Mob> MOB_HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
+ GoalKey<Llama> LLAMA_HAS_RIDER = GoalKey.of(Llama.class, NamespacedKey.minecraft("llama_has_rider"));
+ GoalKey<Phantom> FIND_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal"));
+ GoalKey<Phantom> ORBIT_CRYSTAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal"));
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
+ GoalKey<Wolf> AVOID_RABID_WOLF = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolf"));
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
+ // Purpur end
+
/**
* Removed in 1.20.2
*/

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index dfd92a33497785f28c7ade16da900f7bb851cada..941105ef0413f058a9a212a141ef8be9f5cce50f 100644
index fefe852c5376274f606ededeaf6c741f43ab19f9..936c738fcaa8e97c36d0742d2398d63c20cd2f68 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,7 +15,7 @@ val alsoShade: Configuration by configurations.creating
@@ -17,7 +17,7 @@ index dfd92a33497785f28c7ade16da900f7bb851cada..941105ef0413f058a9a212a141ef8be9
// Depend on Paper MojangAPI
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
exclude("io.papermc.paper", "paper-api")
@@ -87,7 +87,7 @@ tasks.jar {
@@ -86,7 +86,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -73,7 +73,7 @@ index e45e6b44b2a8f2cdae6e0048a812b92126aa17ca..b5f3f213da8a40d5184098af017c8e26
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c712427d5eda3b4c1f6968836da594f193f189b4..22734bad2fd73fbac5cc3e62de36a5c2cbfde9dc 100644
index ff6b3392390036ad4caa9da3f519a25bd8373493..2b6e7808b518476903302d4f2214dbd2f09125fb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -942,7 +942,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -86,7 +86,7 @@ index c712427d5eda3b4c1f6968836da594f193f189b4..22734bad2fd73fbac5cc3e62de36a5c2
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 37ccd8632b4f78dedee322c12ed8aa580b817ae1..91bf517b233c4bfc10094db216d7dd2db2cbf958 100644
index 00ac6a86d3d40364332b5839bc497dd7bf6ed395..6eb24411388dc80dea275850e2693940e5306e98 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -267,7 +267,7 @@ import javax.annotation.Nullable; // Paper

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Leaf Config
diff --git a/build.gradle.kts b/build.gradle.kts
index 941105ef0413f058a9a212a141ef8be9f5cce50f..60929e246b9347eb17162bace30106683fc45363 100644
index 936c738fcaa8e97c36d0742d2398d63c20cd2f68..830161ffd2f109cc5bd78a59e3b42eed382f8de5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -57,6 +57,13 @@ dependencies {
@@ -56,6 +56,13 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
@@ -38,7 +38,7 @@ index f749516e5d3c22e808638f3a7672aab837571b1a..61fc65624f7d9a3bfa399a58112efb7f
new TimingsExport(listeners, parent, history).start();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 08d82f8592714eac92ead36b98460de6ff607cfe..fc017f554147eaaee5c436ede2595bccd6b8fd7f 100644
index 55df8e8108c09fba4aa9754264eae758142b21cb..fc3217cfee8d13c3b3f4c6948c484bc992b116bf 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -232,6 +232,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

View File

@@ -30,10 +30,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 56ee1c3061c854d9b3fdd096c4c70eee909f0f74..628c553e0580400a8e08396def8c4db3ed1682a9 100644
index 508d22f505bdc277520900c92fd6d96eb23990e7..997cd2387ea2de9ba081eb0664e5658ac93542fc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -886,6 +886,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -885,6 +885,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
this.timings.entityTick.startTiming(); // Spigot
this.entityTickList.forEach((entity) -> {
@@ -42,10 +42,10 @@ index 56ee1c3061c854d9b3fdd096c4c70eee909f0f74..628c553e0580400a8e08396def8c4db3
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8684e769b1658aa2d8fe598b77c3f99129a1962d..83a0767d4f285b944471b3dddac70270792d10f5 100644
index d5606d5cc2ebe75c21925071663ea013824c7af6..4190ed6911357839386818cd8717dea66d8c95c0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -440,6 +440,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -442,6 +442,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// Paper end
@@ -58,7 +58,7 @@ index 8684e769b1658aa2d8fe598b77c3f99129a1962d..83a0767d4f285b944471b3dddac70270
return this.yRot;
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..d1201c4f6625d56bfa9f329fbb32bea1ff2bcb56 100644
index e52f3da3b63cc3dba59d3e874a8420dd312b5e96..72fdd85426872ac096eabfd273239e112e08826c 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -305,6 +305,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@@ -70,7 +70,7 @@ index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..d1201c4f6625d56bfa9f329fbb32bea1
private String descriptionId;
@Nullable
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index ad6a159f5472059c1550c36dd98d83af01bbe31a..0fa8fc1cbedf0b65c7695d604bfc78c7ef2c2c41 100644
index 465cfffbbc5db5fb2c95e953db09d3169b52060d..2888eb09566852a2989b6776d74c3a49e8586aac 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -227,10 +227,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -153,7 +153,7 @@ index 26731a659fe3c40fc20135d473bacf105cc15300..c521ff04be40bfa892021f67acc1b324
AllayAi.updateActivity(this);
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index 91bde1774cc9e7a323ffd2c943b6656101b232a1..53e932cd13d4d06d81cb3d41b433b8b03375b3b9 100644
index 207d41b91bc02d94c5b40799619f7314ef84e41d..d0c624a6a000c2a41e41d14dd785a7bf9612afe8 100644
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -275,8 +275,10 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder<Axolo
@@ -198,7 +198,7 @@ index 0f3a11203dd0353d74626a273e9003131356f5e1..c83dabddf93249a6477c10725622119c
TadpoleAi.updateActivity(this);
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index 4df3f237e4b3bc27e1be66d1e593d4f619873c7e..7b946ea210eebcab3d373b13e09ff839e49cfbe5 100644
index c6ff7c756aff281e7de094c05749740370988fe5..d75178611f2c74af45e39c9e37770e2c56773b1d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -191,8 +191,10 @@ public class Goat extends Animal {
@@ -213,7 +213,7 @@ index 4df3f237e4b3bc27e1be66d1e593d4f619873c7e..7b946ea210eebcab3d373b13e09ff839
GoatAi.updateActivity(this);
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
index 024e2da8673a837a1185351bb211414e19a7f393..3ddcd9e7533724e9b3c7b89afd0bbe2009421fa5 100644
index c97a3c7060b846aa92a730760e3428ba98919879..f270c54028867ae0026bba3f214c3da6d015befb 100644
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -128,8 +128,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
@@ -228,7 +228,7 @@ index 024e2da8673a837a1185351bb211414e19a7f393..3ddcd9e7533724e9b3c7b89afd0bbe20
HoglinAi.updateActivity(this);
if (this.isConverting()) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
index 57d7873290fc361d8c5c094e166416772fe11cbe..e25456327e510c0b4fac3b1974aa6f3e45b1a995 100644
index 104f3ed9230f6397bfe306b7fbfb9893b7c8e94d..2eeb23ce4125b2538e92e19bf73f55398d2dbfc0 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -300,8 +300,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@@ -243,7 +243,7 @@ index 57d7873290fc361d8c5c094e166416772fe11cbe..e25456327e510c0b4fac3b1974aa6f3e
PiglinAi.updateActivity(this);
super.customServerAiStep();
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 206701dd16f0e5850bc2384388a0a3a746a1b74e..fd2811b0d7cd0f9ff165c5116fe268c4cfe01cce 100644
index b73bccfcb1b94936f500926a06a28a6a134bbc33..5cad15c512919ce6b0cae9f45e9011dd66134622 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -273,10 +273,12 @@ public class Warden extends Monster implements VibrationSystem {
@@ -260,7 +260,7 @@ index 206701dd16f0e5850bc2384388a0a3a746a1b74e..fd2811b0d7cd0f9ff165c5116fe268c4
super.customServerAiStep();
if ((this.tickCount + this.getId()) % 120 == 0) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 53da46274f3cb2767b20e6959e2a0d01c1899750..ad8aad31c748bd813634abd8de4a75f89d8389f0 100644
index 5f585a955a876fe2452a0bf1c7caa0ad7e58d1d6..07fb53a908f8b10b40017f083648fdc47f2d6150 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -144,6 +144,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -357,7 +357,7 @@ index 5d161351e7517acf57e98203bab8c9f9ab9d4005..634a4e46022f1d63a67c64f19f255538
private static void network() {
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index c7058fb8dc39a534e9403b3392547f6d925f2851..1275d4ecc7c2dca1d82b2da883717ef7561d520d 100644
index 9ae73480c06003f7073fc571c61943c64f466616..ece01155a8281fb40ae3696d511fb317d68635aa 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -40,6 +40,9 @@ import net.minecraft.world.level.Level;
@@ -372,7 +372,7 @@ index c7058fb8dc39a534e9403b3392547f6d925f2851..1275d4ecc7c2dca1d82b2da883717ef7
{
@@ -237,6 +240,25 @@ public class ActivationRange
}
// Paper end - configurable marker ticking
// Paper end - Configurable marker ticking
ActivationRange.activateEntity(entity);
+
+ // Pufferfish start

View File

@@ -7,10 +7,10 @@ Original license: GPL v3
Original project: https://github.com/pufferfish-gg/Pufferfish
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 83a0767d4f285b944471b3dddac70270792d10f5..e62d19bb841779684bb3a3ffb34f7bb0939303be 100644
index 4190ed6911357839386818cd8717dea66d8c95c0..293ed3942268c4ae915c0331e3988ce9dcd83306 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -813,6 +813,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -815,6 +815,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public void tick() {
@@ -24,7 +24,7 @@ index 83a0767d4f285b944471b3dddac70270792d10f5..e62d19bb841779684bb3a3ffb34f7bb0
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index d1201c4f6625d56bfa9f329fbb32bea1ff2bcb56..cf90ecefea3586d0ce236288ab515bfa67239814 100644
index 72fdd85426872ac096eabfd273239e112e08826c..f772f7c4cd41ec52bea53d619b5b953971825df0 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -306,6 +306,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT

File diff suppressed because it is too large Load Diff

View File

@@ -7,10 +7,10 @@ Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fe3ad5d2acec094e9f363acb418233a2756fd0c3..a58b37b576888f865259e647fb30624fa99361bd 100644
index 2e8c390a0b1a4342bfdfca5bee3a2eeef2ac9beb..3e38c0b186d49ecb8e3408f7c005da37cc64e1c9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1856,7 +1856,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1842,7 +1842,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {

View File

@@ -926,7 +926,7 @@ index dab211c458311869c61779305580a1c7da830f71..0ddcf3652a2cc9e0cc28f672f103ec7e
@Override
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
index c5c734b9eb80d1cdf0e9fd8a043f2b6d1f4cbffe..68ef0398e1b517dd9fd2def43d7d87e4be42ec84 100644
index 3e2d5dcd62775b6ed7c0ce0ba51a71b635b1d644..deca974c2a82bc341fe23ea46f61f42f04432755 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
@@ -49,8 +49,8 @@ public class PacketUtils {
@@ -941,7 +941,7 @@ index c5c734b9eb80d1cdf0e9fd8a043f2b6d1f4cbffe..68ef0398e1b517dd9fd2def43d7d87e4
} catch (Exception exception) {
label25:
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7aa04723a 100644
index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c10dfbb4f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -178,8 +178,6 @@ import org.bukkit.craftbukkit.Main;
@@ -961,7 +961,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Purpur start
if (upnp) {
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
@@ -1343,7 +1340,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1337,7 +1334,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
protected void waitUntilNextTick() {
@@ -970,7 +970,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
this.managedBlock(() -> {
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
@@ -1412,8 +1409,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1406,8 +1403,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return;
}
@@ -979,7 +979,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
for (;;) {
boolean moreTasks = this.tickMidTickTasks();
long currTime = System.nanoTime();
@@ -1438,9 +1433,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1432,9 +1427,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return;
}
}
@@ -989,7 +989,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
}
// Paper end - execute chunk tasks mid tick
@@ -1513,15 +1505,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1507,15 +1499,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -1007,7 +1007,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Paper end
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper
@@ -1555,11 +1546,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1549,11 +1540,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end
io.papermc.paper.util.CachedLists.reset(); // Paper
@@ -1019,7 +1019,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Paper start
long endTime = System.nanoTime();
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
@@ -1581,7 +1567,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1575,7 +1561,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
this.logTickTime(l - i);
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -1027,7 +1027,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
}
private int computeNextAutosaveInterval() {
@@ -1643,9 +1628,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1637,9 +1622,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
entityplayer.connection.suspendFlushing();
});
@@ -1037,14 +1037,14 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
getAllLevels().forEach(level -> {
@@ -1661,20 +1644,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1655,20 +1638,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
- MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
this.getFunctions().tick();
- MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
// Run tasks that are waiting on processing
@@ -1058,15 +1058,15 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates
for (final ServerLevel level : this.getAllLevels()) {
@@ -1694,7 +1672,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1688,7 +1666,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end
- MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
this.isIteratingOverLevels = true; // Paper
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
net.minecraft.network.FriendlyByteBuf.hasItemSerializeEvent = org.purpurmc.purpur.event.packet.NetworkItemSerializeEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
@@ -1714,14 +1691,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1708,14 +1685,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end */
try {
@@ -1079,11 +1079,11 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
// Paper end
- worldserver.timings.doTick.stopTiming(); // Spigot
} catch (Throwable throwable) {
// Spigot Start
CrashReport crashreport;
@@ -1741,21 +1716,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -1727,21 +1702,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
this.isIteratingOverLevels = false; // Paper
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
- MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper
this.getConnection().tick();
@@ -1103,7 +1103,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
iterator = this.playerList.getPlayers().iterator();
@@ -1765,7 +1734,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1751,7 +1720,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.chunkSender.sendNextChunks(entityplayer);
entityplayer.connection.resumeFlushing();
}
@@ -1112,7 +1112,7 @@ index a58b37b576888f865259e647fb30624fa99361bd..149a786b38d999730a05931ea5dc69a7
private void synchronizeTime(ServerLevel world) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index f690b0b56bdaf78ce1e64445f14018b705eb3c37..3db403505f2829680648e9ff2bc2c1288b4e70cf 100644
index 0a59c30f84e2b7b77ec1ebc9bf307524408999e0..40118a13b6b66c56313432cf8dcb6f3dea976ae9 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -57,7 +57,6 @@ import org.apache.logging.log4j.Level;
@@ -1166,7 +1166,7 @@ index f690b0b56bdaf78ce1e64445f14018b705eb3c37..3db403505f2829680648e9ff2bc2c128
// Paper start
if (waitableArray[0] != null) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index c9fb6458ed3d3fa48a758c053662f11d83e727c7..0c3f1f6984bdcf95487b9025c17cab0c6764b6db 100644
index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a715c7b54f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,6 +1,5 @@
@@ -1349,7 +1349,7 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061dbc80e8d0 100644
index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4922e830c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,7 +1,6 @@
@@ -1360,7 +1360,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair;
@@ -868,27 +867,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -867,27 +866,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickTime();
}
@@ -1388,7 +1388,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
}
this.handlingTick = false;
@@ -899,13 +890,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -898,13 +889,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
if (flag1 || this.emptyTime++ < 300) {
@@ -1402,7 +1402,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
this.entityTickList.forEach((entity) -> {
entity.activatedPriorityReset = false; // Pufferfish - DAB
if (!entity.isRemoved()) {
@@ -942,8 +931,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -941,8 +930,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
});
@@ -1411,7 +1411,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
this.tickBlockEntities();
}
@@ -1077,7 +1064,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1076,7 +1063,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
} // Paper
@@ -1419,7 +1419,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
if (randomTickSpeed > 0) {
// Paper start - optimize random block ticking
LevelChunkSection[] sections = chunk.getSections();
@@ -1110,8 +1096,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1109,8 +1095,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
// Paper end - optimise random block ticking
@@ -1428,7 +1428,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
}
@VisibleForTesting
@@ -1441,31 +1425,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1440,31 +1424,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
currentlyTickingEntity.lazySet(entity);
}
// Paper end - log detailed entity tick information
@@ -1460,7 +1460,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
Iterator iterator = entity.getPassengers().iterator();
while (iterator.hasNext()) {
@@ -1473,7 +1447,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1472,7 +1446,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
@@ -1468,7 +1468,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
// Paper start - log detailed entity tick information
} finally {
if (currentlyTickingEntity.get() == entity) {
@@ -1488,9 +1461,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1487,9 +1460,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
// Paper - EAR 2
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
@@ -1478,7 +1478,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
passenger.setOldPosAndRot();
++passenger.tickCount;
// Paper start - EAR 2
@@ -1511,8 +1481,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1510,8 +1480,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(passenger, entity2);
}
@@ -1487,7 +1487,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
}
} else {
passenger.stopRiding();
@@ -1532,14 +1500,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1531,14 +1499,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
}
@@ -1502,7 +1502,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
// Copied from save()
// CraftBukkit start - moved from MinecraftServer.saveChunks
@@ -1551,7 +1516,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1550,7 +1515,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
}
// CraftBukkit end
@@ -1510,7 +1510,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
}
// Paper end
@@ -1565,7 +1529,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1564,7 +1528,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
@@ -1518,7 +1518,7 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
}
@@ -1575,11 +1538,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1574,11 +1537,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
progressListener.progressStage(Component.translatable("menu.savingChunks"));
}
@@ -1531,10 +1531,10 @@ index 20be339c5a6e6b012d21604dadfe214787067287..246537aea1e328ecd25676d68aa7061d
} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c8d91ce1364421f7ce307aef5a4dbfa6f5b75369..c74a9e5f2d92daa36265985e4f6ef7e0e6df4484 100644
index 03b9416aa19a4fac28a1499f15cc097ef71a657e..c82101247896498e7b02a3f6b212262720e41241 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2487,7 +2487,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2489,7 +2489,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleCommand(String s) { // Paper - private -> public
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
@@ -1542,7 +1542,7 @@ index c8d91ce1364421f7ce307aef5a4dbfa6f5b75369..c74a9e5f2d92daa36265985e4f6ef7e0
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
@@ -2497,7 +2496,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2499,7 +2498,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -1550,7 +1550,7 @@ index c8d91ce1364421f7ce307aef5a4dbfa6f5b75369..c74a9e5f2d92daa36265985e4f6ef7e0
return;
}
@@ -2509,8 +2507,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2511,8 +2509,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
@@ -1560,7 +1560,7 @@ index c8d91ce1364421f7ce307aef5a4dbfa6f5b75369..c74a9e5f2d92daa36265985e4f6ef7e0
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 35b18d05097a0bceffe0399ba9cf283ad046051f..de08bdced1d55da22b5abd6f44fdad708ec8f238 100644
index 4652ff409ba93440f249fc2ee504e4fe6e1609de..2ac6126e1a840950e284c453f99ce704ce949c7b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,6 +1,5 @@
@@ -1587,7 +1587,7 @@ index 35b18d05097a0bceffe0399ba9cf283ad046051f..de08bdced1d55da22b5abd6f44fdad70
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 770d74e3c3226306a8f246920798ae72fdafe2c5..050c89be2f3fb4ae5a3d79282d3d67782b67d838 100644
index 658c6d27b828e5a1d4538136a74fc49a69b471c0..bc6940beb4bfdaba082b101e7e20f195e958c86d 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -340,15 +340,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@@ -1629,7 +1629,7 @@ index 770d74e3c3226306a8f246920798ae72fdafe2c5..050c89be2f3fb4ae5a3d79282d3d6778
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
index 57ef7fbba3028c28231abf7b7ae78aa019323536..b518a94a5be42bf015221cfabaedff0b77d720ab 100644
index 1e71cde7cb7654f1c21ae5e27e2fad7b58f593eb..358415f32a40b355f7bf397f2e197eca726547ec 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java
@@ -13,9 +13,8 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
@@ -1640,7 +1640,7 @@ index 57ef7fbba3028c28231abf7b7ae78aa019323536..b518a94a5be42bf015221cfabaedff0b
+ // Paper start - configurable behavior tick rate
private final String configKey;
- private final co.aikar.timings.Timing timing;
// Paper end
// Paper end - configurable behavior tick rate and timings
public Behavior(Map<MemoryModuleType<?>, MemoryStatus> requiredMemoryState) {
@@ -30,14 +29,13 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
@@ -1656,7 +1656,7 @@ index 57ef7fbba3028c28231abf7b7ae78aa019323536..b518a94a5be42bf015221cfabaedff0b
}
this.configKey = key.toLowerCase(java.util.Locale.ROOT);
- this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey);
// Paper end
// Paper end - configurable behavior tick rate and timings
}
@@ -58,9 +56,7 @@ public abstract class Behavior<E extends LivingEntity> implements BehaviorContro
@@ -1726,7 +1726,7 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..4de18d00cc464313b777874430da3f55
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 8b41f27fccf31646e780966d2da7e4c4f5419710..2c5c84c028d1298bb145fa1149752db3f83d5de2 100644
index 3a1ef6f06d8911709eabdefc4f69ba76bc93a409..8126df40be79b3da0b8b841477b02feae0b667fb 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -179,7 +179,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1772,7 +1772,7 @@ index 8b41f27fccf31646e780966d2da7e4c4f5419710..2c5c84c028d1298bb145fa1149752db3
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 530c5e3500bd735bbd41d6c973d7470c43aed404..ec6afe51fd204e4c0764850dcc4535f7f8c159ab 100644
index 1e7cd5b79b6c0e2f07518b6149c60af01f99285b..7508d91a692a5cfdf49bd0143167edcff2d14811 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -132,7 +132,6 @@ public final class NaturalSpawner {
@@ -1791,9 +1791,9 @@ index 530c5e3500bd735bbd41d6c973d7470c43aed404..ec6afe51fd204e4c0764850dcc4535f7
- world.timings.mobSpawn.stopTiming(); // Spigot
}
// Paper start
// Paper start - Add mobcaps commands
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 1e0a8f38b88557ef8c5d1f194dca21ba0fb1226b..74edd4f804c3a9dc24515038b3e98937424e68b3 100644
index b2ae99b9826a33e0cd736eb1bdc072afb1d74e5d..c10af7f406f61a2b41a252c59332bcd6022472af 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -114,13 +114,6 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -1811,7 +1811,7 @@ index 1e0a8f38b88557ef8c5d1f194dca21ba0fb1226b..74edd4f804c3a9dc24515038b3e98937
@Nullable
private String descriptionId;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 3431f1a00ae2918b91a6b7a449e613e6e12ff6d4..cad0931ebd4b0ee8fab4fbbf111bb3cfb2608fbb 100644
index 075aa1f0c0ced25d5c2fd8bf434915d08ac3e483..b9536b3f6ea07d8f0e41410808a96de29912a253 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -23,14 +23,9 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
@@ -1823,17 +1823,17 @@ index 3431f1a00ae2918b91a6b7a449e613e6e12ff6d4..cad0931ebd4b0ee8fab4fbbf111bb3cf
-import co.aikar.timings.Timing; // Paper
-
public abstract class BlockEntity {
static boolean ignoreTileUpdates; // Paper
static boolean ignoreTileUpdates; // Paper - Perf: Optimize Hoppers
- public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
// CraftBukkit start - data containers
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index cd375184c63453829be96449c4df88372f905d9e..6e67591750ae8395f7f7b8a1299d657316bec6d6 100644
index d13a61ad34c00e5ad67adc64e919c4f559621cc9..897919d305ca669fb746dd3202cd393a4c4227f5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -793,7 +793,6 @@ public class LevelChunk extends ChunkAccess {
@@ -792,7 +792,6 @@ public class LevelChunk extends ChunkAccess {
this.chunkHolder.getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
if (this.needsDecoration) {
@@ -1841,7 +1841,7 @@ index cd375184c63453829be96449c4df88372f905d9e..6e67591750ae8395f7f7b8a1299d6573
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(this.level.getSeed());
@@ -813,7 +812,6 @@ public class LevelChunk extends ChunkAccess {
@@ -812,7 +811,6 @@ public class LevelChunk extends ChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@@ -1849,7 +1849,7 @@ index cd375184c63453829be96449c4df88372f905d9e..6e67591750ae8395f7f7b8a1299d6573
}
}
}
@@ -1168,7 +1166,6 @@ public class LevelChunk extends ChunkAccess {
@@ -1167,7 +1165,6 @@ public class LevelChunk extends ChunkAccess {
if (LevelChunk.this.isTicking(blockposition)) {
try {
@@ -1857,7 +1857,7 @@ index cd375184c63453829be96449c4df88372f905d9e..6e67591750ae8395f7f7b8a1299d6573
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
if (this.blockEntity.getType().isValid(iblockdata)) {
@@ -1186,14 +1183,9 @@ public class LevelChunk extends ChunkAccess {
@@ -1185,14 +1182,9 @@ public class LevelChunk extends ChunkAccess {
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new ServerInternalException(msg, throwable)));
LevelChunk.this.removeBlockEntity(this.getPos());
// Paper end
@@ -1873,7 +1873,7 @@ index cd375184c63453829be96449c4df88372f905d9e..6e67591750ae8395f7f7b8a1299d6573
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 7c11bd348d00a1eb2c1c5cb25922aa51e8004e7a..1ae62fd0f67d6de02ffa196a634a3b8a868ff70d 100644
index 864c62d6c84da666adfba105e3fb5c0ca0341889..99fe3b9444c436eba0642135c7e19d147f7df022 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -468,7 +468,6 @@ public final class CraftServer implements Server {
@@ -1885,7 +1885,7 @@ index 7c11bd348d00a1eb2c1c5cb25922aa51e8004e7a..1ae62fd0f67d6de02ffa196a634a3b8a
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index c90ec17f71bb1c9b2ee3ee45d36bc0909bc2945f..6143f8ac8ebe7e4ad67c3386d220863a6acc3b27 100644
index ff921eeb4d7d5791794484315bf751629307ac62..d7d5622c0d2940567e9020aa4b8fe634b1569d98 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -372,8 +372,6 @@ public class Main {
@@ -2272,7 +2272,7 @@ index 139d946346594d2a59a8b2930c4eae794c880dbc..00000000000000000000000000000000
-
-}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index c3a2e0c9b7a5f2ad55b3d8c971d280a0795ff63a..76e155205e2fca0d2080532234b9d08270a2877e 100644
index fb8260a1801f7f11a13b4310b0c7ccd963854591..48a836df10dec491185c33ba2e3e2892c96958f7 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -35,7 +35,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies
diff --git a/build.gradle.kts b/build.gradle.kts
index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0495e599e 100644
index 04d0a5827c454478b80c2da1b204e20ab7828370..3ed769d9fa46f8a5f340c5874f5cc6f11d2ba6f4 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,9 +22,9 @@ dependencies {
@@ -20,7 +20,7 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
/*
Required to add the missing Log4j2Plugins.dat file from log4j-core
@@ -32,23 +32,25 @@ dependencies {
@@ -32,22 +32,24 @@ dependencies {
all its classes to check if they are plugins.
Scanning takes about 1-2 seconds so adding this speeds up the server start.
*/
@@ -35,11 +35,9 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0
+ implementation("io.netty:netty-codec-haproxy:4.1.104.Final") // Paper - Add support for proxy protocol
// Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
- implementation("org.ow2.asm:asm:9.5")
- implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
- implementation("org.ow2.asm:asm-commons:9.5")
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
+ implementation("org.ow2.asm:asm:9.6")
+ implementation("org.ow2.asm:asm-commons:9.6") // Paper - ASM event executor generation
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
- implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation
@@ -55,8 +53,8 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0
+ implementation("com.velocitypowered:velocity-native:3.3.0-SNAPSHOT") { // Leaf - Bump Dependencies
isTransitive = false
}
// Paper end
@@ -68,10 +70,14 @@ dependencies {
// Paper end - Use Velocity cipher
@@ -67,10 +69,14 @@ dependencies {
implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
implementation("dev.omega24:upnp4j:1.0") // Purpur
@@ -74,7 +72,7 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0
}
val craftbukkitPackageVersion = "1_20_R3" // Paper
@@ -263,3 +269,7 @@ sourceSets {
@@ -262,3 +268,7 @@ sourceSets {
}
}
// Gale end - package license into jar

View File

@@ -7,10 +7,10 @@ This Check is added in 1.17.x -> 1.18.x update by Mojang.
By removing this check, it enable hackers to use some modules of hack clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c74a9e5f2d92daa36265985e4f6ef7e0e6df4484..012af2775a5d6559fdefab7d484f15b475a1c381 100644
index c82101247896498e7b02a3f6b212262720e41241..a5fb09c24788fef07463a6abb6bee2718bdd779e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2011,7 +2011,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2013,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Vec3 vec3d2 = vec3d.subtract(vec3d1);
double d0 = 1.0000001D;

View File

@@ -7,18 +7,18 @@ Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 61df6e02971a3e2deb63504b35289a77781d34ac..c7ef72f2f4fdd2b7d06312c2931a6e0e857616c2 100644
index 4e3d22cc21b50e563416a3f89715078aeb059f40..6da78fe423b78b35dd408367209b5b0fbdc6154d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -423,6 +423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -425,6 +425,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
public boolean fixedPose = false; // Paper
public boolean fixedPose = false; // Paper - Expand Pose API
+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data
public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -2529,6 +2530,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2531,6 +2532,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
nbttagcompound.putBoolean("Paper.FreezeLock", true);
}
// Paper end
@@ -26,7 +26,7 @@ index 61df6e02971a3e2deb63504b35289a77781d34ac..c7ef72f2f4fdd2b7d06312c2931a6e0e
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2676,6 +2678,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -2678,6 +2680,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
}
// Paper end
@@ -38,7 +38,7 @@ index 61df6e02971a3e2deb63504b35289a77781d34ac..c7ef72f2f4fdd2b7d06312c2931a6e0e
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -5120,4 +5127,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -5115,4 +5122,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return false;
}
// Purpur end

View File

@@ -25,10 +25,10 @@ index af86f752c33a2990405fea058b7c41c437ba9d46..bada9fae1e7178162429e1f5a1608b9c
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 149a786b38d999730a05931ea5dc69a7aa04723a..a500372fb5cec834d0d25eb44f46afaa1acf6ffc 100644
index 7334b13af92d7a323dd24a14102b789c10dfbb4f..a2933d814d453971080eeba90bb1819a8d599ba7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1722,6 +1722,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1708,6 +1708,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -38,7 +38,7 @@ index 149a786b38d999730a05931ea5dc69a7aa04723a..a500372fb5cec834d0d25eb44f46afaa
((Runnable) this.tickables.get(i)).run();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 1ee6f597bbb8ba62b9fddde3fd7a91085dc0def2..66255eeab8cae6ce150ca888b9db3c2f88c4b00b 100644
index a90569dbdf9122866d57e2876d9940f4ef4b8a45..5920b8eecc6db362b0c55b521730cff67b84b6ea 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -136,6 +136,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -58,7 +58,7 @@ index 1ee6f597bbb8ba62b9fddde3fd7a91085dc0def2..66255eeab8cae6ce150ca888b9db3c2f
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0a6f3536d6ca9bf2efb18524eb1dd00ef5a8f1e0..f498cfe2051fc8045c02bfaf4d98a3b46ce23aa6 100644
index d0b782b80d834c0e5be1570b0fd3e38681fc616b..9b8b0740a06b5b92fb3e905d7f8945c91ee637fb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -361,6 +361,7 @@ public abstract class PlayerList {
@@ -74,11 +74,11 @@ index 0a6f3536d6ca9bf2efb18524eb1dd00ef5a8f1e0..f498cfe2051fc8045c02bfaf4d98a3b4
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
+ top.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(entityplayer); // Leaves - protocol
// Paper end
// Paper end - Fix kick event leave message not being sent
org.purpurmc.purpur.task.BossBarTask.removeFromAll(entityplayer.getBukkitEntity()); // Purpur
ServerLevel worldserver = entityplayer.serverLevel();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1ae62fd0f67d6de02ffa196a634a3b8a868ff70d..7419bc9ae4f254c4c758b6955f3ef4ba7da89a81 100644
index 99fe3b9444c436eba0642135c7e19d147f7df022..9830f45484988e931ed1f47db24e131c4dbd88d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -480,6 +480,7 @@ public final class CraftServer implements Server {

View File

@@ -7,7 +7,7 @@ Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5736cb60316da784590ef03d5808376254aae20b..6d03d8818afb81fa9b5bd92c32a0fde63a4367e9 100644
index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5b0b7d54c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -247,7 +247,6 @@ import org.bukkit.inventory.EquipmentSlot;
@@ -36,7 +36,7 @@ index 5736cb60316da784590ef03d5808376254aae20b..6d03d8818afb81fa9b5bd92c32a0fde6
flag2 = true; // Paper - diff on change, this should be moved wrongly
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
}
@@ -1487,7 +1486,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1489,7 +1488,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
toX, toY, toZ, toYaw, toPitch, true);
if (!event.isAllowed()) {
@@ -45,7 +45,7 @@ index 5736cb60316da784590ef03d5808376254aae20b..6d03d8818afb81fa9b5bd92c32a0fde6
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return;
@@ -1557,7 +1556,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1559,7 +1558,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Fix tracker NPE
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0c3f1f6984bdcf95487b9025c17cab0c6764b6db..e85dcc5095e585b6c3d2db54ed3279365050551d 100644
index 95add10db1d7600167312160cd1a15a715c7b54f..62ac94fff8542eedd3fea5fbaef5c4f617fdac01 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -241,7 +241,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -21,8 +21,8 @@ index 0c3f1f6984bdcf95487b9025c17cab0c6764b6db..e85dcc5095e585b6c3d2db54ed327936
final Entity entity;
private final int range;
SectionPos lastSectionPos;
- public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - optimise map impl
+ public final Set<ServerPlayerConnection> seenBy = Sets.newConcurrentHashSet(); // Paper - optimise map impl // Leaf - fix tracker NPE
- public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
+ public final Set<ServerPlayerConnection> seenBy = Sets.newConcurrentHashSet(); // Paper - Perf: optimise map impl // Leaf - fix tracker NPE
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Fix sprint glitch
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6ca39830ead96eb18e9b5e637d1ea33c93e30198..0c7c73fcc5f5c2f2b5362409e185f0c38ab85b6c 100644
index 46d4e0b239e9c7bd45b052c84ddcdbe545582af3..4a0af738a4eefe6512b56d23cd01685961b21b9c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1429,7 +1429,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1430,7 +1430,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
player.setRealHealth(health);
}

View File

@@ -13,7 +13,7 @@ Fixed errors in console has no color,also fixed`Advanced terminal features are n
or `Unable to create terminal` like issues
diff --git a/build.gradle.kts b/build.gradle.kts
index 081788f064872486f5905dcdde2e1de0495e599e..0baaa2bcd05ea65c5fbb9ae646b3a9eeb12bac14 100644
index 3ed769d9fa46f8a5f340c5874f5cc6f11d2ba6f4..2adcf3c29257580b814e66b451ca71e772a6f49f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -23,7 +23,7 @@ dependencies {
@@ -26,10 +26,10 @@ index 081788f064872486f5905dcdde2e1de0495e599e..0baaa2bcd05ea65c5fbb9ae646b3a9ee
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
/*
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a500372fb5cec834d0d25eb44f46afaa1acf6ffc..1b4e0c7f23186afd88c7a71e296a5ca958f1c1d8 100644
index a2933d814d453971080eeba90bb1819a8d599ba7..cd259a016a3f3189aab59ab1950e991fe6c31cd2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1274,10 +1274,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1268,10 +1268,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//org.spigotmc.WatchdogThread.doStop(); // Spigot // Paper - move into stop
// CraftBukkit start - Restore terminal to original settings

View File

@@ -11,10 +11,10 @@ This patch allows velocity applied when a player is hit to be modified in the co
Reference: https://gist.github.com/YoungOG/e3265d98661957abece71594b70d6a01
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0c7c73fcc5f5c2f2b5362409e185f0c38ab85b6c..424779ac48351f79e64522e954b0b20778ca8a3a 100644
index 4a0af738a4eefe6512b56d23cd01685961b21b9c..eadab0caa0cf4a14b9ef51ca0ba6dfd644e85e7b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1965,7 +1965,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1966,7 +1966,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = this.getDeltaMovement();
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
@@ -30,7 +30,7 @@ index 0c7c73fcc5f5c2f2b5362409e185f0c38ab85b6c..424779ac48351f79e64522e954b0b207
Vec3 currentMovement = this.getDeltaMovement();
org.bukkit.util.Vector delta = new org.bukkit.util.Vector(currentMovement.x - vec3d.x, currentMovement.y - vec3d.y, currentMovement.z - vec3d.z);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index b0aa6482936338b5102efaaae682e8b26dc4ede6..040231a7c6388b30d9aa1e0287f3480189c0a511 100644
index 8b665475ab5cd2bae4e11aa1755af3bb9b99b284..681e6cf3593f44a018488e56d1a40aef5f821aa2 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1371,11 +1371,22 @@ public abstract class Player extends LivingEntity {
@@ -104,7 +104,7 @@ index b0aa6482936338b5102efaaae682e8b26dc4ede6..040231a7c6388b30d9aa1e0287f34801
if (flag2) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f0da7fb7b09c8a5483b5d741810ab99985df64b6..56da11efc3be1da40dcbb7080f64bd9719517153 100644
index 337a08470d015c9a28ef14f700ce6e11eb87c7a7..f673490b78f89efaffc1422ebe4bee95dd58b47e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket;

View File

@@ -7,10 +7,10 @@ Replace `thenApply` with `thenCompose`. Once one task is completed then the next
to prevent blocking threads while waiting to complete all tasks
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 22dfe70df68b35e313f94b17a87e4121392b17b4..8fc746ec89eb8052e723227eac890407d9b34938 100644
index 169edd91e25f3c1d27f8a9e2bca58a6143c8a891..3212768d1d8e8922bd88de407add163868837b42 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -412,9 +412,11 @@ public class Util {
@@ -409,9 +409,11 @@ public class Util {
return futures.get(0).thenApply(List::of);
} else {
CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] AddLinearSupport
diff --git a/build.gradle.kts b/build.gradle.kts
index 0baaa2bcd05ea65c5fbb9ae646b3a9eeb12bac14..2f374fd4cb05d2c597d0dbd1a554cd6624f84863 100644
index 2adcf3c29257580b814e66b451ca71e772a6f49f..4dccb446c22055c2b4c9986094898607566fa204 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,8 @@ dependencies {
@@ -121,7 +121,7 @@ index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54a
long expectedChunks = (long)regionFiles.length * (32L * 32L);
// Gale start - instantly continue on world upgrade finish
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1b4e0c7f23186afd88c7a71e296a5ca958f1c1d8..d6bdcb21ec79a81c31eaab24a73b55d08351e19b 100644
index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619ab7f845fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -868,7 +868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -143,7 +143,7 @@ index 1b4e0c7f23186afd88c7a71e296a5ca958f1c1d8..d6bdcb21ec79a81c31eaab24a73b55d0
return flag3;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index e85dcc5095e585b6c3d2db54ed3279365050551d..38ddd6684535f9a4e6e9fb432282e0b6be0ede4c 100644
index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb14fcbb25e 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -246,7 +246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -190,10 +190,10 @@ index e85dcc5095e585b6c3d2db54ed3279365050551d..38ddd6684535f9a4e6e9fb432282e0b6
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 246537aea1e328ecd25676d68aa7061dbc80e8d0..a5c21463eec4334e8f84fa4657a503755039ffb3 100644
index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b802003dd7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -425,8 +425,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -424,8 +424,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
@@ -204,7 +204,7 @@ index 246537aea1e328ecd25676d68aa7061dbc80e8d0..a5c21463eec4334e8f84fa4657a50375
}
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -754,7 +754,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -753,7 +753,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();
@@ -279,7 +279,7 @@ index 12a7aaeaa8b4b788b620b1985591c3b93253ccd5..af639cc29999a49f4f2d494dc82f9957
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index 8ebecb588058da174b0e0e19e54fcddfeeca1422..473484d8187a3f2224943cd0cbbdbc28334edb61 100644
index 4a84ada69c6abc8f2743579d4451e639836274b4..31cd961bc296f84f5482318c1fb7fcef3e3c1445 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -37,11 +37,11 @@ public class ChunkStorage implements AutoCloseable {
@@ -291,13 +291,13 @@ index 8ebecb588058da174b0e0e19e54fcddfeeca1422..473484d8187a3f2224943cd0cbbdbc28
this.fixerUpper = dataFixer;
// Paper start - async chunk io
// remove IO worker
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - nuke IOWorker // Paper // LinearPurpur
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt // LinearPurpur
// Paper end - async chunk io
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 5b91ccafbdc7582e50272953f3ab2b8c0f0bf9dd..5d554c64a7c278c12724c1ffbb45eeaefd6dceeb 100644
index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4ee3e708a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -26,7 +26,7 @@ import net.minecraft.nbt.NbtIo; // Paper
@@ -323,7 +323,7 @@ index 5b91ccafbdc7582e50272953f3ab2b8c0f0bf9dd..5d554c64a7c278c12724c1ffbb45eeae
+ }
+ // LinearPurpur end
+
// Paper start - try to recover from RegionFile header corruption
// Paper start - Attempt to recalculate regionfile header if it is corrupt
private static long roundToSectors(long bytes) {
long sectors = bytes >>> 12; // 4096 = 2^12
@@ -128,7 +138,7 @@ public class RegionFile implements AutoCloseable {
@@ -358,7 +358,7 @@ index 5b91ccafbdc7582e50272953f3ab2b8c0f0bf9dd..5d554c64a7c278c12724c1ffbb45eeae
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
return NbtIo.read((java.io.DataInput) out);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 6eaeb2db0da59611501f2b1a63b5b48816a0ba48..ba10c7ffb08f806d8d9d0291276a7321421651fc 100644
index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb36a582d2a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -19,11 +19,17 @@ import net.minecraft.world.level.ChunkPos;
@@ -631,7 +631,7 @@ index 4aac1979cf57300825a999c876fcf24d3170e68e..79a389b9a139f6838adf32d3b5d4d7ec
this.factory = factory;
this.fixerUpper = dataFixer;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index dad55726e798448b4e0e599bd5f8913c55059812..205e63477796359ce35b70b701e0438d8a8e45d5 100644
index 4b222fc6a4824caffef4aad78092bd02a8892026..db36f3b98a3955ec867972f546211db8975734ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -567,7 +567,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View File

@@ -16,15 +16,15 @@ now is just updating dirty map/decoration data.
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 068dd1194016b65227ec44747b065860a48e7f1d..3c0d5fe3a5b3f77fc102e4c09645c96abca4f7e9 100644
index dc09d893f1a7dd36f994ac8ea5bea5b1fa689c83..be950b74d68662932e8f62e3d321db1262289c4e 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -111,29 +111,42 @@ public class ServerEntity {
Entity entity = this.entity;
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Only tick item frames if players can see it
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Only tick item frames if players can see it // Paper
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Perf: Only tick item frames if players can see it
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Perf: Only tick item frames if players can see it // Paper
ItemFrame entityitemframe = (ItemFrame) entity;
if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
@@ -33,7 +33,7 @@ index 068dd1194016b65227ec44747b065860a48e7f1d..3c0d5fe3a5b3f77fc102e4c09645c96a
- if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
+ if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 /*&& itemstack.getItem() instanceof MapItem*/) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable // Paper - skip redundant getItem
Integer integer = entityitemframe.cachedMapId; // Paper
Integer integer = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
if (worldmap != null) {
@@ -88,13 +88,13 @@ index 068dd1194016b65227ec44747b065860a48e7f1d..3c0d5fe3a5b3f77fc102e4c09645c96a
private void sendDirtyEntityData() {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index d728dc8a9b5fa2de0a824aaf132ee15db090b02e..61532177b24311cbc91d52fd460d818eedea66b0 100644
index e5b7598a5613a8281a991e42af5b950bcc2995ca..c8e2f5676aa121727a981c171b5b98f0ca34b2fa 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -489,6 +489,16 @@ public class ItemFrame extends HangingEntity {
}
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
// Paper end
// Paper end - Add PlayerItemFrameChangeEvent
+ // Paper start - add decoration and mark everything dirty for other players who are already tracking this frame
+ final ItemStack item = this.getItem();
+ if (item.is(Items.FILLED_MAP)) {
@@ -109,7 +109,7 @@ index d728dc8a9b5fa2de0a824aaf132ee15db090b02e..61532177b24311cbc91d52fd460d818e
if (!player.getAbilities().instabuild) {
itemstack.shrink(1);
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 804c342783baccdc12e8ca49a362770e31596f6a..e1a251490bf18ff60e0ef9e7c7a692afa329c7f7 100644
index e1498d496aa01c433b6fa198608e33916eadecf3..80a3a17b86277df3edac32b7b81abee4fa14df79 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -67,6 +67,16 @@ public class MapItemSavedData extends SavedData {

View File

@@ -16,11 +16,11 @@ This seems stupid, but it does seem that it improves the performance a bit, and
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 38ddd6684535f9a4e6e9fb432282e0b6be0ede4c..928d5fe7a41206d6160df4190fbaefcb516a910b 100644
index c175681d1e57d0ea922bec1f1c10cfb14fcbb25e..ab790bcf4c4ea067ba5bdfb30c006fa0cc65def0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1409,7 +1409,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - check Y
// Paper end - Configurable entity tracking range by Y
// CraftBukkit start - respect vanish API
- if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
@@ -29,7 +29,7 @@ index 38ddd6684535f9a4e6e9fb432282e0b6be0ede4c..928d5fe7a41206d6160df4190fbaefcb
}
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 56da11efc3be1da40dcbb7080f64bd9719517153..0461e04a889000402dce6084898a302f70ca6b67 100644
index f673490b78f89efaffc1422ebe4bee95dd58b47e..7f7f2c558c359b816adae6eae62a8e8b5bccabf6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -188,7 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -38,7 +38,7 @@ index 56da11efc3be1da40dcbb7080f64bd9719517153..0461e04a889000402dce6084898a302f
private final Set<String> channels = new HashSet<String>();
- private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
+ private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
@@ -2164,9 +2164,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@@ -6,7 +6,7 @@ pluginManagement {
}
rootProject.name = "leaf"
for (name in listOf("Leaf-API", "Leaf-Server")) {
for (name in listOf("Leaf-API", "Leaf-Server", "paper-api-generator")) {
val projName = name.lowercase()
include(projName)
findProject(":$projName")!!.projectDir = file(name)