Compare commits
340
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbc57469ab | ||
|
|
f9e368621d | ||
|
|
4675152f49 | ||
|
|
274e54ba58 | ||
|
|
8cafc07297 | ||
|
|
e289accb03 | ||
|
|
2553f30153 | ||
|
|
75d04e9b04 | ||
|
|
23860da6c2 | ||
|
|
8a3980c60b | ||
|
|
0cdce89d59 | ||
|
|
15a0de2eef | ||
|
|
43c343228e | ||
|
|
bffb08c2f9 | ||
|
|
6592fed511 | ||
|
|
aa6c4c11e5 | ||
|
|
f78d7ce8ff | ||
|
|
44057da467 | ||
|
|
230682d51b | ||
|
|
487109fddc | ||
|
|
8493340be4 | ||
|
|
0b218903a8 | ||
|
|
1865625d95 | ||
|
|
5bb30ce95b | ||
|
|
3e4eaf2188 | ||
|
|
415d7081d2 | ||
|
|
a81a384303 | ||
|
|
5bdfb29ba1 | ||
|
|
c6fac381ed | ||
|
|
8b1ac39e89 | ||
|
|
52849f6da6 | ||
|
|
b1faa5d5f4 | ||
|
|
b3cac042c1 | ||
|
|
29350674b3 | ||
|
|
8cf2503804 | ||
|
|
996d529fb3 | ||
|
|
b974a6b6f3 | ||
|
|
acc6d012b0 | ||
|
|
c1ac98328c | ||
|
|
90fe0d58a5 | ||
|
|
489bff9bbd | ||
|
|
71a1787f6c | ||
|
|
3a5c6f8cee | ||
|
|
a3e4d1aa36 | ||
|
|
4b0bc74c90 | ||
|
|
00331d943e | ||
|
|
2f4281e2b4 | ||
|
|
e57af7d01e | ||
|
|
44ee1cd05e | ||
|
|
852c1c236d | ||
|
|
3e1c5e3eb0 | ||
|
|
e4d184f39d | ||
|
|
3e9d2ac5f2 | ||
|
|
f613437019 | ||
|
|
2f5bb7e306 | ||
|
|
1a4778d260 | ||
|
|
5509610db5 | ||
|
|
7e5dd92f9f | ||
|
|
69ce9276e4 | ||
|
|
72f7945e77 | ||
|
|
e87240b674 | ||
|
|
a2ba45239c | ||
|
|
99b735c1ac | ||
|
|
a702a083cd | ||
|
|
adb4fb4bd3 | ||
|
|
29a0209575 | ||
|
|
08c0b488b9 | ||
|
|
cfe311d7a5 | ||
|
|
431e6418ab | ||
|
|
02cfaa8ff8 | ||
|
|
5eec4ec3bf | ||
|
|
f36bb59739 | ||
|
|
6573d9555d | ||
|
|
9d21a88218 | ||
|
|
bb1c0dd6fa | ||
|
|
f6969b6374 | ||
|
|
38376f43a0 | ||
|
|
c4ba28a21a | ||
|
|
0f69290f07 | ||
|
|
4cdbb0c86c | ||
|
|
1765917a6f | ||
|
|
fe54a13b13 | ||
|
|
b3b961f9d5 | ||
|
|
c207429b21 | ||
|
|
298c47857b | ||
|
|
3cf03fc31a | ||
|
|
5cbce366b2 | ||
|
|
5923b7d085 | ||
|
|
e284bb1215 | ||
|
|
7a00758b1b | ||
|
|
11138a770e | ||
|
|
8b9e3dcd9e | ||
|
|
866d2d9f4a | ||
|
|
025c5d7a28 | ||
|
|
ea56138b30 | ||
|
|
5dca26ce54 | ||
|
|
84556f3cda | ||
|
|
38dc3b25d8 | ||
|
|
8d922746d9 | ||
|
|
2ec643a53c | ||
|
|
6be43952eb | ||
|
|
9624451ffd | ||
|
|
b561a12078 | ||
|
|
9c126fd2a9 | ||
|
|
38b7565d9e | ||
|
|
8b512e3466 | ||
|
|
9df2066642 | ||
|
|
4c17176c77 | ||
|
|
a353f4d207 | ||
|
|
a50d7c340b | ||
|
|
02807238c4 | ||
|
|
d23c4a50e6 | ||
|
|
b3ec8bd8ae | ||
|
|
81c5901c67 | ||
|
|
47aeab84ad | ||
|
|
915bb9220e | ||
|
|
6af97e11b6 | ||
|
|
d259503c92 | ||
|
|
ea01aa335a | ||
|
|
e88856dd75 | ||
|
|
896aa8b54a | ||
|
|
ead3ddba32 | ||
|
|
603c33df06 | ||
|
|
1ebaffacf5 | ||
|
|
f4d8a64094 | ||
|
|
63a1b0c137 | ||
|
|
a91e19f1df | ||
|
|
8baf510f92 | ||
|
|
ac7e4ad35e | ||
|
|
3aa8e7ef3f | ||
|
|
4875ee4814 | ||
|
|
32d9c6684b | ||
|
|
772fb3e385 | ||
|
|
2617c927a0 | ||
|
|
e5bd562d28 | ||
|
|
452009bbde | ||
|
|
574bc968d3 | ||
|
|
95a31de306 | ||
|
|
af1090259a | ||
|
|
74094edf08 | ||
|
|
662b6c5ca8 | ||
|
|
79fef73926 | ||
|
|
00d82983bd | ||
|
|
2cb3a1a3dc | ||
|
|
fc84aee124 | ||
|
|
2cee84193c | ||
|
|
a62835bbb1 | ||
|
|
24fd5aea0c | ||
|
|
2bc818efd4 | ||
|
|
78a003ee89 | ||
|
|
7b29d1f4c5 | ||
|
|
ef6a41195d | ||
|
|
a27262375c | ||
|
|
c60dd35989 | ||
|
|
7ebfdd5e6d | ||
|
|
91671751e7 | ||
|
|
20253f478f | ||
|
|
2b72b74a36 | ||
|
|
b6e46e90cd | ||
|
|
6267e26420 | ||
|
|
773dd72446 | ||
|
|
3fd1502717 | ||
|
|
1b1c23010a | ||
|
|
581b683931 | ||
|
|
a856073368 | ||
|
|
ba0e1f54b9 | ||
|
|
3cec9c985f | ||
|
|
d8af99a82c | ||
|
|
064fb50cc1 | ||
|
|
06a741d713 | ||
|
|
e312ebb1bd | ||
|
|
ede9c06814 | ||
|
|
0c8e84c20d | ||
|
|
deb92c2129 | ||
|
|
83cfeb1b37 | ||
|
|
99b311de54 | ||
|
|
eb60bffa98 | ||
|
|
29d1c7b602 | ||
|
|
7145f41b6e | ||
|
|
6378792a99 | ||
|
|
e68fd7162a | ||
|
|
eea0c649ca | ||
|
|
1c15111f08 | ||
|
|
517f8fbbac | ||
|
|
fb06829845 | ||
|
|
c9cd94f3c6 | ||
|
|
e2b197132d | ||
|
|
72e87abc2d | ||
|
|
33bec7f20a | ||
|
|
471f4de9c4 | ||
|
|
39953cf08d | ||
|
|
b4e3b3d1dd | ||
|
|
b8edb0e130 | ||
|
|
0c0a480d82 | ||
|
|
0e622c79fa | ||
|
|
7d13b7066c | ||
|
|
6813244fb0 | ||
|
|
6f30f08b20 | ||
|
|
e552bebca1 | ||
|
|
0c8882f7f9 | ||
|
|
b45ecc93c1 | ||
|
|
b8a0049207 | ||
|
|
7a1863ed78 | ||
|
|
a751001ed1 | ||
|
|
fcc5f232f9 | ||
|
|
9cbad8ebbf | ||
|
|
3716832282 | ||
|
|
a712766995 | ||
|
|
7386a13642 | ||
|
|
9395aa6079 | ||
|
|
0c7385b569 | ||
|
|
27d39cac4f | ||
|
|
fed9042390 | ||
|
|
e3f29f4345 | ||
|
|
b29ecd4c22 | ||
|
|
2be57c6943 | ||
|
|
97b9c4a2a4 | ||
|
|
35ef0537be | ||
|
|
281855c877 | ||
|
|
af6142eab3 | ||
|
|
00a68b1efe | ||
|
|
7232506c22 | ||
|
|
1b96c64620 | ||
|
|
5bf82aa136 | ||
|
|
88891c37b1 | ||
|
|
1259b93ba6 | ||
|
|
990765bd08 | ||
|
|
45ba65283f | ||
|
|
f43a19c275 | ||
|
|
d928dda91d | ||
|
|
bd67b83fd0 | ||
|
|
ed8401c748 | ||
|
|
5b34a09ed0 | ||
|
|
67a1a8caf8 | ||
|
|
d12916255a | ||
|
|
666a2147a7 | ||
|
|
2bd6ba2c63 | ||
|
|
fd4f0c7741 | ||
|
|
eb8f2bb2a1 | ||
|
|
307d05bba8 | ||
|
|
ea1f33cf9a | ||
|
|
73af2d4cea | ||
|
|
47b805fdf1 | ||
|
|
6520ca1c47 | ||
|
|
a73ed9572e | ||
|
|
93829bba5a | ||
|
|
23c44c2b8d | ||
|
|
02338e5069 | ||
|
|
1dfdbef42b | ||
|
|
2df309bd49 | ||
|
|
29aaf7bc24 | ||
|
|
20a71c58d3 | ||
|
|
3b4839ee32 | ||
|
|
3c41f8f0b3 | ||
|
|
9bc70e6888 | ||
|
|
4179b8f3fa | ||
|
|
98c567fe6f | ||
|
|
a2002a76b8 | ||
|
|
93cf3eb832 | ||
|
|
9ffccd6430 | ||
|
|
408a9050ba | ||
|
|
ef2b574c6a | ||
|
|
5274ad672b | ||
|
|
d6d2b6f4e5 | ||
|
|
8fe8ca6658 | ||
|
|
31358d5e48 | ||
|
|
508a295b44 | ||
|
|
2fa8efce9b | ||
|
|
69a801305d | ||
|
|
2c55dd86ff | ||
|
|
13c9d3c423 | ||
|
|
81619a652e | ||
|
|
f402f89a67 | ||
|
|
6c7e3c5193 | ||
|
|
7d1cc6d409 | ||
|
|
a40e48f3fd | ||
|
|
1837f6c677 | ||
|
|
b14979e352 | ||
|
|
aa93dcfdce | ||
|
|
42830546f3 | ||
|
|
e19177a2c3 | ||
|
|
2c54b3949f | ||
|
|
d8b8f61961 | ||
|
|
383f0ed924 | ||
|
|
24d690fe7e | ||
|
|
46a36d3b28 | ||
|
|
2f8d9db58c | ||
|
|
b1334b5105 | ||
|
|
c016e039a5 | ||
|
|
40adc2345b | ||
|
|
c793bd93be | ||
|
|
b533905cc3 | ||
|
|
fe780d041e | ||
|
|
de3f149185 | ||
|
|
22ed60c101 | ||
|
|
aefb73c234 | ||
|
|
ece4fd3597 | ||
|
|
836586d59b | ||
|
|
92bc19b049 | ||
|
|
1f8ca77bb6 | ||
|
|
a60eeb85f5 | ||
|
|
a3c760e6af | ||
|
|
f9473d9928 | ||
|
|
b3dc7a3b4b | ||
|
|
805fdd83b3 | ||
|
|
6b325cd6a9 | ||
|
|
5de0f8ac48 | ||
|
|
e105354330 | ||
|
|
d7d3f6371e | ||
|
|
48ea66e97f | ||
|
|
dadd8b5a7c | ||
|
|
12c970097d | ||
|
|
c0936a71bd | ||
|
|
4356758b64 | ||
|
|
171ba7ccf3 | ||
|
|
e16fefb443 | ||
|
|
f2c1e1366a | ||
|
|
fead63e2ea | ||
|
|
225c95025b | ||
|
|
437e8da700 | ||
|
|
2c9c5e4662 | ||
|
|
82cd69fcf4 | ||
|
|
e4b40ddc22 | ||
|
|
8582999344 | ||
|
|
cf0f013f53 | ||
|
|
7103f813bc | ||
|
|
3f6c4b07ac | ||
|
|
990be1691b | ||
|
|
e8bec64217 | ||
|
|
b34d4ecd2e | ||
|
|
aea9cdd37d | ||
|
|
206dd3af05 | ||
|
|
b1696788d6 | ||
|
|
c613877e54 | ||
|
|
3756f5bbf5 | ||
|
|
1f5bec71f3 | ||
|
|
b1fe756b73 | ||
|
|
d6d4c78e7d | ||
|
|
976b95c74c | ||
|
|
275173e538 |
No files matched your search
@@ -4,6 +4,10 @@ end_of_line=lf
|
||||
insert_final_newline=true
|
||||
indent_style=space
|
||||
indent_size=4
|
||||
ij_any_block_comment_add_space = false
|
||||
ij_any_block_comment_at_first_column = false
|
||||
ij_any_line_comment_at_first_column = false
|
||||
ij_any_line_comment_add_space = true
|
||||
|
||||
[*.tiny]
|
||||
indent_style=tab
|
||||
@@ -16,3 +20,18 @@ indent_size=2
|
||||
|
||||
[*.patch]
|
||||
trim_trailing_whitespace=false
|
||||
|
||||
[*.java]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_java_class_count_to_use_import_on_demand = 999999
|
||||
ij_java_insert_inner_class_imports = false
|
||||
ij_java_names_count_to_use_import_on_demand = 999999
|
||||
ij_java_imports_layout = *,|,$*
|
||||
ij_java_generate_final_locals = true
|
||||
ij_java_generate_final_parameters = true
|
||||
|
||||
[test-plugin/**/*.java]
|
||||
ij_java_use_fq_class_names = false
|
||||
|
||||
[Paper-Server/src/main/resources/data/**/*.json]
|
||||
indent_size = 2
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
* text=auto
|
||||
* text=auto eol=lf
|
||||
|
||||
*.sh text eol=lf
|
||||
gradlew text eol=lf
|
||||
|
||||
@@ -26,10 +26,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: JDK ${{ matrix.java }}
|
||||
uses: actions/setup-java@v3.6.0
|
||||
uses: actions/setup-java@v3.11.0
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
- name: Setup Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ jobs:
|
||||
# include "status: needs triage" below to catch any closed issues without setting a resolution
|
||||
label-to-column-map: |
|
||||
{
|
||||
"status: accepted": "Done",
|
||||
"status: needs triage": "Invalid",
|
||||
"resolution: works-as-intended": "Invalid",
|
||||
"resolution: invalid": "Invalid",
|
||||
|
||||
+1
-1
@@ -478,4 +478,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/
|
||||
+3
-1
@@ -60,5 +60,7 @@ Luke Chambers <consolelogluke@gmail.com>
|
||||
Emily <emilia.lopezf.1999@gmail.com>
|
||||
dawon <dawon@dawon.eu>
|
||||
Ollie <69084614+olijeffers0n@users.noreply.github.com>
|
||||
BlockyTheDev <86119630+BlockyTheDev@users.noreply.github.com>
|
||||
Oliwier Miodun <naczs@blueflow.pl>
|
||||
aerulion <aerulion@gmail.com>
|
||||
Lukas Planz <lukas.planz@web.de>
|
||||
```
|
||||
@@ -4,11 +4,11 @@ Paper [](https://opencollective.com/papermc)
|
||||
===========
|
||||
|
||||
High-performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.
|
||||
The most widely used, high-performance Minecraft server that aims to fix gameplay and mechanics inconsistencies.
|
||||
|
||||
|
||||
**Support and Project Discussion:**
|
||||
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
|
||||
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
|
||||
|
||||
How To (Server Admins)
|
||||
------
|
||||
@@ -18,34 +18,33 @@ Download Paper from our [downloads page](https://papermc.io/downloads/paper).
|
||||
|
||||
Run the Paperclip jar directly from your server. Just like old times
|
||||
|
||||
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
|
||||
* For a sneak peek at upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
|
||||
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
|
||||
* For a sneak peek at upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
|
||||
|
||||
How To (Plugin Developers)
|
||||
------
|
||||
* See our API patches [here](patches/api)
|
||||
* See upcoming, pending, and recently added API [here](https://github.com/PaperMC/Paper/projects/6)
|
||||
* Paper API javadocs here: [papermc.io/javadocs](https://papermc.io/javadocs/)
|
||||
* Maven Repo (for paper-api):
|
||||
* See our API patches [here](patches/api)
|
||||
* See upcoming, pending, and recently added API [here](https://github.com/orgs/PaperMC/projects/2/views/4)
|
||||
* Paper API javadocs here: [papermc.io/javadocs](https://papermc.io/javadocs/)
|
||||
#### Repository (for paper-api)
|
||||
##### Maven
|
||||
|
||||
```xml
|
||||
<repository>
|
||||
<id>papermc</id>
|
||||
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||
</repository>
|
||||
```
|
||||
* Artifact Information:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.20.1-R0.1-SNAPSHOT</version>
|
||||
<version>1.20.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
**Or alternatively, with Gradle:**
|
||||
|
||||
* Repository:
|
||||
```
|
||||
##### Gradle
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
@@ -54,7 +53,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -76,9 +75,9 @@ See [Contributing](CONTRIBUTING.md)
|
||||
|
||||
Support Us
|
||||
------
|
||||
First of all, thank you for considering helping out, we really appreciate that!
|
||||
First of all, thank you for considering helping out, we really appreciate that!
|
||||
|
||||
PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses [Open Collective](https://opencollective.com/) via the [Open Source Collective fiscal host](https://opencollective.com/opensource) to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about financially supporting PaperMC [on our website](https://papermc.io/sponsors).
|
||||
PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses [Open Collective](https://opencollective.com/) via the [Open Source Collective fiscal host](https://opencollective.com/opensource) to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about financially supporting PaperMC [on our website](https://papermc.io/sponsors).
|
||||
|
||||
You can find our collective [here](https://opencollective.com/papermc), or you can donate via GitHub Sponsors [here](https://github.com/sponsors/PaperMC), which will also go towards the collective.
|
||||
|
||||
|
||||
@@ -8,4 +8,8 @@
|
||||
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
|
||||
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
|
||||
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
|
||||
# mc_data chat_type/chat.json
|
||||
# mc_data dimension_type/overworld.json
|
||||
#
|
||||
|
||||
@@ -26,10 +26,3 @@ c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
|
||||
# Paper changes type
|
||||
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
|
||||
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId e
|
||||
|
||||
# upstream makes a bunch of methods public that cause accidental overrides now
|
||||
c net/minecraft/world/entity/Display net/minecraft/world/entity/Display
|
||||
m ()I getInterpolationDelay getInterpolationDelay_
|
||||
m (I)V setInterpolationDelay setInterpolationDelay_
|
||||
m (I)V setInterpolationDuration setInterpolationDuration_
|
||||
|
||||
+11
-11
@@ -5,7 +5,7 @@ plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("io.papermc.paperweight.core") version "1.5.5"
|
||||
id("io.papermc.paperweight.core") version "1.5.9"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -61,8 +61,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
paramMappings("net.fabricmc:yarn:1.20.1+build.1:mergedv2")
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
||||
paramMappings("net.fabricmc:yarn:1.20.2+build.1:mergedv2")
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
||||
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6")
|
||||
paperclip("io.papermc:paperclip:3.0.3")
|
||||
@@ -131,15 +131,15 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.collectAtsFromPatches {
|
||||
// Uncomment while updating for a new Minecraft version
|
||||
// extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
|
||||
}
|
||||
|
||||
// Uncomment while updating for a new Minecraft version
|
||||
// tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
|
||||
// filterPatches.set(false)
|
||||
// }
|
||||
/*
|
||||
tasks.collectAtsFromPatches {
|
||||
extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
|
||||
}
|
||||
tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
|
||||
filterPatches.set(false)
|
||||
}
|
||||
*/
|
||||
|
||||
tasks.register("printMinecraftVersion") {
|
||||
doLast {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
group=io.papermc.paper
|
||||
version=1.20.1-experimental-SNAPSHOT
|
||||
mcVersion=1.20.1
|
||||
version=1.20.2-R0.1-SNAPSHOT
|
||||
mcVersion=1.20.2
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -83,10 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -133,10 +131,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
|
||||
@@ -27,10 +27,10 @@ index 11038da2e071699d6561a331565db0c8d7850d0e..317acfec5894101294a55abff6181943
|
||||
+/.factorypath
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5
|
||||
index 0000000000000000000000000000000000000000..41e77b687df6480adf8f5e21daad105dab208df2
|
||||
--- /dev/null
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +1,86 @@
|
||||
@@ -0,0 +1,91 @@
|
||||
+plugins {
|
||||
+ `java-library`
|
||||
+ `maven-publish`
|
||||
@@ -42,28 +42,29 @@ index 0000000000000000000000000000000000000000..b1634fe921f5cd4e0b76823e33db5bc3
|
||||
+}
|
||||
+
|
||||
+val annotationsVersion = "24.0.1"
|
||||
+val bungeeCordChatVersion = "1.20-R0.1"
|
||||
+
|
||||
+dependencies {
|
||||
+ // api dependencies are listed transitively to API consumers
|
||||
+ api("com.google.guava:guava:31.1-jre")
|
||||
+ api("com.google.code.gson:gson:2.10")
|
||||
+ api("net.md-5:bungeecord-chat:1.16-R0.4")
|
||||
+ api("org.yaml:snakeyaml:2.0")
|
||||
+ api("com.google.guava:guava:32.1.2-jre")
|
||||
+ api("com.google.code.gson:gson:2.10.1")
|
||||
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
|
||||
+ api("org.yaml:snakeyaml:2.2")
|
||||
+ api("org.joml:joml:1.10.5")
|
||||
+
|
||||
+ compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10")
|
||||
+ compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+
|
||||
+ val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
|
||||
+ compileOnly(annotations)
|
||||
+ testCompileOnly(annotations)
|
||||
+
|
||||
+ testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
+ testImplementation("junit:junit:4.13.2")
|
||||
+ testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
+ testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
+ testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
+ testImplementation("org.ow2.asm:asm-tree:9.5")
|
||||
+ testImplementation("org.mockito:mockito-core:5.3.1")
|
||||
+}
|
||||
+
|
||||
+configure<PublishingExtension> {
|
||||
@@ -99,10 +100,10 @@ index 0000000000000000000000000000000000000000..b1634fe921f5cd4e0b76823e33db5bc3
|
||||
+ options.use()
|
||||
+ options.isDocFilesSubDirs = true
|
||||
+ options.links(
|
||||
+ "https://guava.dev/releases/31.1-jre/api/docs/",
|
||||
+ "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/",
|
||||
+ "https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||
+ "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
||||
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
|
||||
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
|
||||
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
|
||||
+ )
|
||||
+ options.tags("apiNote:a:API Note:")
|
||||
+
|
||||
@@ -117,12 +118,16 @@ index 0000000000000000000000000000000000000000..b1634fe921f5cd4e0b76823e33db5bc3
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+tasks.test {
|
||||
+ useJUnitPlatform()
|
||||
+}
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
deleted file mode 100644
|
||||
index f9baf5cd570de24773b5ac2e5126475b5124d863..0000000000000000000000000000000000000000
|
||||
index a464312b63bb62d196d6ec2d55ffcdc85ae4da67..0000000000000000000000000000000000000000
|
||||
--- a/pom.xml
|
||||
+++ /dev/null
|
||||
@@ -1,276 +0,0 @@
|
||||
@@ -1,278 +0,0 @@
|
||||
-
|
||||
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
@@ -130,7 +135,7 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
-
|
||||
- <groupId>org.spigotmc</groupId>
|
||||
- <artifactId>spigot-api</artifactId>
|
||||
- <version>1.20.1-experimental-SNAPSHOT</version>
|
||||
- <version>1.20.2-R0.1-SNAPSHOT</version>
|
||||
- <packaging>jar</packaging>
|
||||
-
|
||||
- <name>Spigot-API</name>
|
||||
@@ -139,8 +144,8 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
-
|
||||
- <properties>
|
||||
- <skipTests>true</skipTests>
|
||||
- <maven.compiler.source>9</maven.compiler.source>
|
||||
- <maven.compiler.target>9</maven.compiler.target>
|
||||
- <maven.compiler.source>1.8</maven.compiler.source>
|
||||
- <maven.compiler.target>1.8</maven.compiler.target>
|
||||
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
- </properties>
|
||||
-
|
||||
@@ -160,14 +165,14 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <dependency>
|
||||
- <groupId>com.google.guava</groupId>
|
||||
- <artifactId>guava</artifactId>
|
||||
- <version>31.1-jre</version>
|
||||
- <version>32.1.2-jre</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <!-- bundled with Minecraft, should be kept in sync -->
|
||||
- <dependency>
|
||||
- <groupId>com.google.code.gson</groupId>
|
||||
- <artifactId>gson</artifactId>
|
||||
- <version>2.10</version>
|
||||
- <version>2.10.1</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <!-- bundled with Minecraft, should be kept in sync -->
|
||||
@@ -180,33 +185,33 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <dependency>
|
||||
- <groupId>net.md-5</groupId>
|
||||
- <artifactId>bungeecord-chat</artifactId>
|
||||
- <version>1.16-R0.4</version>
|
||||
- <version>1.20-R0.1</version>
|
||||
- <type>jar</type>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.yaml</groupId>
|
||||
- <artifactId>snakeyaml</artifactId>
|
||||
- <version>2.0</version>
|
||||
- <version>2.2</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <!-- not part of the API proper -->
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven</groupId>
|
||||
- <artifactId>maven-resolver-provider</artifactId>
|
||||
- <version>3.9.2</version>
|
||||
- <version>3.8.5</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-connector-basic</artifactId>
|
||||
- <version>1.9.10</version>
|
||||
- <version>1.7.3</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-transport-http</artifactId>
|
||||
- <version>1.9.10</version>
|
||||
- <version>1.7.3</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <!-- annotations -->
|
||||
@@ -218,15 +223,21 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- </dependency>
|
||||
- <!-- testing -->
|
||||
- <dependency>
|
||||
- <groupId>junit</groupId>
|
||||
- <artifactId>junit</artifactId>
|
||||
- <version>4.13.2</version>
|
||||
- <groupId>org.junit.jupiter</groupId>
|
||||
- <artifactId>junit-jupiter</artifactId>
|
||||
- <version>5.10.0</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.hamcrest</groupId>
|
||||
- <artifactId>hamcrest-library</artifactId>
|
||||
- <version>1.3</version>
|
||||
- <artifactId>hamcrest</artifactId>
|
||||
- <version>2.2</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.mockito</groupId>
|
||||
- <artifactId>mockito-core</artifactId>
|
||||
- <version>5.5.0</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
@@ -235,12 +246,6 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <version>9.5</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.mockito</groupId>
|
||||
- <artifactId>mockito-core</artifactId>
|
||||
- <version>5.3.1</version>
|
||||
- <scope>test</scope>
|
||||
- </dependency>
|
||||
- </dependencies>
|
||||
-
|
||||
- <build>
|
||||
@@ -248,7 +253,7 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <plugin>
|
||||
- <groupId>net.md-5</groupId>
|
||||
- <artifactId>scriptus</artifactId>
|
||||
- <version>0.4.1</version>
|
||||
- <version>0.5.0</version>
|
||||
- <executions>
|
||||
- <execution>
|
||||
- <phase>initialize</phase>
|
||||
@@ -294,7 +299,7 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <plugin>
|
||||
- <groupId>org.apache.maven.plugins</groupId>
|
||||
- <artifactId>maven-shade-plugin</artifactId>
|
||||
- <version>3.4.1</version>
|
||||
- <version>3.5.0</version>
|
||||
- <executions>
|
||||
- <execution>
|
||||
- <phase>package</phase>
|
||||
@@ -325,9 +330,6 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- <configuration>
|
||||
- <links>
|
||||
- <link>https://guava.dev/releases/31.1-jre/api/docs/</link>
|
||||
- <link>https://javadoc.io/doc/org.yaml/snakeyaml/2.0/</link>
|
||||
- <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/24.0.1/</link>
|
||||
- <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link>
|
||||
- </links>
|
||||
- <tags>
|
||||
- <tag>
|
||||
@@ -338,6 +340,11 @@ index f9baf5cd570de24773b5ac2e5126475b5124d863..00000000000000000000000000000000
|
||||
- </tags>
|
||||
- </configuration>
|
||||
- </plugin>
|
||||
- <plugin>
|
||||
- <groupId>org.apache.maven.plugins</groupId>
|
||||
- <artifactId>maven-surefire-plugin</artifactId>
|
||||
- <version>3.1.0</version>
|
||||
- </plugin>
|
||||
- </plugins>
|
||||
- </build>
|
||||
-
|
||||
|
||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Build system changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5..61e15811e94effd303d55f8fa14c9fbf0ca6438e 100644
|
||||
index 41e77b687df6480adf8f5e21daad105dab208df2..d86ee6acb78d249424c5df98a851178c0f62eec1 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -17,15 +17,27 @@ dependencies {
|
||||
api("net.md-5:bungeecord-chat:1.16-R0.4")
|
||||
api("org.yaml:snakeyaml:2.0")
|
||||
@@ -18,15 +18,27 @@ dependencies {
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
|
||||
api("org.yaml:snakeyaml:2.2")
|
||||
api("org.joml:joml:1.10.5")
|
||||
+ // Paper start
|
||||
+ api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
@@ -18,9 +18,9 @@ index b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5..61e15811e94effd303d55f8fa14c9fbf
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+ compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
|
||||
|
||||
- val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
|
||||
@@ -35,20 +35,25 @@ index b1634fe921f5cd4e0b76823e33db5bc3ca50a8b5..61e15811e94effd303d55f8fa14c9fbf
|
||||
+ // Paper end
|
||||
+
|
||||
testImplementation("org.apache.commons:commons-lang3:3.12.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("org.hamcrest:hamcrest-library:1.3")
|
||||
@@ -68,7 +80,7 @@ tasks.withType<Javadoc> {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
@@ -69,8 +81,12 @@ tasks.withType<Javadoc> {
|
||||
options.links(
|
||||
"https://guava.dev/releases/31.1-jre/api/docs/",
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.0/",
|
||||
"https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
||||
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
|
||||
+ "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
|
||||
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
|
||||
"https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
|
||||
+ // Paper start - add missing javadoc links
|
||||
+ "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
|
||||
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
|
||||
+ // Paper end
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
@@ -84,3 +96,14 @@ tasks.withType<Javadoc> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,3 +105,14 @@ tasks.withType<Javadoc> {
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
+
|
||||
+// Paper start
|
||||
|
||||
@@ -3,7 +3,6 @@ From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sun, 17 Mar 2019 23:04:30 +0000
|
||||
Subject: [PATCH] Test changes
|
||||
|
||||
- convert to mockito for mocking of types
|
||||
- Allow use of TYPE_USE annotations
|
||||
- Ignore package-private methods for nullability annotations
|
||||
- Add excludes for classes which don't pass
|
||||
@@ -12,6 +11,23 @@ Subject: [PATCH] Test changes
|
||||
Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index d86ee6acb78d249424c5df98a851178c0f62eec1..75bfb0ab8049ebbb52240abf661d469de5526767 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -106,6 +106,12 @@ tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+// Paper start - compile tests with -parameters for better junit parameterized test names
|
||||
+tasks.compileTestJava {
|
||||
+ options.compilerArgs.add("-parameters")
|
||||
+}
|
||||
+// Paper end
|
||||
+
|
||||
// Paper start
|
||||
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
|
||||
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
|
||||
diff --git a/src/test/java/io/papermc/paper/testing/EmptyTag.java b/src/test/java/io/papermc/paper/testing/EmptyTag.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f559ebc18
|
||||
@@ -50,7 +66,7 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
index 4ac3dd977e75cd8464163351d306e037ee32cb48..c26ea217927ba77611e6ae93f8df50a83bceb3dd 100644
|
||||
index 64e7aef6220097edefdff3b98a771b988365930d..abadff47166722fdc756afdbc6ac7242b6bd4fb0 100644
|
||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
@@ -29,7 +29,13 @@ public class AnnotationTest {
|
||||
@@ -146,8 +162,8 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..c26ea217927ba77611e6ae93f8df50a8
|
||||
+ builder.append("\t").append(message).append("\n");
|
||||
}
|
||||
|
||||
- Assert.fail("There " + errors.size() + " are missing annotation(s)");
|
||||
+ Assert.fail(builder.toString());
|
||||
- fail("There " + errors.size() + " are missing annotation(s)");
|
||||
+ fail(builder.toString());
|
||||
}
|
||||
|
||||
private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {
|
||||
@@ -205,29 +221,30 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..c26ea217927ba77611e6ae93f8df50a8
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/BukkitMirrorTest.java b/src/test/java/org/bukkit/BukkitMirrorTest.java
|
||||
index 2dfada66067d79b84cd490eadbe0178e8cd8c260..06d66512c91c680130132b79e34fbf32245ff9ee 100644
|
||||
index 89ca06ebecdaadd5dfc7bc74473ca15ad36f6eff..5974ceea58940e1799f3589eac0e39b925a42c3b 100644
|
||||
--- a/src/test/java/org/bukkit/BukkitMirrorTest.java
|
||||
+++ b/src/test/java/org/bukkit/BukkitMirrorTest.java
|
||||
@@ -20,6 +20,7 @@ public class BukkitMirrorTest {
|
||||
@@ -9,6 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
@Parameters(name = "{index}: {1}")
|
||||
public static List<Object[]> data() {
|
||||
+ if (true) return List.of(); // Paper
|
||||
return Lists.transform(Arrays.asList(Server.class.getDeclaredMethods()), new Function<Method, Object[]>() {
|
||||
@Override
|
||||
public Object[] apply(Method input) {
|
||||
diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java
|
||||
index 1e407c612c7dc26a2bea4b6ed70e1f0723dc3762..e3480404af8187588787383b18e3002032653d71 100644
|
||||
--- a/src/test/java/org/bukkit/TestServer.java
|
||||
+++ b/src/test/java/org/bukkit/TestServer.java
|
||||
@@ -59,6 +59,10 @@ public final class TestServer {
|
||||
+@org.junit.jupiter.api.Disabled // Paper
|
||||
public class BukkitMirrorTest {
|
||||
|
||||
Mockito.when(instance.getUnsafe()).then(mock -> unsafeValues);
|
||||
public static Stream<Arguments> data() {
|
||||
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
|
||||
index 79173d6ed844f1e640e3aa745a9b560ec5e6a2bc..73ec679ac0d1f398b417bd174b47f9af93351e27 100644
|
||||
--- a/src/test/java/org/bukkit/support/TestServer.java
|
||||
+++ b/src/test/java/org/bukkit/support/TestServer.java
|
||||
@@ -61,6 +61,11 @@ public final class TestServer {
|
||||
UnsafeValues unsafeValues = mock(withSettings().stubOnly());
|
||||
when(instance.getUnsafe()).thenReturn(unsafeValues);
|
||||
|
||||
+ // Paper start - test changes
|
||||
+ Mockito.when(instance.getTag(Mockito.anyString(), Mockito.any(NamespacedKey.class), Mockito.any())).thenAnswer(ignored -> new io.papermc.paper.testing.EmptyTag());
|
||||
+ // Paper end
|
||||
+ // Paper start - testing changes
|
||||
+ when(instance.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new io.papermc.paper.testing.EmptyTag());
|
||||
+ when(instance.getScoreboardCriteria(anyString())).thenReturn(null);
|
||||
+ // Paper end - testing changes
|
||||
+
|
||||
Bukkit.setServer(instance);
|
||||
server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance));
|
||||
} catch (Throwable t) {
|
||||
Bukkit.setServer(instance);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ Subject: [PATCH] Add FastUtil to Bukkit
|
||||
Doesn't expose to plugins, just allows Paper-API to use it for optimization
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index c174d9d6534382ae9d002b883bde929d46e32789..3e571743e76b26167e329dbd0a4c04ffd6427572 100644
|
||||
index 75bfb0ab8049ebbb52240abf661d469de5526767..ecba866b84bc5f86a442bf220ab24ed8706aadf9 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -21,6 +21,7 @@ dependencies {
|
||||
@@ -22,6 +22,7 @@ dependencies {
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
isTransitive = false // includes junit
|
||||
}
|
||||
+ api("it.unimi.dsi:fastutil:8.5.6")
|
||||
// Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+340
-256
File diff suppressed because it is too large.
Load diff
@@ -26,23 +26,3 @@ index 0000000000000000000000000000000000000000..9db0056ab94145819628b3ad8d8d2613
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 2d334dbdd9e2c9a020899097e0620152758dc078..639d275b8318d19afd18996e1daa4e800927a84d 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -5,6 +5,7 @@ import org.bukkit.advancement.Advancement;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.Biome;
|
||||
+import org.bukkit.block.BlockType;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@@ -47,6 +48,7 @@ public interface UnsafeValues {
|
||||
Material fromLegacy(MaterialData material, boolean itemPriority);
|
||||
|
||||
Material toMaterial(ItemType itemType);
|
||||
+ Material blockTypeToMaterial(BlockType<?> blockType); // Paper
|
||||
|
||||
BlockData fromLegacy(Material material, byte data);
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
|
||||
Uses method handles for private or static methods.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index a6001fec6b8ff6a0d41336802d202e005ad2db81..a626bbad85f8d1b348d4e67f328f4b0141b267c1 100644
|
||||
index 2377d476aee8c88d26ca715fdb756dc97749aac8..0c6e0bb90fe5ea29c467323a179a47ec122ba0f6 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -42,6 +42,9 @@ dependencies {
|
||||
@@ -18,7 +18,7 @@ index a6001fec6b8ff6a0d41336802d202e005ad2db81..a626bbad85f8d1b348d4e67f328f4b01
|
||||
+ implementation("org.ow2.asm:asm-commons:9.4")
|
||||
// Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5b28e9b1daba7834af67dbc193dd656bedd9a994
|
||||
|
||||
@@ -5,18 +5,26 @@ Subject: [PATCH] Paper Plugins
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 04433b1f41c5abf04743ed6dd96bf83267a39828..8b4f7f0166a1323266c603ca4c860980617f5eda 100644
|
||||
index 0c6e0bb90fe5ea29c467323a179a47ec122ba0f6..145f6209a984e74da2d2de03cf725c06c77ef8da 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -47,7 +47,7 @@ dependencies {
|
||||
implementation("org.ow2.asm:asm-commons:9.4")
|
||||
// Paper end
|
||||
|
||||
- compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
+ api("org.apache.maven:maven-resolver-provider:3.9.2")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10")
|
||||
- compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+ api("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
|
||||
@@ -118,6 +118,7 @@ tasks.withType<Javadoc> {
|
||||
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
||||
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
||||
// Paper end
|
||||
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/PermissionManager.java b/src/main/java/io/papermc/paper/plugin/PermissionManager.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..cdbc93b317b3bab47bf6552c29cfbb2c27846933
|
||||
@@ -703,7 +711,7 @@ index 0000000000000000000000000000000000000000..0546fa1e9dcd7155086a8650806a8c08
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93da4bd634
|
||||
index 0000000000000000000000000000000000000000..e3da0d67cab01e1233dccde1a12ff25961ee79fb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java
|
||||
@@ -0,0 +1,45 @@
|
||||
@@ -728,7 +736,7 @@ index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93
|
||||
+ * resulting in a jar library that provides the jar at {@code libs/custom-library-1.24.jar} to the plugins classloader
|
||||
+ * at runtime.
|
||||
+ * <p>
|
||||
+ * The jar library implementation will error if file exists at the specified path.
|
||||
+ * The jar library implementation will error if the file does not exist at the specified path.
|
||||
+ */
|
||||
+public class JarLibrary implements ClassPathLibrary {
|
||||
+
|
||||
@@ -754,7 +762,7 @@ index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5fa5b9141
|
||||
index 0000000000000000000000000000000000000000..9af07d168beadaa77e4965819200eeb94fe3e092
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
|
||||
@@ -0,0 +1,132 @@
|
||||
@@ -784,12 +792,12 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
|
||||
+import org.eclipse.aether.transfer.TransferEvent;
|
||||
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.slf4j.Logger;
|
||||
+import org.slf4j.LoggerFactory;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.List;
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.logging.Logger;
|
||||
+
|
||||
+/**
|
||||
+ * The maven library resolver acts as a resolver for yet to be resolved jar libraries that may be pulled from a
|
||||
@@ -810,7 +818,7 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
|
||||
+ */
|
||||
+public class MavenLibraryResolver implements ClassPathLibrary {
|
||||
+
|
||||
+ private static final Logger logger = Logger.getLogger("MavenLibraryResolver");
|
||||
+ private static final Logger logger = LoggerFactory.getLogger("MavenLibraryResolver");
|
||||
+
|
||||
+ private final RepositorySystem repository;
|
||||
+ private final DefaultRepositorySystemSession session;
|
||||
@@ -838,7 +846,7 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
|
||||
+ this.session.setTransferListener(new AbstractTransferListener() {
|
||||
+ @Override
|
||||
+ public void transferInitiated(@NotNull TransferEvent event) throws TransferCancelledException {
|
||||
+ logger.log(Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
|
||||
+ logger.info("Downloading {}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
|
||||
+ }
|
||||
+ });
|
||||
+ this.session.setReadOnly();
|
||||
@@ -1338,13 +1346,13 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index cd00a831cd4c6030082aa8107d25c78d8ee67d8f..628fae98b17cd7dd1a5358562225cefefeb5051b 100644
|
||||
index a3ee6f2f588bc9c87e49378359f450820b9af1b9..0743592273cc1c5f4ab6935349941bf25b438448 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -110,4 +110,13 @@ public interface UnsafeValues {
|
||||
EntityType<Entity> getUnkownEntityType();
|
||||
|
||||
Biome getCustomBiome();
|
||||
@@ -109,4 +109,14 @@ public interface UnsafeValues {
|
||||
* @return an internal potion data
|
||||
*/
|
||||
PotionType.InternalPotionData getInternalPotionData(NamespacedKey key);
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Deprecated(forRemoval = true)
|
||||
@@ -1354,6 +1362,7 @@ index cd00a831cd4c6030082aa8107d25c78d8ee67d8f..628fae98b17cd7dd1a5358562225cefe
|
||||
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
|
||||
+ return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java
|
||||
index 1dbbc244309043b18c1d71707c4fb066c0d0e02d..551c5af6a7bfa2268cbc63be8e70d129bccaa912 100644
|
||||
@@ -1440,10 +1449,10 @@ index 94f8ceb965cecb5669a84a0ec61c0f706c2a2673..e773db6da357ad210eb24d4c389af2dc
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
|
||||
index 77a380537b338fdd0aa2f6777ff775056cc6b221..028805bcdb1d2bb0d11387db165b7376579e5f60 100644
|
||||
index f48bdeb628a82416d93f84a0a10141447482bf83..c0691a849831f99268fdcb7b0f471f80a1a2a70e 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
|
||||
@@ -195,7 +195,7 @@ import org.yaml.snakeyaml.nodes.Tag;
|
||||
@@ -198,7 +198,7 @@ import org.yaml.snakeyaml.representer.Representer;
|
||||
* inferno.burningdeaths: true
|
||||
*</pre></blockquote>
|
||||
*/
|
||||
@@ -1452,7 +1461,7 @@ index 77a380537b338fdd0aa2f6777ff775056cc6b221..028805bcdb1d2bb0d11387db165b7376
|
||||
private static final Pattern VALID_NAME = Pattern.compile("^[A-Za-z0-9 _.-]+$");
|
||||
private static final ThreadLocal<Yaml> YAML = new ThreadLocal<Yaml>() {
|
||||
@Override
|
||||
@@ -255,6 +255,70 @@ public final class PluginDescriptionFile {
|
||||
@@ -259,6 +259,70 @@ public final class PluginDescriptionFile {
|
||||
private Set<PluginAwareness> awareness = ImmutableSet.of();
|
||||
private String apiVersion = null;
|
||||
private List<String> libraries = ImmutableList.of();
|
||||
@@ -2079,10 +2088,10 @@ index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..e4b6f278a811acbb0070e311c5c3bdaf
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fdadf45bdc 100644
|
||||
index 64a294aeb6fb548794708b38c3707f9dd882b2ff..74b6581a97a092c44a0876e7981ff8a8e6153100 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
@@ -29,7 +29,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -31,7 +31,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* A ClassLoader for plugins, to allow shared classes across multiple plugins
|
||||
*/
|
||||
@@ -2092,7 +2101,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
private final JavaPluginLoader loader;
|
||||
private final Map<String, Class<?>> classes = new ConcurrentHashMap<String, Class<?>>();
|
||||
private final PluginDescriptionFile description;
|
||||
@@ -43,24 +44,32 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -45,24 +46,32 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
private JavaPlugin pluginInit;
|
||||
private IllegalStateException pluginState;
|
||||
private final Set<String> seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||
@@ -2121,15 +2130,15 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
this.url = file.toURI().toURL();
|
||||
this.libraryLoader = libraryLoader;
|
||||
|
||||
+
|
||||
+ // Paper start
|
||||
+ this.dependencyContext = dependencyContext;
|
||||
+ this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
|
||||
+ // Paper end
|
||||
+
|
||||
Class<?> jarClass;
|
||||
try {
|
||||
Class<?> jarClass;
|
||||
try {
|
||||
@@ -94,6 +103,27 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
jarClass = Class.forName(description.getMain(), true, this);
|
||||
@@ -107,6 +116,27 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
return findResources(name);
|
||||
}
|
||||
|
||||
@@ -2157,7 +2166,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
@Override
|
||||
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
|
||||
return loadClass0(name, resolve, true, true);
|
||||
@@ -119,26 +149,11 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -132,26 +162,11 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
|
||||
if (checkGlobal) {
|
||||
// This ignores the libraries of other plugins, unless they are transitive dependencies.
|
||||
@@ -2186,7 +2195,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -167,7 +182,7 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -180,7 +195,7 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
throw new ClassNotFoundException(name, ex);
|
||||
}
|
||||
|
||||
@@ -2195,7 +2204,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
|
||||
int dot = name.lastIndexOf('.');
|
||||
if (dot != -1) {
|
||||
@@ -197,8 +212,8 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -210,8 +225,8 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
result = super.findClass(name);
|
||||
}
|
||||
|
||||
@@ -2205,7 +2214,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -207,6 +222,12 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -220,6 +235,12 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
try {
|
||||
@@ -2218,7 +2227,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
super.close();
|
||||
} finally {
|
||||
jar.close();
|
||||
@@ -218,7 +239,7 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -231,7 +252,7 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
return classes.values();
|
||||
}
|
||||
|
||||
@@ -2227,7 +2236,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
Preconditions.checkArgument(javaPlugin != null, "Initializing plugin cannot be null");
|
||||
Preconditions.checkArgument(javaPlugin.getClass().getClassLoader() == this, "Cannot initialize plugin outside of this class loader");
|
||||
if (this.plugin != null || this.pluginInit != null) {
|
||||
@@ -228,6 +249,38 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
@@ -241,6 +262,38 @@ final class PluginClassLoader extends URLClassLoader {
|
||||
pluginState = new IllegalStateException("Initial initialization");
|
||||
this.pluginInit = javaPlugin;
|
||||
|
||||
@@ -2267,75 +2276,35 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
|
||||
+
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java
|
||||
index e3480404af8187588787383b18e3002032653d71..ec00f2ac0fe2be6c3b4c25b027bc4ff36008e5e1 100644
|
||||
--- a/src/test/java/org/bukkit/TestServer.java
|
||||
+++ b/src/test/java/org/bukkit/TestServer.java
|
||||
@@ -4,9 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
-import org.bukkit.command.SimpleCommandMap;
|
||||
-import org.bukkit.plugin.PluginManager;
|
||||
-import org.bukkit.plugin.SimplePluginManager;
|
||||
+// Paper - Paper Plugins
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
@@ -20,7 +18,7 @@ public final class TestServer {
|
||||
|
||||
Mockito.when(instance.isPrimaryThread()).then(mock -> Thread.currentThread().equals(server.creatingThread));
|
||||
|
||||
- Mockito.when(instance.getPluginManager()).then(mock -> server.pluginManager);
|
||||
+ // Paper - Paper Plugins
|
||||
|
||||
Mockito.when(instance.getLogger()).then(new Answer<Logger>() {
|
||||
final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName());
|
||||
@@ -64,14 +62,14 @@ public final class TestServer {
|
||||
// Paper end
|
||||
|
||||
Bukkit.setServer(instance);
|
||||
- server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance));
|
||||
+ // Paper - Paper Plugins
|
||||
} catch (Throwable t) {
|
||||
throw new Error(t);
|
||||
}
|
||||
}
|
||||
|
||||
private Thread creatingThread = Thread.currentThread();
|
||||
- private PluginManager pluginManager;
|
||||
+ // Paper - Paper Plugins
|
||||
private TestServer() {}
|
||||
|
||||
public static void setup() {}
|
||||
diff --git a/src/test/java/org/bukkit/event/SyntheticEventTest.java b/src/test/java/org/bukkit/event/SyntheticEventTest.java
|
||||
deleted file mode 100644
|
||||
index d402cb59f508205ebe9ee450594826b04cecb90b..0000000000000000000000000000000000000000
|
||||
index 40a086f2883c4419d2bf0bd44285f7c55562ba3e..0000000000000000000000000000000000000000
|
||||
--- a/src/test/java/org/bukkit/event/SyntheticEventTest.java
|
||||
+++ /dev/null
|
||||
@@ -1,48 +0,0 @@
|
||||
@@ -1,49 +0,0 @@
|
||||
-package org.bukkit.event;
|
||||
-
|
||||
-import org.bukkit.TestServer;
|
||||
-import static org.junit.jupiter.api.Assertions.*;
|
||||
-import org.bukkit.Bukkit;
|
||||
-import org.bukkit.plugin.PluginLoader;
|
||||
-import org.bukkit.plugin.SimplePluginManager;
|
||||
-import org.bukkit.plugin.TestPlugin;
|
||||
-import org.bukkit.plugin.java.JavaPluginLoader;
|
||||
-import org.junit.Assert;
|
||||
-import org.junit.Test;
|
||||
-import org.bukkit.support.AbstractTestingBase;
|
||||
-import org.junit.jupiter.api.Test;
|
||||
-
|
||||
-public class SyntheticEventTest {
|
||||
-public class SyntheticEventTest extends AbstractTestingBase {
|
||||
- @SuppressWarnings("deprecation")
|
||||
- @Test
|
||||
- public void test() {
|
||||
- final JavaPluginLoader loader = new JavaPluginLoader(TestServer.getInstance());
|
||||
- final JavaPluginLoader loader = new JavaPluginLoader(Bukkit.getServer());
|
||||
- TestPlugin plugin = new TestPlugin(getClass().getName()) {
|
||||
- @Override
|
||||
- public PluginLoader getPluginLoader() {
|
||||
- return loader;
|
||||
- }
|
||||
- };
|
||||
- SimplePluginManager pluginManager = new SimplePluginManager(TestServer.getInstance(), null);
|
||||
- SimplePluginManager pluginManager = new SimplePluginManager(Bukkit.getServer(), null);
|
||||
-
|
||||
- TestEvent event = new TestEvent(false);
|
||||
- Impl impl = new Impl();
|
||||
@@ -2343,7 +2312,7 @@ index d402cb59f508205ebe9ee450594826b04cecb90b..00000000000000000000000000000000
|
||||
- pluginManager.registerEvents(impl, plugin);
|
||||
- pluginManager.callEvent(event);
|
||||
-
|
||||
- Assert.assertEquals(1, impl.callCount);
|
||||
- assertEquals(1, impl.callCount);
|
||||
- }
|
||||
-
|
||||
- public abstract static class Base<E extends Event> implements Listener {
|
||||
@@ -2364,28 +2333,28 @@ index d402cb59f508205ebe9ee450594826b04cecb90b..00000000000000000000000000000000
|
||||
-}
|
||||
diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java
|
||||
deleted file mode 100644
|
||||
index 7c7cdfb509997de9f58d1b2c758e308a10ec0f92..0000000000000000000000000000000000000000
|
||||
index 03b08e47e91e8b56c1992fcd749a62eb9e7d4d68..0000000000000000000000000000000000000000
|
||||
--- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java
|
||||
+++ /dev/null
|
||||
@@ -1,185 +0,0 @@
|
||||
-package org.bukkit.plugin;
|
||||
-
|
||||
-import static org.bukkit.support.MatcherAssert.*;
|
||||
-import static org.hamcrest.Matchers.*;
|
||||
-import static org.junit.Assert.*;
|
||||
-import org.bukkit.TestServer;
|
||||
-import org.bukkit.Bukkit;
|
||||
-import org.bukkit.event.Event;
|
||||
-import org.bukkit.event.TestEvent;
|
||||
-import org.bukkit.permissions.Permission;
|
||||
-import org.bukkit.support.AbstractTestingBase;
|
||||
-import org.junit.After;
|
||||
-import org.junit.Test;
|
||||
-import org.junit.jupiter.api.AfterEach;
|
||||
-import org.junit.jupiter.api.Test;
|
||||
-
|
||||
-public class PluginManagerTest extends AbstractTestingBase {
|
||||
- private class MutableObject {
|
||||
- volatile Object value = null;
|
||||
- }
|
||||
-
|
||||
- private static final PluginManager pm = TestServer.getInstance().getPluginManager();
|
||||
- private static final PluginManager pm = Bukkit.getServer().getPluginManager();
|
||||
-
|
||||
- private final MutableObject store = new MutableObject();
|
||||
-
|
||||
@@ -2534,20 +2503,20 @@ index 7c7cdfb509997de9f58d1b2c758e308a10ec0f92..00000000000000000000000000000000
|
||||
- private void testRemovePermissionByName(final String name) {
|
||||
- final Permission perm = new Permission(name);
|
||||
- pm.addPermission(perm);
|
||||
- assertThat("Permission \"" + name + "\" was not added", pm.getPermission(name), is(perm));
|
||||
- assertThat(pm.getPermission(name), is(perm), "Permission \"" + name + "\" was not added");
|
||||
- pm.removePermission(name);
|
||||
- assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
|
||||
- assertThat(pm.getPermission(name), is(nullValue()), "Permission \"" + name + "\" was not removed");
|
||||
- }
|
||||
-
|
||||
- private void testRemovePermissionByPermission(final String name) {
|
||||
- final Permission perm = new Permission(name);
|
||||
- pm.addPermission(perm);
|
||||
- assertThat("Permission \"" + name + "\" was not added", pm.getPermission(name), is(perm));
|
||||
- assertThat(pm.getPermission(name), is(perm), "Permission \"" + name + "\" was not added");
|
||||
- pm.removePermission(perm);
|
||||
- assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
|
||||
- assertThat(pm.getPermission(name), is(nullValue()), "Permission \"" + name + "\" was not removed");
|
||||
- }
|
||||
-
|
||||
- @After
|
||||
- @AfterEach
|
||||
- public void tearDown() {
|
||||
- pm.clearPlugins();
|
||||
- assertThat(pm.getPermissions(), is(empty()));
|
||||
@@ -2570,3 +2539,17 @@ index a8be3e23e3e280ad301d9530de50028515612966..43b58e920e739bb949ac0673e9ef73ba
|
||||
|
||||
@Override
|
||||
public FileConfiguration getConfig() {
|
||||
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
|
||||
index 73ec679ac0d1f398b417bd174b47f9af93351e27..b208150297a23c0b4acb79135416809718f5650e 100644
|
||||
--- a/src/test/java/org/bukkit/support/TestServer.java
|
||||
+++ b/src/test/java/org/bukkit/support/TestServer.java
|
||||
@@ -25,8 +25,7 @@ public final class TestServer {
|
||||
Thread creatingThread = Thread.currentThread();
|
||||
when(instance.isPrimaryThread()).then(mock -> Thread.currentThread().equals(creatingThread));
|
||||
|
||||
- PluginManager pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance));
|
||||
- when(instance.getPluginManager()).thenReturn(pluginManager);
|
||||
+ // Paper - remove plugin manager for Paper Plugins
|
||||
|
||||
Logger logger = Logger.getLogger(TestServer.class.getCanonicalName());
|
||||
when(instance.getLogger()).thenReturn(logger);
|
||||
@@ -192,10 +192,10 @@ index 0000000000000000000000000000000000000000..93476aaf8d21efb5a30b6d2cc2eeda81
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/math/Position.java b/src/main/java/io/papermc/paper/math/Position.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57facf5422964
|
||||
index 0000000000000000000000000000000000000000..26bc5a0fa67855af87c8fd4cd8229b4d9f242740
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/math/Position.java
|
||||
@@ -0,0 +1,184 @@
|
||||
@@ -0,0 +1,191 @@
|
||||
+package io.papermc.paper.math;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
@@ -273,6 +273,13 @@ index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57fac
|
||||
+ boolean isFine();
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if each component of this position is finite.
|
||||
+ */
|
||||
+ default boolean isFinite() {
|
||||
+ return Double.isFinite(this.x()) && Double.isFinite(this.y()) && Double.isFinite(this.z());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a position offset by the specified amounts.
|
||||
+ *
|
||||
+ * @param x x value to offset
|
||||
@@ -381,7 +388,7 @@ index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57fac
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462e69b6546 100644
|
||||
index 7c4db051472fb6a6c6d24092dc6f75487356690a..85c342fc50f2fe0ce9a1b3980df9e088c3dea92d 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -393,7 +400,7 @@ index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462
|
||||
private Reference<World> world;
|
||||
private double x;
|
||||
private double y;
|
||||
@@ -706,4 +706,26 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
@@ -706,4 +706,31 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
}
|
||||
return pitch;
|
||||
}
|
||||
@@ -415,6 +422,11 @@ index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isFinite() {
|
||||
+ return io.papermc.paper.math.FinePosition.super.isFinite() && Float.isFinite(this.getYaw()) && Float.isFinite(this.getPitch());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull Location toLocation(@NotNull World world) {
|
||||
+ return new Location(world, this.x(), this.y(), this.z(), this.getYaw(), this.getPitch());
|
||||
+ }
|
||||
|
||||
@@ -717,10 +717,10 @@ index 0000000000000000000000000000000000000000..199789d56d22fcb1b77ebd56805cc28a
|
||||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e92bf50b9
|
||||
index 0000000000000000000000000000000000000000..eb9d58f8852e732a1284beeaf542989301d21b1c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||
@@ -0,0 +1,356 @@
|
||||
@@ -0,0 +1,355 @@
|
||||
+/*
|
||||
+ * This file is licensed under the MIT License (MIT).
|
||||
+ *
|
||||
@@ -751,9 +751,9 @@ index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e
|
||||
+import com.google.common.collect.Sets;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Chunk;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.World;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.block.BlockType;
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
@@ -762,9 +762,8 @@ index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e
|
||||
+
|
||||
+import java.lang.management.ManagementFactory;
|
||||
+import java.util.Collection;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.EnumMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Locale;
|
||||
+import java.util.Map;
|
||||
+import java.util.Set;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
@@ -798,7 +797,7 @@ index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e
|
||||
+ private final MinuteReport[] minuteReports;
|
||||
+
|
||||
+ private final TimingHistoryEntry[] entries;
|
||||
+ final Set<BlockType> tileEntityTypeSet = Sets.newHashSet();
|
||||
+ final Set<Material> tileEntityTypeSet = Sets.newHashSet();
|
||||
+ final Set<EntityType> entityTypeSet = Sets.newHashSet();
|
||||
+ private final Map<Object, Object> worlds;
|
||||
+
|
||||
@@ -869,20 +868,20 @@ index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e
|
||||
+ public JSONPair apply(Map.Entry<EntityType, Counter> entry) {
|
||||
+ entityTypeSet.add(entry.getKey());
|
||||
+ return pair(
|
||||
+ entry.getKey().getKey().getKey().toUpperCase(Locale.ENGLISH),
|
||||
+ String.valueOf(entry.getKey().ordinal()),
|
||||
+ entry.getValue().count()
|
||||
+ );
|
||||
+ }
|
||||
+ }
|
||||
+ ),
|
||||
+ toObjectMapper(input.tileEntityCounts.entrySet(),
|
||||
+ new Function<Map.Entry<BlockType, Counter>, JSONPair>() {
|
||||
+ new Function<Map.Entry<Material, Counter>, JSONPair>() {
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public JSONPair apply(Map.Entry<BlockType, Counter> entry) {
|
||||
+ public JSONPair apply(Map.Entry<Material, Counter> entry) {
|
||||
+ tileEntityTypeSet.add(entry.getKey());
|
||||
+ return pair(
|
||||
+ entry.getKey().getKey().getKey().toUpperCase(Locale.ENGLISH),
|
||||
+ String.valueOf(entry.getKey().ordinal()),
|
||||
+ entry.getValue().count()
|
||||
+ );
|
||||
+ }
|
||||
@@ -931,11 +930,11 @@ index 0000000000000000000000000000000000000000..7213bd2ccf6fa03933a9dff878baee8e
|
||||
+
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ final Map<EntityType, Counter> entityCounts = MRUMapCache.of(LoadingMap.of(
|
||||
+ new HashMap<>(), k -> new Counter()
|
||||
+ new EnumMap<EntityType, Counter>(EntityType.class), k -> new Counter()
|
||||
+ ));
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ final Map<BlockType, Counter> tileEntityCounts = MRUMapCache.of(LoadingMap.of(
|
||||
+ new HashMap<>(), k -> new Counter()
|
||||
+ final Map<Material, Counter> tileEntityCounts = MRUMapCache.of(LoadingMap.of(
|
||||
+ new EnumMap<Material, Counter>(Material.class), k -> new Counter()
|
||||
+ ));
|
||||
+
|
||||
+ static class RegionId {
|
||||
@@ -2855,7 +2854,7 @@ index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 208825df2752c10caf2cf8fb860d5b25bdd429b2..e2f7f9ebed56f5d4ca23dafe313263b386121391 100644
|
||||
index b7bc68c5d0dbb41c089f59b7db51342d45d1fc74..8d101352f72fc7fa21e0ba68039c79ce2fb92eb9 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -833,7 +833,6 @@ public final class Bukkit {
|
||||
@@ -2867,10 +2866,10 @@ index 208825df2752c10caf2cf8fb860d5b25bdd429b2..e2f7f9ebed56f5d4ca23dafe313263b3
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 7aacf5c174dc66df0f605236ace5bcd2c5689a3b..520cbdb2cc7da4550e9346ebdfea0e80f32a49b6 100644
|
||||
index e3602c6703b29ffec17ef7806c9deb3eead8a112..3e642d8a0294f7290c3d4310813e6e8a467810e7 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1819,6 +1819,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1835,6 +1835,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@@ -2898,10 +2897,10 @@ index 7aacf5c174dc66df0f605236ace5bcd2c5689a3b..520cbdb2cc7da4550e9346ebdfea0e80
|
||||
* Sends the component to the player
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index e800b6abb43fcb95937f1a8719761b4e2da84318..1a4212141fae926950a95e7bb584b28b21e20ba1 100644
|
||||
index 0743592273cc1c5f4ab6935349941bf25b438448..659405d84b5a61618576e930805da5cd3a054b4c 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -39,6 +39,7 @@ public interface UnsafeValues {
|
||||
@@ -36,6 +36,7 @@ public interface UnsafeValues {
|
||||
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
|
||||
// Paper end
|
||||
|
||||
@@ -2909,13 +2908,12 @@ index e800b6abb43fcb95937f1a8719761b4e2da84318..1a4212141fae926950a95e7bb584b28b
|
||||
Material toLegacy(Material material);
|
||||
|
||||
Material fromLegacy(Material material);
|
||||
@@ -119,4 +120,13 @@ public interface UnsafeValues {
|
||||
static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
|
||||
@@ -119,4 +120,12 @@ public interface UnsafeValues {
|
||||
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
|
||||
}
|
||||
+ // Paper end
|
||||
// Paper end
|
||||
+
|
||||
+ // Paper start - Timings
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Server name to report to timings v2
|
||||
+ * @return name
|
||||
@@ -3457,10 +3455,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
|
||||
- // Spigot end
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 5b5802be082f70a015b4a20c0ccdec1ee6f479f6..e7d6559f7a1e4cf88042a31e16d5b3370c2a0eb7 100644
|
||||
index e5a54a2f35d83f8c7a5f2b6512b86481aa7f9f51..c54d478035f7782074c00f870d41da8283fec538 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2187,7 +2187,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2346,7 +2346,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Deprecated // Paper
|
||||
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
@@ -3468,6 +3466,11 @@ index 5b5802be082f70a015b4a20c0ccdec1ee6f479f6..e7d6559f7a1e4cf88042a31e16d5b337
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * @return the player's ping
|
||||
+ * @deprecated use {@link Player#getPing()}
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public int getPing() {
|
||||
+ throw new UnsupportedOperationException( "Not supported yet." );
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
|
||||
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 51b5ac9d535d1ecac7719deed2e422db442a1171..6cae51327c3acf6aa0284be3c94d7fdf3cab3486 100644
|
||||
index 8d101352f72fc7fa21e0ba68039c79ce2fb92eb9..b5bdefc93d8614b5efbfd6e4c975275b9b53868c 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -78,6 +78,20 @@ public final class Bukkit {
|
||||
@@ -32,7 +32,7 @@ index 51b5ac9d535d1ecac7719deed2e422db442a1171..6cae51327c3acf6aa0284be3c94d7fdf
|
||||
* Attempts to set the {@link Server} singleton.
|
||||
* <p>
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index c8a8305e41a55e98c99ed9df07f5763071a4485f..3d54c3c09203558e2c5348a9100af6809651f3e8 100644
|
||||
index 3e642d8a0294f7290c3d4310813e6e8a467810e7..d4d87ce99ad757733a0f2dd1a02eb79f4ee7972f 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -63,6 +63,18 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 6de23a9dbaf012dd8a95bab55835bb406b59a012..592aae628d0b87b4277f1697b5aabde622d03710 100644
|
||||
index c54d478035f7782074c00f870d41da8283fec538..f21183cd5491b09e4543839252aed1ea10ddf849 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2039,6 +2039,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2198,6 +2198,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Deprecated // Paper
|
||||
public String getLocale();
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 6cae51327c3acf6aa0284be3c94d7fdf3cab3486..3ea91c82670ae329a11b3d035378be047d91e3e8 100644
|
||||
index b5bdefc93d8614b5efbfd6e4c975275b9b53868c..67ef3471a5ded760950459db5e65d20ca18af967 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1941,6 +1941,17 @@ public final class Bukkit {
|
||||
@@ -1964,6 +1964,17 @@ public final class Bukkit {
|
||||
return server.getEntity(uuid);
|
||||
}
|
||||
|
||||
@@ -27,10 +27,10 @@ index 6cae51327c3acf6aa0284be3c94d7fdf3cab3486..3ea91c82670ae329a11b3d035378be04
|
||||
* Get the advancement specified by this key.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 3d54c3c09203558e2c5348a9100af6809651f3e8..0eeefd5eb693af9e16182d6e39e7b4a1d8568bfa 100644
|
||||
index d4d87ce99ad757733a0f2dd1a02eb79f4ee7972f..3b273e3ef2160ea3e436cabdfc4b33f605ab82c6 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1653,6 +1653,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1672,6 +1672,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@Nullable
|
||||
Entity getEntity(@NotNull UUID uuid);
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index c84dc62c7383deeb00106c2e672af2018c4acadc..4c2ae9cb674260deba91d734bf7bf24fd7038485 100644
|
||||
index 659405d84b5a61618576e930805da5cd3a054b4c..4604392831d19a789e4906cf1a5f0197105fd6f2 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -128,5 +128,12 @@ public interface UnsafeValues {
|
||||
@@ -127,5 +127,12 @@ public interface UnsafeValues {
|
||||
* @return name
|
||||
*/
|
||||
String getTimingsServerName();
|
||||
@@ -73,21 +73,24 @@ index c84dc62c7383deeb00106c2e672af2018c4acadc..4c2ae9cb674260deba91d734bf7bf24f
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c2f46935f 100644
|
||||
index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b437cf212a63aa96a9492db8d01d5d37061aee23 100644
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.bukkit.command.defaults;
|
||||
|
||||
+import com.destroystokyo.paper.util.VersionFetcher; // Paper - version supplier
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -26,6 +27,15 @@ import org.bukkit.util.StringUtil;
|
||||
@@ -24,8 +24,25 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+// Paper start - version command 2.0
|
||||
+import com.destroystokyo.paper.util.VersionFetcher;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.format.NamedTextColor;
|
||||
+import net.kyori.adventure.text.event.ClickEvent;
|
||||
+import net.kyori.adventure.text.format.TextDecoration;
|
||||
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
+// Paper end - version command 2.0
|
||||
|
||||
public class VersionCommand extends BukkitCommand {
|
||||
+ private VersionFetcher versionFetcher;
|
||||
+ private VersionFetcher versionFetcher; // Paper - version command 2.0
|
||||
+ private VersionFetcher getVersionFetcher() { // lazy load because unsafe isn't available at command registration
|
||||
+ if (versionFetcher == null) {
|
||||
+ versionFetcher = Bukkit.getUnsafe().getVersionFetcher();
|
||||
@@ -99,7 +102,7 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
|
||||
public VersionCommand(@NotNull String name) {
|
||||
super(name);
|
||||
|
||||
@@ -40,7 +50,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -40,7 +57,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
if (args.length == 0) {
|
||||
@@ -108,12 +111,32 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
|
||||
sendVersion(sender);
|
||||
} else {
|
||||
StringBuilder name = new StringBuilder();
|
||||
@@ -146,14 +156,14 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -79,8 +96,17 @@ public class VersionCommand extends BukkitCommand {
|
||||
|
||||
private void describeToSender(@NotNull Plugin plugin, @NotNull CommandSender sender) {
|
||||
PluginDescriptionFile desc = plugin.getDescription();
|
||||
- sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion());
|
||||
-
|
||||
+ // Paper start - version command 2.0
|
||||
+ sender.sendMessage(
|
||||
+ Component.text()
|
||||
+ .append(Component.text(desc.getName(), NamedTextColor.GREEN))
|
||||
+ .append(Component.text(" version "))
|
||||
+ .append(Component.text(desc.getVersion(), NamedTextColor.GREEN)
|
||||
+ .hoverEvent(Component.text("Click to copy to clipboard", NamedTextColor.WHITE))
|
||||
+ .clickEvent(ClickEvent.copyToClipboard(desc.getVersion()))
|
||||
+ )
|
||||
+ );
|
||||
+ // Paper end - version command 2.0
|
||||
if (desc.getDescription() != null) {
|
||||
sender.sendMessage(desc.getDescription());
|
||||
}
|
||||
@@ -146,14 +172,14 @@ public class VersionCommand extends BukkitCommand {
|
||||
|
||||
private final ReentrantLock versionLock = new ReentrantLock();
|
||||
private boolean hasVersion = false;
|
||||
- private String versionMessage = null;
|
||||
+ private net.kyori.adventure.text.Component versionMessage = null; // Paper
|
||||
+ private Component versionMessage = null; // Paper
|
||||
private final Set<CommandSender> versionWaiters = new HashSet<CommandSender>();
|
||||
private boolean versionTaskStarted = false;
|
||||
private long lastCheck = 0;
|
||||
@@ -125,22 +148,22 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
|
||||
lastCheck = System.currentTimeMillis();
|
||||
hasVersion = false;
|
||||
} else {
|
||||
@@ -168,7 +178,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -168,7 +194,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
return;
|
||||
}
|
||||
versionWaiters.add(sender);
|
||||
- sender.sendMessage("Checking version, please wait...");
|
||||
+ sender.sendMessage(net.kyori.adventure.text.Component.text("Checking version, please wait...", net.kyori.adventure.text.format.NamedTextColor.WHITE, net.kyori.adventure.text.format.TextDecoration.ITALIC)); // Paper
|
||||
+ sender.sendMessage(Component.text("Checking version, please wait...", NamedTextColor.WHITE, TextDecoration.ITALIC)); // Paper
|
||||
if (!versionTaskStarted) {
|
||||
versionTaskStarted = true;
|
||||
new Thread(new Runnable() {
|
||||
@@ -186,6 +196,13 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -186,6 +212,13 @@ public class VersionCommand extends BukkitCommand {
|
||||
|
||||
private void obtainVersion() {
|
||||
String version = Bukkit.getVersion();
|
||||
+ // Paper start
|
||||
+ if (version.startsWith("null")) { // running from ide?
|
||||
+ setVersionMessage(net.kyori.adventure.text.Component.text("Unknown version, custom build?", net.kyori.adventure.text.format.NamedTextColor.YELLOW));
|
||||
+ setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
|
||||
+ return;
|
||||
+ }
|
||||
+ setVersionMessage(getVersionFetcher().getVersionMessage(version));
|
||||
@@ -148,7 +171,7 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
|
||||
if (version == null) version = "Custom";
|
||||
String[] parts = version.substring(0, version.indexOf(' ')).split("-");
|
||||
if (parts.length == 4) {
|
||||
@@ -215,11 +232,24 @@ public class VersionCommand extends BukkitCommand {
|
||||
@@ -215,11 +248,24 @@ public class VersionCommand extends BukkitCommand {
|
||||
} else {
|
||||
setVersionMessage("Unknown version, custom build?");
|
||||
}
|
||||
@@ -158,18 +181,18 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
|
||||
|
||||
- private void setVersionMessage(@NotNull String msg) {
|
||||
+ // Paper start
|
||||
+ private void setVersionMessage(final @NotNull net.kyori.adventure.text.Component msg) {
|
||||
+ private void setVersionMessage(final @NotNull Component msg) {
|
||||
lastCheck = System.currentTimeMillis();
|
||||
- versionMessage = msg;
|
||||
+ final net.kyori.adventure.text.Component message = net.kyori.adventure.text.TextComponent.ofChildren(
|
||||
+ net.kyori.adventure.text.Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", net.kyori.adventure.text.format.NamedTextColor.WHITE),
|
||||
+ net.kyori.adventure.text.Component.newline(),
|
||||
+ final Component message = Component.textOfChildren(
|
||||
+ Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", NamedTextColor.WHITE),
|
||||
+ Component.newline(),
|
||||
+ msg
|
||||
+ );
|
||||
+ this.versionMessage = net.kyori.adventure.text.Component.text()
|
||||
+ this.versionMessage = Component.text()
|
||||
+ .append(message)
|
||||
+ .hoverEvent(net.kyori.adventure.text.Component.text("Click to copy to clipboard", net.kyori.adventure.text.format.NamedTextColor.WHITE))
|
||||
+ .clickEvent(net.kyori.adventure.text.event.ClickEvent.copyToClipboard(net.kyori.adventure.text.serializer.plain.PlainComponentSerializer.plain().serialize(message)))
|
||||
+ .hoverEvent(Component.text("Click to copy to clipboard", NamedTextColor.WHITE))
|
||||
+ .clickEvent(ClickEvent.copyToClipboard(PlainTextComponentSerializer.plainText().serialize(message)))
|
||||
+ .build();
|
||||
+ // Paper end
|
||||
versionLock.lock();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 9cebad10eb06f42cd0428d80940fa8e223f0deab..083201330c781a0cb36051eef4ab95d4f1937a9d 100644
|
||||
index 121cd27185269339babae1757a604fbb5aabc869..63137429779d06fafb162f1bfb823d5149b3c58a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -725,5 +725,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -739,5 +739,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
|
||||
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.customName())));
|
||||
}
|
||||
@@ -25,10 +25,10 @@ index 9cebad10eb06f42cd0428d80940fa8e223f0deab..083201330c781a0cb36051eef4ab95d4
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
|
||||
index 60763c9b5b6528f5c8c83f53bb6cb8b1097a67b0..320a0e1f6b93ca9e85eac7d9a3f5821fa242c257 100644
|
||||
index d96fd494b523491fcf1ac54d164351fd487f65d6..ae1ce2ee2deb82f3f4144ec54b3ba119b437c5e9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
|
||||
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
|
||||
@@ -81,4 +81,15 @@ public interface FallingBlock extends Entity {
|
||||
@@ -126,4 +126,15 @@ public interface FallingBlock extends Entity {
|
||||
* @param damage the max damage to set. Must be >= 0
|
||||
*/
|
||||
void setMaxDamage(int damage);
|
||||
|
||||
@@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
|
||||
Also add send/no-tick view distance to World.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index d2e95c6ecc11b19ebb52c291884376c39d28467e..efe7ddee0c1321d3ab5c99d8e606ab04886c5d2c 100644
|
||||
index 1403d28bf9124e3c4cd741dfda06400318e8a0a0..3559115d09b57acf5c2853b811862e5131f2a625 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2642,6 +2642,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2663,6 +2663,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
int getSimulationDistance();
|
||||
// Spigot end
|
||||
|
||||
@@ -75,10 +75,10 @@ index d2e95c6ecc11b19ebb52c291884376c39d28467e..efe7ddee0c1321d3ab5c99d8e606ab04
|
||||
public class Spigot {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 592aae628d0b87b4277f1697b5aabde622d03710..eee3f8fb587b54d90e892b8c5d0b2eb290059bd4 100644
|
||||
index f21183cd5491b09e4543839252aed1ea10ddf849..f9b9e0269b3a9402c5be1c1c2007956415ff708a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2053,6 +2053,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2212,6 +2212,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param affects Whether the player can affect mob spawning
|
||||
*/
|
||||
public void setAffectsSpawning(boolean affects);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 3ea91c82670ae329a11b3d035378be047d91e3e8..6255c0b355dc978b50578629dc612011644a2501 100644
|
||||
index 67ef3471a5ded760950459db5e65d20ca18af967..b53e94d79862d66165bbcd2a79b82770398a7f3e 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2145,6 +2145,19 @@ public final class Bukkit {
|
||||
@@ -2165,6 +2165,19 @@ public final class Bukkit {
|
||||
return server.getUnsafe();
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ index 3ea91c82670ae329a11b3d035378be047d91e3e8..6255c0b355dc978b50578629dc612011
|
||||
public static Server.Spigot spigot() {
|
||||
return server.spigot();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 0eeefd5eb693af9e16182d6e39e7b4a1d8568bfa..b711cc420d4ab150275b06162e3e9540252b5b06 100644
|
||||
index 3b273e3ef2160ea3e436cabdfc4b33f605ab82c6..124e88e512d24b6ff7ace3cf7d5a6adf4c2bb40d 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1663,6 +1663,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1682,6 +1682,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
public double[] getTPS();
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
|
||||
Change Javadoc to be accurate
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 6255c0b355dc978b50578629dc612011644a2501..ba65e37ce5b8b6c5e449c6bbe8fa7d6a83082f15 100644
|
||||
index b53e94d79862d66165bbcd2a79b82770398a7f3e..9417030074fccdd9113bf75eb8f17f74b9a9118b 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -410,6 +410,30 @@ public final class Bukkit {
|
||||
@@ -41,7 +41,7 @@ index 6255c0b355dc978b50578629dc612011644a2501..ba65e37ce5b8b6c5e449c6bbe8fa7d6a
|
||||
* Gets the name of the update folder. The update folder is used to safely
|
||||
* update plugins at the right moment on a plugin load.
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index b711cc420d4ab150275b06162e3e9540252b5b06..eac6eb66b00403ed0541201e54347a0286b4387b 100644
|
||||
index 124e88e512d24b6ff7ace3cf7d5a6adf4c2bb40d..ccc825a2ea43bb84a5a08dff00c4d8ec27e4e95a 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -345,6 +345,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -76,10 +76,10 @@ index b711cc420d4ab150275b06162e3e9540252b5b06..eac6eb66b00403ed0541201e54347a02
|
||||
* Gets the name of the update folder. The update folder is used to safely
|
||||
* update plugins at the right moment on a plugin load.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index eee3f8fb587b54d90e892b8c5d0b2eb290059bd4..fe49a1871e1143bfd6579a5df02d6974e0eb7382 100644
|
||||
index f9b9e0269b3a9402c5be1c1c2007956415ff708a..284bb156c4430a9a8afce0a7dffa96722b8c29cc 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -903,6 +903,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1041,6 +1041,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
|
||||
index 4e440880bd82f3cd8b267f00b2fcd725b49ce981..c97970a6a44d61462c9d8d69f6aa12d9a8bb4e05 100644
|
||||
index 70fec73328227725f519af845ecbdce8be2fa4e2..04e7cd0e4e2d0eb38fb2862ce6688a4470f30d6b 100644
|
||||
--- a/src/main/java/org/bukkit/command/CommandSender.java
|
||||
+++ b/src/main/java/org/bukkit/command/CommandSender.java
|
||||
@@ -1,6 +1,9 @@
|
||||
@@ -18,7 +18,7 @@ index 4e440880bd82f3cd8b267f00b2fcd725b49ce981..c97970a6a44d61462c9d8d69f6aa12d9
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.permissions.Permissible;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -155,5 +158,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
|
||||
@@ -168,5 +171,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
|
||||
default void sendPlainMessage(final @NotNull String message) {
|
||||
this.sendMessage(net.kyori.adventure.text.Component.text(message));
|
||||
}
|
||||
|
||||
@@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index fe49a1871e1143bfd6579a5df02d6974e0eb7382..14f101acef4063c15d9c8c1e24eee33a4f4debb6 100644
|
||||
index 284bb156c4430a9a8afce0a7dffa96722b8c29cc..d5746291dd0cfc32591482945040e992ad1efb8e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -937,6 +937,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1075,6 +1075,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||
spigot().sendMessage(position, components);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ Upstream added methods for this so the original methods
|
||||
are now deprecated
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 2b816f0e6bdb912ceeff82c0043272b3970fe243..9977bb3cb5a66c84db816f8e4597db1c053f77c8 100644
|
||||
index 7c82644de3c438f45476ac02ce2c51c6fdbd543a..390bb294d09389877937ee2c6c3f346e65dfb178 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -215,12 +215,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -38,7 +38,7 @@ index 2b816f0e6bdb912ceeff82c0043272b3970fe243..9977bb3cb5a66c84db816f8e4597db1c
|
||||
|
||||
/**
|
||||
* Returns the living entity's current maximum no damage ticks.
|
||||
@@ -689,4 +703,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -722,4 +736,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @return Whether the entity is invisible
|
||||
*/
|
||||
public boolean isInvisible();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 14f101acef4063c15d9c8c1e24eee33a4f4debb6..3a1e584d584041f36b861e4507f7a58933f9b32d 100644
|
||||
index d5746291dd0cfc32591482945040e992ad1efb8e..e12d28143a213abdc0552a15e82cacecc414ca26 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1517,7 +1517,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1655,7 +1655,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the URL is null.
|
||||
* @throws IllegalArgumentException Thrown if the URL is too long. The
|
||||
* length restriction is an implementation specific arbitrary value.
|
||||
@@ -18,7 +18,7 @@ index 14f101acef4063c15d9c8c1e24eee33a4f4debb6..3a1e584d584041f36b861e4507f7a589
|
||||
public void setResourcePack(@NotNull String url);
|
||||
|
||||
/**
|
||||
@@ -2343,6 +2345,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2502,6 +2504,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
|
||||
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index ba65e37ce5b8b6c5e449c6bbe8fa7d6a83082f15..5c7a7d1cb0fc760f4209061aa653fdedb729dd36 100644
|
||||
index 9417030074fccdd9113bf75eb8f17f74b9a9118b..9003a603b6bf82a7b6f04fa027cdc889cf7c274f 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2180,6 +2180,13 @@ public final class Bukkit {
|
||||
@@ -2200,6 +2200,13 @@ public final class Bukkit {
|
||||
public static org.bukkit.command.CommandMap getCommandMap() {
|
||||
return server.getCommandMap();
|
||||
}
|
||||
@@ -24,10 +24,10 @@ index ba65e37ce5b8b6c5e449c6bbe8fa7d6a83082f15..5c7a7d1cb0fc760f4209061aa653fded
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index eac6eb66b00403ed0541201e54347a0286b4387b..27ff3b0b594bca7c5ae45937e1044e1b2f30c60b 100644
|
||||
index ccc825a2ea43bb84a5a08dff00c4d8ec27e4e95a..45e628f6c47945ce008d8436e3b13325bb5084d8 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1927,4 +1927,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1943,4 +1943,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@NotNull
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
|
||||
@@ -3,56 +3,96 @@ From: Jedediah Smith <jedediah@silencegreys.com>
|
||||
Date: Sat, 2 Apr 2016 05:08:36 -0400
|
||||
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
|
||||
|
||||
Adds the PlayerUseUnknownEntityEvent to be used by plugins dealing with
|
||||
virtual entities/entities that are not actually known to the server.
|
||||
|
||||
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..09cfdf48ead8f03f3497646537292174241b0868
|
||||
index 0000000000000000000000000000000000000000..a7228e248e3d8eb2e9f011dfe2c7dd9f3f48000f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
|
||||
@@ -0,0 +1,46 @@
|
||||
@@ -0,0 +1,82 @@
|
||||
+package com.destroystokyo.paper.event.player;
|
||||
+
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.inventory.EquipmentSlot;
|
||||
+import org.bukkit.util.Vector;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Represents an event that is called when a player right-clicks an unknown entity.
|
||||
+ * Useful for plugins dealing with virtual entities (entities that don't actually spawned on the server).
|
||||
+ * <br>
|
||||
+ * This event may be called multiple times per interaction with different interaction hands
|
||||
+ * and with or without the clicked position.
|
||||
+ */
|
||||
+public class PlayerUseUnknownEntityEvent extends PlayerEvent {
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
||||
+ private final int entityId;
|
||||
+ private final boolean attack;
|
||||
+ @NotNull private final EquipmentSlot hand;
|
||||
+ private final @NotNull EquipmentSlot hand;
|
||||
+ private final @Nullable Vector clickedPosition;
|
||||
+
|
||||
+ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand) {
|
||||
+ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand, @Nullable Vector clickedPosition) {
|
||||
+ super(who);
|
||||
+ this.entityId = entityId;
|
||||
+ this.attack = attack;
|
||||
+ this.hand = hand;
|
||||
+ this.clickedPosition = clickedPosition;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the entity id of the unknown entity that was interacted with.
|
||||
+ *
|
||||
+ * @return the entity id of the entity that was interacted with
|
||||
+ */
|
||||
+ public int getEntityId() {
|
||||
+ return this.entityId;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns whether the interaction was an attack.
|
||||
+ *
|
||||
+ * @return true if the player is attacking the entity, false if the player is interacting with the entity
|
||||
+ */
|
||||
+ public boolean isAttack() {
|
||||
+ return this.attack;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public EquipmentSlot getHand() {
|
||||
+ /**
|
||||
+ * Returns the hand used to perform this interaction.
|
||||
+ *
|
||||
+ * @return the hand used to interact
|
||||
+ */
|
||||
+ public @NotNull EquipmentSlot getHand() {
|
||||
+ return this.hand;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the position relative to the entity that was clicked, or null if not available.
|
||||
+ * See {@link org.bukkit.event.player.PlayerInteractAtEntityEvent} for more details.
|
||||
+ *
|
||||
+ * @return the position relative to the entity that was clicked, or null if not available
|
||||
+ * @see org.bukkit.event.player.PlayerInteractAtEntityEvent
|
||||
+ */
|
||||
+ public @Nullable Vector getClickedRelativePosition() {
|
||||
+ return this.clickedPosition != null ? this.clickedPosition.clone() : null;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ return HANDLERS;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ return HANDLERS;
|
||||
+ }
|
||||
+}
|
||||
@@ -58,10 +58,10 @@ index 0000000000000000000000000000000000000000..b387894fe8001edb41ad2ad2b70ebabe
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..97815eeb231cf0706b34fa47a4f7d1bb786305b4
|
||||
index 0000000000000000000000000000000000000000..2b01a50b6e18856f4c9e28340a7a111cae646a0a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java
|
||||
@@ -0,0 +1,116 @@
|
||||
@@ -0,0 +1,125 @@
|
||||
+package com.destroystokyo.paper.loottable;
|
||||
+
|
||||
+import org.bukkit.entity.Player;
|
||||
@@ -106,6 +106,15 @@ index 0000000000000000000000000000000000000000..97815eeb231cf0706b34fa47a4f7d1bb
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Checks if this player can loot this block. Takes into account the "restrict player reloot" settings
|
||||
+ *
|
||||
+ * @param player the player to check
|
||||
+ *
|
||||
+ * @return Whether this player can loot this block
|
||||
+ */
|
||||
+ boolean canPlayerLoot(@NotNull UUID player);
|
||||
+
|
||||
+ /**
|
||||
+ * Has this player ever looted this block
|
||||
+ * @param player The player to check
|
||||
+ * @return Whether or not this player has looted this block
|
||||
@@ -229,6 +238,16 @@ index 0000000000000000000000000000000000000000..fd184f13f5e8ee5cf829fff4f44696e1
|
||||
+ cancelled = cancel;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/block/Barrel.java b/src/main/java/org/bukkit/block/Barrel.java
|
||||
index aa1bb7a1a1c94b0b029bb60026efbc7f55584dd7..d3789b2b7dd71d7c1872a0d84698d35a1884101b 100644
|
||||
--- a/src/main/java/org/bukkit/block/Barrel.java
|
||||
+++ b/src/main/java/org/bukkit/block/Barrel.java
|
||||
@@ -5,4 +5,4 @@ import org.bukkit.loot.Lootable;
|
||||
/**
|
||||
* Represents a captured state of a Barrel.
|
||||
*/
|
||||
-public interface Barrel extends Container, Lootable, Lidded { }
|
||||
+public interface Barrel extends Container, com.destroystokyo.paper.loottable.LootableBlockInventory, Lidded { } // Paper
|
||||
diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java
|
||||
index b451191312e4fb19f2131c2d0a0c0337953f6c7c..db6affbc78106b2d93b41953b624a0bca0ca1d72 100644
|
||||
--- a/src/main/java/org/bukkit/block/Chest.java
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
|
||||
Reload the aliases stored in commands.yml
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 5c7a7d1cb0fc760f4209061aa653fdedb729dd36..763ba521c4b2cdfd0fda062281207dc790db76e1 100644
|
||||
index 9003a603b6bf82a7b6f04fa027cdc889cf7c274f..297f7befdac5c45efb1c9f432c49696814f513ab 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2187,6 +2187,15 @@ public final class Bukkit {
|
||||
@@ -2207,6 +2207,15 @@ public final class Bukkit {
|
||||
public static void reloadPermissions() {
|
||||
server.reloadPermissions();
|
||||
}
|
||||
@@ -26,10 +26,10 @@ index 5c7a7d1cb0fc760f4209061aa653fdedb729dd36..763ba521c4b2cdfd0fda062281207dc7
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 27ff3b0b594bca7c5ae45937e1044e1b2f30c60b..459ca6d2a797c4007fda3129badd44f35335615d 100644
|
||||
index 45e628f6c47945ce008d8436e3b13325bb5084d8..d80e9a6770c565c2cdb6bea6ad14969a6a6d0dad 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1929,4 +1929,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1945,4 +1945,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
// Spigot end
|
||||
|
||||
void reloadPermissions(); // Paper
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add String based Action Bar API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 3a1e584d584041f36b861e4507f7a58933f9b32d..5d47d3089f244b146aab63d54f5aefba51e481a9 100644
|
||||
index e12d28143a213abdc0552a15e82cacecc414ca26..3954f40b23536fec495585a8b14e82d092d62e39 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -904,6 +904,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1042,6 +1042,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
// Paper start
|
||||
@@ -48,7 +48,7 @@ index 3a1e584d584041f36b861e4507f7a58933f9b32d..5d47d3089f244b146aab63d54f5aefba
|
||||
/**
|
||||
* Sends the component to the player
|
||||
*
|
||||
@@ -931,9 +964,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1069,9 +1102,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Sends an array of components as a single message to the specified screen position of this player
|
||||
*
|
||||
|
||||
@@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size()
|
||||
which creates copy of the collections.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 887aa6217583d224d66f6d238ac269c23725d459..4ef6bbfa753da439ac57bd8d70dd114d73665c8d 100644
|
||||
index 3559115d09b57acf5c2853b811862e5131f2a625..dbb799aed5bbb80edd2428b63d3fce15cf2e2f05 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -46,6 +46,33 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -47,6 +47,33 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 763ba521c4b2cdfd0fda062281207dc790db76e1..0e83259a03292daf5c069d570a324ae0323351ef 100644
|
||||
index 297f7befdac5c45efb1c9f432c49696814f513ab..add298a1a0b6f6dbd72fe9e8f87794d193760fb7 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2196,6 +2196,16 @@ public final class Bukkit {
|
||||
@@ -2216,6 +2216,16 @@ public final class Bukkit {
|
||||
public static boolean reloadCommandAliases() {
|
||||
return server.reloadCommandAliases();
|
||||
}
|
||||
@@ -27,10 +27,10 @@ index 763ba521c4b2cdfd0fda062281207dc790db76e1..0e83259a03292daf5c069d570a324ae0
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 459ca6d2a797c4007fda3129badd44f35335615d..f8592dbe75680133e5db1e166fac48957c57cac9 100644
|
||||
index d80e9a6770c565c2cdb6bea6ad14969a6a6d0dad..22d508a6c80d7e19352bceb57009fdbcb16bc723 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1931,4 +1931,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1947,4 +1947,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
void reloadPermissions(); // Paper
|
||||
|
||||
boolean reloadCommandAliases(); // Paper
|
||||
|
||||
@@ -3,13 +3,12 @@ From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 10 Jun 2017 16:59:40 -0500
|
||||
Subject: [PATCH] Fix upstream javadocs
|
||||
|
||||
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/BanList.java b/src/main/java/org/bukkit/BanList.java
|
||||
index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f33589583 100644
|
||||
index a04cde615f8c4bc593f8d9f8f6f1438008aaa707..548f6d28c28d74bed8b58ee82875909354afe132 100644
|
||||
--- a/src/main/java/org/bukkit/BanList.java
|
||||
+++ b/src/main/java/org/bukkit/BanList.java
|
||||
@@ -27,6 +27,9 @@ public interface BanList {
|
||||
@@ -38,6 +38,9 @@ public interface BanList<T> {
|
||||
|
||||
/**
|
||||
* Gets a {@link BanEntry} by target.
|
||||
@@ -19,12 +18,9 @@ index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f
|
||||
*
|
||||
* @param target entry parameter to search for
|
||||
* @return the corresponding entry, or null if none found
|
||||
@@ -35,8 +38,11 @@ public interface BanList {
|
||||
public BanEntry getBanEntry(@NotNull String target);
|
||||
|
||||
@@ -59,6 +62,9 @@ public interface BanList<T> {
|
||||
/**
|
||||
- * Adds a ban to the this list. If a previous ban exists, this will
|
||||
+ * Adds a ban to this list. If a previous ban exists, this will
|
||||
* Adds a ban to this list. If a previous ban exists, this will
|
||||
* update the previous entry.
|
||||
+ * <p>
|
||||
+ * Bans by name for ban type {@link Type#NAME NAME} are no longer supported and this method will return
|
||||
@@ -32,7 +28,7 @@ index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f
|
||||
*
|
||||
* @param target the target of the ban
|
||||
* @param reason reason for the ban, null indicates implementation default
|
||||
@@ -60,6 +66,9 @@ public interface BanList {
|
||||
@@ -139,6 +145,9 @@ public interface BanList<T> {
|
||||
/**
|
||||
* Gets if a {@link BanEntry} exists for the target, indicating an active
|
||||
* ban status.
|
||||
@@ -41,8 +37,8 @@ index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f
|
||||
+ * The replacement is bans by UUID.
|
||||
*
|
||||
* @param target the target to find
|
||||
* @return true if a {@link BanEntry} exists for the name, indicating an
|
||||
@@ -70,6 +79,9 @@ public interface BanList {
|
||||
* @return true if a {@link BanEntry} exists for the target, indicating an
|
||||
@@ -161,6 +170,9 @@ public interface BanList<T> {
|
||||
/**
|
||||
* Removes the specified target from this list, therefore indicating a
|
||||
* "not banned" status.
|
||||
@@ -53,22 +49,10 @@ index 96ef22fe879c7be4f67bbb4d60c45ad11764dd5b..5dc9f9ede98d93925c99ee382e93f15f
|
||||
* @param target the target to remove from this list
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 0e83259a03292daf5c069d570a324ae0323351ef..1704d04097c9d364e5f9049a6a0f60945db482dd 100644
|
||||
index add298a1a0b6f6dbd72fe9e8f87794d193760fb7..b21f90f291a087b6282cd7b55e0075a01729f0ba 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1300,10 +1300,7 @@ public final class Bukkit {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Gets a ban list for the supplied type.
|
||||
- * <p>
|
||||
- * Bans by name are no longer supported and this method will return
|
||||
- * null when trying to request them. The replacement is bans by UUID.
|
||||
+ * Gets a ban list for the supplied type. <!-- Paper Remove notice: wrong place -->
|
||||
*
|
||||
* @param type the type of list to fetch, cannot be null
|
||||
* @return a ban list of the specified type
|
||||
@@ -1365,6 +1362,8 @@ public final class Bukkit {
|
||||
@@ -1388,6 +1388,8 @@ public final class Bukkit {
|
||||
|
||||
/**
|
||||
* Gets every player that has ever played on this server.
|
||||
@@ -78,10 +62,10 @@ index 0e83259a03292daf5c069d570a324ae0323351ef..1704d04097c9d364e5f9049a6a0f6094
|
||||
* @return an array containing all previous players
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/ChunkSnapshot.java b/src/main/java/org/bukkit/ChunkSnapshot.java
|
||||
index 803d4de580acc616424922fee4715a689b778886..94ab204a0739163613a5c651329606924c75d85b 100644
|
||||
index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f81413ed0dd1 100644
|
||||
--- a/src/main/java/org/bukkit/ChunkSnapshot.java
|
||||
+++ b/src/main/java/org/bukkit/ChunkSnapshot.java
|
||||
@@ -137,7 +137,7 @@ public interface ChunkSnapshot {
|
||||
@@ -136,7 +136,7 @@ public interface ChunkSnapshot {
|
||||
* Get raw biome temperature at given coordinates
|
||||
*
|
||||
* @param x X-coordinate (0-15)
|
||||
@@ -91,10 +75,10 @@ index 803d4de580acc616424922fee4715a689b778886..94ab204a0739163613a5c65132960692
|
||||
* @return temperature at given coordinate
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
index a73c954aad2957c630b64e7b750f33f73809f9b1..8264599a873ed23ec6552d1550a414ec3712487b 100644
|
||||
index 02de62c083ceaa466c80cb732e8304b8cc3f07f8..7c2b1eff41dd43fda84d84e76c05bbbf37c186b8 100644
|
||||
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
||||
@@ -159,7 +159,7 @@ public interface RegionAccessor {
|
||||
@@ -158,7 +158,7 @@ public interface RegionAccessor {
|
||||
* Creates a tree at the given {@link Location}
|
||||
*
|
||||
* @param location Location to spawn the tree
|
||||
@@ -103,7 +87,7 @@ index a73c954aad2957c630b64e7b750f33f73809f9b1..8264599a873ed23ec6552d1550a414ec
|
||||
* @param type Type of the tree to create
|
||||
* @return true if the tree was created successfully, otherwise false
|
||||
*/
|
||||
@@ -171,14 +171,14 @@ public interface RegionAccessor {
|
||||
@@ -170,14 +170,14 @@ public interface RegionAccessor {
|
||||
* The provided consumer gets called for every block which gets changed
|
||||
* as a result of the tree generation. When the consumer gets called no
|
||||
* modifications to the world are done yet. Which means, that calling
|
||||
@@ -120,7 +104,7 @@ index a73c954aad2957c630b64e7b750f33f73809f9b1..8264599a873ed23ec6552d1550a414ec
|
||||
* @param type Type of the tree to create
|
||||
* @param stateConsumer The consumer which should get called for every block which gets changed
|
||||
* @return true if the tree was created successfully, otherwise false
|
||||
@@ -198,7 +198,7 @@ public interface RegionAccessor {
|
||||
@@ -197,7 +197,7 @@ public interface RegionAccessor {
|
||||
* If it returns {@code false} the block won't get set in the world.
|
||||
*
|
||||
* @param location Location to spawn the tree
|
||||
@@ -130,7 +114,7 @@ index a73c954aad2957c630b64e7b750f33f73809f9b1..8264599a873ed23ec6552d1550a414ec
|
||||
* @param statePredicate The predicate which should get used to test if a block should be set or not.
|
||||
* @return true if the tree was created successfully, otherwise false
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index f8592dbe75680133e5db1e166fac48957c57cac9..dca2cbe8c93469c8c1c404bc34748a9dcf6d3368 100644
|
||||
index 22d508a6c80d7e19352bceb57009fdbcb16bc723..3c1862b9a9293155f756615b5bd23cc810a6df5e 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -543,13 +543,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -148,19 +132,7 @@ index f8592dbe75680133e5db1e166fac48957c57cac9..dca2cbe8c93469c8c1c404bc34748a9d
|
||||
*/
|
||||
public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory);
|
||||
|
||||
@@ -1109,10 +1106,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
public Set<OfflinePlayer> getBannedPlayers();
|
||||
|
||||
/**
|
||||
- * Gets a ban list for the supplied type.
|
||||
- * <p>
|
||||
- * Bans by name are no longer supported and this method will return
|
||||
- * null when trying to request them. The replacement is bans by UUID.
|
||||
+ * Gets a ban list for the supplied type. <!-- Paper Remove notice: wrong place -->
|
||||
*
|
||||
* @param type the type of list to fetch, cannot be null
|
||||
* @return a ban list of the specified type
|
||||
@@ -1162,6 +1156,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1181,6 +1178,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
|
||||
/**
|
||||
* Gets every player that has ever played on this server.
|
||||
@@ -170,10 +142,10 @@ index f8592dbe75680133e5db1e166fac48957c57cac9..dca2cbe8c93469c8c1c404bc34748a9d
|
||||
* @return an array containing all previous players
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 80189c7c70d7043016a24c0ac87655636408856e..a53a990477fd84f7f7dcb50058819eead8e8b5b5 100644
|
||||
index dbb799aed5bbb80edd2428b63d3fce15cf2e2f05..609e4908ed21f69b9e813500e702bbe784bff00c 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2556,7 +2556,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2577,7 +2577,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link StructureType}.
|
||||
* Finding unexplored structures can, and will, block if the world is
|
||||
@@ -182,7 +154,7 @@ index 80189c7c70d7043016a24c0ac87655636408856e..a53a990477fd84f7f7dcb50058819eea
|
||||
* temporarily freezing while locating an unexplored structure.
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
@@ -2590,7 +2590,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2611,7 +2611,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link StructureType}.
|
||||
* Finding unexplored structures can, and will, block if the world is
|
||||
@@ -191,7 +163,7 @@ index 80189c7c70d7043016a24c0ac87655636408856e..a53a990477fd84f7f7dcb50058819eea
|
||||
* temporarily freezing while locating an unexplored structure.
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
@@ -2623,7 +2623,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2644,7 +2644,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
/**
|
||||
* Find the closest nearby structure of a given {@link Structure}. Finding
|
||||
* unexplored structures can, and will, block if the world is looking in
|
||||
@@ -201,14 +173,14 @@ index 80189c7c70d7043016a24c0ac87655636408856e..a53a990477fd84f7f7dcb50058819eea
|
||||
* <p>
|
||||
* The {@code radius} is not a rigid square radius. Each structure may alter
|
||||
diff --git a/src/main/java/org/bukkit/block/Bed.java b/src/main/java/org/bukkit/block/Bed.java
|
||||
index 92532e335f07b14d1dad0de90c10f764d5fd9d8b..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644
|
||||
index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644
|
||||
--- a/src/main/java/org/bukkit/block/Bed.java
|
||||
+++ b/src/main/java/org/bukkit/block/Bed.java
|
||||
@@ -4,7 +4,22 @@ import org.bukkit.material.Colorable;
|
||||
|
||||
/**
|
||||
* Represents a captured state of a bed.
|
||||
- * @deprecated does not provide useful information beyond the block type itself
|
||||
- * @deprecated does not provide useful information beyond the material itself
|
||||
*/
|
||||
-@Deprecated
|
||||
-public interface Bed extends TileState, Colorable { }
|
||||
@@ -231,10 +203,10 @@ index 92532e335f07b14d1dad0de90c10f764d5fd9d8b..f4c37ce1fe7aac3dde8485ee51fc8888
|
||||
+// Paper end
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 1197cb8a6be92296c494010d87e046dfe912a161..d834e8d8d532ce5b46201ff5c02d54a6c047f615 100644
|
||||
index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..870ad6cd930653e6248abcc0fce94ffafbe9ebde 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -356,7 +356,7 @@ public interface Block extends Metadatable, Translatable {
|
||||
@@ -357,7 +357,7 @@ public interface Block extends Metadatable, Translatable {
|
||||
* Gets the temperature of this block.
|
||||
* <p>
|
||||
* If the raw biome temperature without adjusting for height effects is
|
||||
@@ -244,27 +216,18 @@ index 1197cb8a6be92296c494010d87e046dfe912a161..d834e8d8d532ce5b46201ff5c02d54a6
|
||||
* @return Temperature of this block
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
index dd286dd68682658af096790c048b88ee0c401214..7f4a858ab98f8d0c3c2f890ca88bc13b6ba967fa 100644
|
||||
index 2e2232956f626669005cfdfd6550aa8ee29fc1ab..869fa47a13fbcb128228963bf53cc72da4499a01 100644
|
||||
--- a/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
+++ b/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
@@ -208,15 +208,13 @@ public interface BlockData extends Cloneable {
|
||||
/**
|
||||
* Gets the ItemType that a player would use to place this block.
|
||||
* <p>
|
||||
- * For most blocks this is the same as {@link BlockType#asItemType()} but some blocks
|
||||
- * have different item types used to place them.
|
||||
- *
|
||||
+ * This is identical to {@link BlockType#getItemType()}.
|
||||
* For example:
|
||||
* <pre>
|
||||
* {@link ItemType#REDSTONE_WIRE} -> {@link BlockType#REDSTONE}
|
||||
* {@link ItemType#CARROTS} -> {@link BlockType#CARROT}
|
||||
@@ -215,7 +215,7 @@ public interface BlockData extends Cloneable {
|
||||
* {@link Material#REDSTONE_WIRE} -> {@link Material#REDSTONE}
|
||||
* {@link Material#CARROTS} -> {@link Material#CARROT}
|
||||
* </pre>
|
||||
- * @return placement item type
|
||||
+ * @return placement item type or {@link ItemType#AIR} if it doesn't have one
|
||||
- * @return placement material
|
||||
+ * @return placement material or {@link Material#AIR} if it doesn't have one
|
||||
*/
|
||||
@NotNull
|
||||
ItemType getPlacementType();
|
||||
Material getPlacementMaterial();
|
||||
diff --git a/src/main/java/org/bukkit/block/data/FaceAttachable.java b/src/main/java/org/bukkit/block/data/FaceAttachable.java
|
||||
index 9599e1237b9717ddbf84c3738bf6c1293e8b3c54..950266b4bb0a2fabeb9539c5676ed58f0b0fe620 100644
|
||||
--- a/src/main/java/org/bukkit/block/data/FaceAttachable.java
|
||||
@@ -353,7 +316,7 @@ index 8eb0cf31b1ce6d714a14cf65bbb117ff163ae2f3..8e57082e8b19a2fd9625816c2ea4a90d
|
||||
* in a state with no Custom Effects and PotionType.UNCRAFTABLE
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
index 0449664d7cd0c52ac34d2101110f1ab42070257c..57f8e7bf4c7b4c4a4e793cfd5d7db74384d8b1b5 100644
|
||||
index 1e56aef9188487d3e9c737e85025f601ab359a72..92cd35c87bad578c2b714761c93a5b72ebf4bc9e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
@@ -30,7 +30,7 @@ public interface EnderDragon extends ComplexLivingEntity, Boss, Mob, Enemy {
|
||||
@@ -365,32 +328,8 @@ index 0449664d7cd0c52ac34d2101110f1ab42070257c..57f8e7bf4c7b4c4a4e793cfd5d7db743
|
||||
* the portal, it will fly to it before mounting.
|
||||
*/
|
||||
LAND_ON_PORTAL,
|
||||
diff --git a/src/main/java/org/bukkit/entity/EntityCategory.java b/src/main/java/org/bukkit/entity/EntityCategory.java
|
||||
index fd960f20c79f721575c9bd4074a5ca9ab6b796b1..3e2ae87c806ce439d6c8848deecda48a28dbed96 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityCategory.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityCategory.java
|
||||
@@ -23,7 +23,7 @@ public enum EntityCategory {
|
||||
* <li>Are subject to burning in daylight (though not all).
|
||||
* <li>Sink in water (except {@link Drowned}, {@link Phantom Phantoms}
|
||||
* and {@link Wither Withers}).
|
||||
- * <li>Take additional damage from {@link Enchantment#DAMAGE_UNDEAD}.
|
||||
+ * <li>Take additional damage from {@link Enchantment#SMITE}.
|
||||
* <li>Are ignored by {@link Wither Withers}.
|
||||
* </ul>
|
||||
*/
|
||||
@@ -31,8 +31,8 @@ public enum EntityCategory {
|
||||
/**
|
||||
* Entities of the arthropod family. These creatures:
|
||||
* <ul>
|
||||
- * <li>Take additional damage and receive {@link PotionEffectType#SLOW}
|
||||
- * from {@link Enchantment#DAMAGE_ARTHROPODS}.
|
||||
+ * <li>Take additional damage and receive {@link PotionEffectType#SLOWNESS}
|
||||
+ * from {@link Enchantment#BANE_OF_ARTHROPODS}.
|
||||
* <li>Are immune to {@link PotionEffectType#POISON} if they are spiders.
|
||||
* </ul>
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index f2faa8b9a7da1c9af26f494ae82ae5372dcc4805..411dbbd8046a3157747713fea9ae19eca113e9b7 100644
|
||||
index 09936f3a2376a46721bbc8365c989581c2a789ef..3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -22,6 +22,11 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -447,10 +386,10 @@ index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218
|
||||
@Override
|
||||
public int getConversionTime();
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e25e4a3742 100644
|
||||
index 3954f40b23536fec495585a8b14e82d092d62e39..264c6bdeb2f1f0d937e4356d761a3264a1c4d58a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -327,15 +327,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -431,15 +431,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Saves the players current location, health, inventory, motion, and
|
||||
@@ -470,7 +409,7 @@ index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e2
|
||||
* <p>
|
||||
* Note: This will overwrite the players current inventory, health,
|
||||
* motion, etc, with the state from the saved dat file.
|
||||
@@ -570,7 +570,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -674,7 +674,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Plays an effect to just this player.
|
||||
*
|
||||
@@ -479,7 +418,7 @@ index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e2
|
||||
* @param loc the location to play the effect at
|
||||
* @param effect the {@link Effect}
|
||||
* @param data a data bit needed for some effects
|
||||
@@ -921,7 +921,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1059,7 +1059,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* Use supplied alternative character to the section symbol to represent legacy color codes.
|
||||
*
|
||||
@@ -488,7 +427,7 @@ index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e2
|
||||
* @param message The message to send
|
||||
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
|
||||
*/
|
||||
@@ -1387,7 +1387,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1525,7 +1525,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Allows this player to see a player that was previously hidden. If
|
||||
@@ -497,7 +436,7 @@ index 5d47d3089f244b146aab63d54f5aefba51e481a9..383d12b1ffc76bc8f9100a71027ac9e2
|
||||
* remain hidden until the other plugin calls this method too.
|
||||
*
|
||||
* @param plugin Plugin that wants to show the player
|
||||
@@ -1416,7 +1416,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1554,7 +1554,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
|
||||
/**
|
||||
* Allows this player to see an entity that was previously hidden. If
|
||||
@@ -551,18 +490,18 @@ index af5110b4160979c39cc1e5de6fa3bd7957b21403..15a0a733b0e5804655b5957cbf208312
|
||||
* @param location the location to remove
|
||||
* @see #getExploredLocations()
|
||||
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
|
||||
index fb4c6f92c7c16ff8cdc0a054a270b41d78dfcdde..a6e57f8ad3f09d05ca61c824d128221528f7a96d 100644
|
||||
index 6bf3af3ed81b66f61e53105d3591165ea74dba0e..a91400cd8bb4c72d1f3200a17f6de025540fe09d 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -225,7 +225,7 @@ public interface Villager extends AbstractVillager {
|
||||
@@ -202,7 +202,7 @@ public interface Villager extends AbstractVillager {
|
||||
*/
|
||||
public static final Profession NITWIT = getProfession("nitwit");
|
||||
NITWIT,
|
||||
/**
|
||||
- * Sheperd profession. Wears a brown robe. Shepherds primarily trade for
|
||||
+ * Shepherd profession. Wears a brown robe. Shepherds primarily trade for
|
||||
* wool items, and shears.
|
||||
*/
|
||||
public static final Profession SHEPHERD = getProfession("shepherd");
|
||||
SHEPHERD,
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
|
||||
index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd105d096e10 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
|
||||
@@ -579,7 +518,7 @@ index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd10
|
||||
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
index ff20d0768aed1732dcef8989c62e19c01e8ec70a..a4525c1ac5e6aa0130358739db35fbb732476e33 100644
|
||||
index be0a2d1f234d8265d98e54e518a994957b1f3ab7..4e3c406ba883aae553e8d69b6b719b872cd6096c 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
@@ -114,7 +114,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
|
||||
@@ -739,11 +678,86 @@ index c17ff41a688b2cbd877cda25d4ec033ac8ef5524..bd67b7cba78b9bbdd82a5a40048e658a
|
||||
*/
|
||||
public class PiglinBarterEvent extends EntityEvent implements Cancellable {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
|
||||
index bc71bc2d3ace0d19d730c09f05f9e0655bcee8f5..24077da8e6a7937f66eafc6779206055cf82e8d2 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
|
||||
@@ -8,7 +8,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
- * Called when an ItemStack is successfully burned as fuel in a furnace.
|
||||
+ * Called when an ItemStack is successfully burned as fuel in a furnace-like block such as a
|
||||
+ * {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
|
||||
+ * {@link org.bukkit.block.BlastFurnace}.
|
||||
*/
|
||||
public class FurnaceBurnEvent extends BlockEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||
index 020739697a0b535cad0b15b574f77cdabbdfa3eb..a965b6a78073c5da86ad671752eff4a270029420 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||
@@ -7,7 +7,9 @@ import org.bukkit.event.block.BlockExpEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
- * This event is called when a player takes items out of the furnace
|
||||
+ * This event is called when a player takes items out of a furnace-like block such as a
|
||||
+ * {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
|
||||
+ * {@link org.bukkit.block.BlastFurnace}.
|
||||
*/
|
||||
public class FurnaceExtractEvent extends BlockExpEvent {
|
||||
private final Player player;
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
|
||||
index 066e7dd9a34d35c8b643a5efcf95d6a5ef47c7ee..f8f9b08a0bd82a2667ae4e0c99dae9103f0db3f0 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
|
||||
@@ -6,7 +6,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
- * Called when an ItemStack is successfully smelted in a furnace.
|
||||
+ * Called when an ItemStack is successfully smelted in a furnace-like block
|
||||
+ * such as a {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker},
|
||||
+ * or {@link org.bukkit.block.BlastFurnace}.
|
||||
*/
|
||||
public class FurnaceSmeltEvent extends BlockCookEvent {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
index 1440c6115520d692faf75455df35b92aa8734491..0808e7aeffb69160913344de5b5e21d5e857f1d6 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
@@ -8,7 +8,10 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
- * Called when a Furnace starts smelting.
|
||||
+ * Called when any of the furnace-like blocks start smelting.
|
||||
+ * <p>
|
||||
+ * Furnace-like blocks are {@link org.bukkit.block.Furnace},
|
||||
+ * {@link org.bukkit.block.Smoker}, and {@link org.bukkit.block.BlastFurnace}.
|
||||
*/
|
||||
public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
|
||||
index 79797a2be7fb139d528116d34d13e51d39b96e56..0921484e921dbd200725b9298f655720618b5362 100644
|
||||
index 79797a2be7fb139d528116d34d13e51d39b96e56..fe58058f9b5d29388d48115cc81dc48ab08c58c1 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
|
||||
@@ -92,7 +92,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
|
||||
@@ -19,9 +19,10 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Because InventoryClickEvent occurs within a modification of the Inventory,
|
||||
* not all Inventory related methods are safe to use.
|
||||
* <p>
|
||||
- * The following should never be invoked by an EventHandler for
|
||||
- * InventoryClickEvent using the HumanEntity or InventoryView associated with
|
||||
- * this event:
|
||||
+ * Methods that change the view a player is looking at should never be invoked
|
||||
+ * by an EventHandler for InventoryClickEvent using the HumanEntity or
|
||||
+ * InventoryView associated with this event.
|
||||
+ * Examples of these include:
|
||||
* <ul>
|
||||
* <li>{@link HumanEntity#closeInventory()}
|
||||
* <li>{@link HumanEntity#openInventory(Inventory)}
|
||||
@@ -92,7 +93,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
|
||||
/**
|
||||
* Gets the ItemStack currently in the clicked slot.
|
||||
*
|
||||
@@ -752,6 +766,38 @@ index 79797a2be7fb139d528116d34d13e51d39b96e56..0921484e921dbd200725b9298f655720
|
||||
*/
|
||||
@Nullable
|
||||
public ItemStack getCurrentItem() {
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
index 5861247c1b8ee4fe2736fd5098e05a2ca9ab78ea..c0cc82d98348e8aae3cb56bafb2fcb590b03094f 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
@@ -7,7 +7,26 @@ import org.bukkit.inventory.InventoryView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
- * Represents a player related inventory event
|
||||
+ * This event is called when a player closes an inventory.
|
||||
+ * <p>
|
||||
+ * Because InventoryCloseEvent occurs within a modification of the Inventory,
|
||||
+ * not all Inventory related methods are safe to use.
|
||||
+ * <p>
|
||||
+ * Methods that change the view a player is looking at should never be invoked
|
||||
+ * by an EventHandler for InventoryCloseEvent using the HumanEntity or
|
||||
+ * InventoryView associated with this event.
|
||||
+ * Examples of these include:
|
||||
+ * <ul>
|
||||
+ * <li>{@link HumanEntity#closeInventory()}
|
||||
+ * <li>{@link HumanEntity#openInventory(org.bukkit.inventory.Inventory)}
|
||||
+ * <li>{@link HumanEntity#openWorkbench(org.bukkit.Location, boolean)}
|
||||
+ * <li>{@link HumanEntity#openEnchanting(org.bukkit.Location, boolean)}
|
||||
+ * <li>{@link InventoryView#close()}
|
||||
+ * </ul>
|
||||
+ * To invoke one of these methods, schedule a task using
|
||||
+ * {@link org.bukkit.scheduler.BukkitScheduler#runTask(org.bukkit.plugin.Plugin, Runnable)}, which will run the task
|
||||
+ * on the next tick. Also be aware that this is not an exhaustive list, and
|
||||
+ * other methods could potentially create issues as well.
|
||||
*/
|
||||
public class InventoryCloseEvent extends InventoryEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
index 9013d043503d175004ad276799e5935b7fa59dc4..ceae092eb782698803c6c3df41267dde20ba62b2 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
@@ -807,7 +853,7 @@ index 4c2102a11c3d682d98f0db4ccafa35231e66bcdd..ca238af544764273b9cd4cf3587e8632
|
||||
public class PlayerResourcePackStatusEvent extends PlayerEvent {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
||||
index 08d656ee57b080e07b7b7d97c9551fb0a0e3e94b..82d8fe3be9ff6914b44872462c3827123459735d 100644
|
||||
index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb61909b579cb9 100644
|
||||
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
||||
+++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java
|
||||
@@ -627,7 +627,7 @@ public abstract class ChunkGenerator {
|
||||
@@ -1078,41 +1124,45 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5
|
||||
* @return the currently held item
|
||||
* @see #getItemInMainHand()
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
index a9dbb11148e5bdf3e6c251bc98b6a8295aceba2f..e92de5ca8bd48723a493495db3ca2e2f5b55fab5 100644
|
||||
index 05f1acaac3a49c42f6cf544adb3ffec267c72700..9f9c67e935940833bbfe58e6bfa398e6c86980d5 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
@@ -29,7 +29,6 @@ public class ShapedRecipe implements Recipe, Keyed {
|
||||
@@ -24,8 +24,6 @@ public class ShapedRecipe extends CraftingRecipe {
|
||||
* @param result The item you want the recipe to create.
|
||||
* @see ShapedRecipe#shape(String...)
|
||||
* @see ShapedRecipe#setIngredient(char, ItemType)
|
||||
* @see ShapedRecipe#setIngredient(char, Material)
|
||||
- * @see ShapedRecipe#setIngredient(char, Material, int)
|
||||
- * @see ShapedRecipe#setIngredient(char, MaterialData)
|
||||
* @see ShapedRecipe#setIngredient(char, RecipeChoice)
|
||||
* @deprecated Recipes must have keys. Use {@link #ShapedRecipe(NamespacedKey, ItemStack)}
|
||||
* instead.
|
||||
@@ -50,7 +49,6 @@ public class ShapedRecipe implements Recipe, Keyed {
|
||||
@@ -44,8 +42,6 @@ public class ShapedRecipe extends CraftingRecipe {
|
||||
* @param result The item you want the recipe to create.
|
||||
* @see ShapedRecipe#shape(String...)
|
||||
* @see ShapedRecipe#setIngredient(char, ItemType)
|
||||
* @see ShapedRecipe#setIngredient(char, Material)
|
||||
- * @see ShapedRecipe#setIngredient(char, Material, int)
|
||||
- * @see ShapedRecipe#setIngredient(char, MaterialData)
|
||||
* @see ShapedRecipe#setIngredient(char, RecipeChoice)
|
||||
*/
|
||||
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
index 94393a1f0d19a58a1029f9c31193b3d9279c5ef0..69a25d05efcc96f8b3d3b5455e571259e5af2dab 100644
|
||||
index 3d50775da447175b2a94ed9056ef36aa1e69c2eb..03839302c94adc3175d0a88065cd230257ffd20d 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
@@ -37,9 +37,8 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
||||
@@ -30,11 +30,8 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
* @param key the unique recipe key
|
||||
* @param result The item you want the recipe to create.
|
||||
* @see ShapelessRecipe#addIngredient(ItemType)
|
||||
* @see ShapelessRecipe#addIngredient(Material)
|
||||
- * @see ShapelessRecipe#addIngredient(MaterialData)
|
||||
* @see ShapelessRecipe#addIngredient(int,ItemType)
|
||||
- * @see ShapelessRecipe#addIngredient(Material,int)
|
||||
* @see ShapelessRecipe#addIngredient(int,Material)
|
||||
- * @see ShapelessRecipe#addIngredient(int,MaterialData)
|
||||
- * @see ShapelessRecipe#addIngredient(int,Material,int)
|
||||
+ * @see ShapelessRecipe#addIngredient(RecipeChoice)
|
||||
*/
|
||||
public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
|
||||
Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result.");
|
||||
@@ -147,7 +146,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
||||
super(key, result);
|
||||
@@ -174,7 +171,7 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
|
||||
/**
|
||||
* Removes multiple instances of an ingredient from the list. If there are
|
||||
@@ -1121,25 +1171,11 @@ index 94393a1f0d19a58a1029f9c31193b3d9279c5ef0..69a25d05efcc96f8b3d3b5455e571259
|
||||
* matches, with a data value of 0.
|
||||
*
|
||||
* @param count The number of copies to remove.
|
||||
diff --git a/src/main/java/org/bukkit/inventory/SmithingRecipe.java b/src/main/java/org/bukkit/inventory/SmithingRecipe.java
|
||||
index af04071d37e70b8cc9837d57477c8493be8afb9f..582671a0a94d47302c0fdc572d486282c32f786f 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/SmithingRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/SmithingRecipe.java
|
||||
@@ -21,7 +21,9 @@ public class SmithingRecipe implements Recipe, Keyed {
|
||||
* @param result The item you want the recipe to create.
|
||||
* @param base The base ingredient
|
||||
* @param addition The addition ingredient
|
||||
+ * @deprecated use {@link SmithingTrimRecipe} or {@link SmithingTransformRecipe}
|
||||
*/
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
public SmithingRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result, @NotNull RecipeChoice base, @NotNull RecipeChoice addition) {
|
||||
this.key = key;
|
||||
this.result = result;
|
||||
diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
|
||||
index 8df05b404eb1bcbe1bf358b8cb34c46f25ceeba1..0de3c34c67b8c37a3c7ba8bcec4404ed4ef5019e 100644
|
||||
index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7178c1366 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
|
||||
@@ -33,7 +33,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
@@ -28,7 +28,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1148,16 +1184,16 @@ index 8df05b404eb1bcbe1bf358b8cb34c46f25ceeba1..0de3c34c67b8c37a3c7ba8bcec4404ed
|
||||
*
|
||||
* @param key The unique recipe key
|
||||
* @param result The item you want the recipe to create.
|
||||
@@ -47,7 +47,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
@@ -42,7 +42,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Sets the input of this cooking recipe.
|
||||
+ * Sets the input of this Stonecutting recipe.
|
||||
*
|
||||
* @param input The input item type.
|
||||
* @param input The input material.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
@@ -69,7 +69,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
@@ -64,7 +64,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1167,10 +1203,10 @@ index 8df05b404eb1bcbe1bf358b8cb34c46f25ceeba1..0de3c34c67b8c37a3c7ba8bcec4404ed
|
||||
* @param input The input choice.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
index 049c70c935fd7a781280d223f74bbbf87223f505..f78714c2a6d9da162c9802552984cbfad76ff728 100644
|
||||
index d7fab2b856f6dfec4f9225c1bdb4254b238d98a4..9d40e6a5ce7adc377934cfc5ce663b5d9cb2e4dc 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
@@ -305,7 +305,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -306,7 +306,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
/**
|
||||
* Return an immutable copy of all {@link Attribute}s and their
|
||||
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>
|
||||
@@ -1179,54 +1215,32 @@ index 049c70c935fd7a781280d223f74bbbf87223f505..f78714c2a6d9da162c9802552984cbfa
|
||||
* {@link EquipmentSlot} will be returned. This is because
|
||||
* AttributeModifiers without a slot are active in any slot.<br>
|
||||
* If there are no attributes set for the given slot, an empty map
|
||||
diff --git a/src/main/java/org/bukkit/loot/LootContext.java b/src/main/java/org/bukkit/loot/LootContext.java
|
||||
index 71b7aa9d675e1714e286e6fd4015ead036d912e0..b35dba42069f771db8727bf98f9d17aff9d6094e 100644
|
||||
--- a/src/main/java/org/bukkit/loot/LootContext.java
|
||||
+++ b/src/main/java/org/bukkit/loot/LootContext.java
|
||||
@@ -54,7 +54,7 @@ public final class LootContext {
|
||||
|
||||
/**
|
||||
* Represents the
|
||||
- * {@link org.bukkit.enchantments.Enchantment#LOOT_BONUS_MOBS} the
|
||||
+ * {@link org.bukkit.enchantments.Enchantment#LOOTING} the
|
||||
* {@link #getKiller()} entity has on their equipped item.
|
||||
*
|
||||
* This value is only set via
|
||||
@@ -124,7 +124,7 @@ public final class LootContext {
|
||||
}
|
||||
|
||||
/**
|
||||
- * Set the {@link org.bukkit.enchantments.Enchantment#LOOT_BONUS_MOBS}
|
||||
+ * Set the {@link org.bukkit.enchantments.Enchantment#LOOTING}
|
||||
* level equivalent to use when generating loot. Values less than or
|
||||
* equal to 0 will force the {@link LootTable} to only return a single
|
||||
* {@link org.bukkit.inventory.ItemStack} per pool.
|
||||
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
|
||||
index 86a0a6f9e8487d6dfaf60876ace3dcc9b4722826..571b43c2809d2b248feebc7decba6017a67c8aee 100644
|
||||
index 22b1dc5fd4d453161a5ee520072f8e8f955b3a80..a625bcab8e77b05b3341a52c708fae1542b7e3d5 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Objective.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Objective.java
|
||||
@@ -88,7 +88,7 @@ public interface Objective {
|
||||
@@ -86,7 +86,7 @@ public interface Objective {
|
||||
*
|
||||
* @return true if scores are modifiable
|
||||
* @throws IllegalStateException if this objective has been unregistered
|
||||
- * @see Criterias#HEALTH
|
||||
+ * @see Criteria#HEALTH
|
||||
*/
|
||||
boolean isModifiable() throws IllegalStateException;
|
||||
boolean isModifiable();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
index 4d625f79ba2e3fe074feade98f7c1bc2798cb82e..937a28638c251509ebeb254178a4583fe03c52d0 100644
|
||||
index 52e8be769d2e9b69e9833bc9a7fe39afd10c5095..4d2b8e10263802432dfeac72666487f9547cd2c5 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -277,7 +277,7 @@ public interface Team {
|
||||
@@ -265,7 +265,7 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
|
||||
* Gets the Set of entries on the team
|
||||
*
|
||||
* @return entries on the team
|
||||
- * @throws IllegalStateException if this entries has been unregistered\
|
||||
- * @throws IllegalStateException if this entries has been unregistered
|
||||
+ * @throws IllegalStateException if this team has been unregistered
|
||||
*/
|
||||
@NotNull
|
||||
Set<String> getEntries() throws IllegalStateException;
|
||||
Set<String> getEntries();
|
||||
diff --git a/src/main/java/org/bukkit/util/BoundingBox.java b/src/main/java/org/bukkit/util/BoundingBox.java
|
||||
index 9883983c33fcff0f4c1e23867adafa436e2ed96f..5017b73bcec0d4d5256d89db14201c03829dc981 100644
|
||||
--- a/src/main/java/org/bukkit/util/BoundingBox.java
|
||||
|
||||
@@ -321,10 +321,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 1704d04097c9d364e5f9049a6a0f60945db482dd..9935ca77536c8fa30881376e20cd3193f22879fb 100644
|
||||
index b21f90f291a087b6282cd7b55e0075a01729f0ba..dcd539220e5a2bda41f27101ea4c0ece146e1d0d 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2205,6 +2205,83 @@ public final class Bukkit {
|
||||
@@ -2228,6 +2228,83 @@ public final class Bukkit {
|
||||
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
|
||||
return server.suggestPlayerNamesWhenNullTabCompletions();
|
||||
}
|
||||
@@ -409,10 +409,10 @@ index 1704d04097c9d364e5f9049a6a0f60945db482dd..9935ca77536c8fa30881376e20cd3193
|
||||
|
||||
@NotNull
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index dca2cbe8c93469c8c1c404bc34748a9dcf6d3368..136ae88a23ac02f79960d4ee99041486b41806f5 100644
|
||||
index 3c1862b9a9293155f756615b5bd23cc810a6df5e..016cee903c7179baf711984503d1d0793d40c5c5 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1936,5 +1936,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -1955,5 +1955,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
* @return true if player names should be suggested
|
||||
*/
|
||||
boolean suggestPlayerNamesWhenNullTabCompletions();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 411dbbd8046a3157747713fea9ae19eca113e9b7..7f12a18a77838266c0394da078a958c6bfb0e776 100644
|
||||
index 3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f..abdca9fe5acc90f167219eb769ece66c35682bb1 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -336,6 +336,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
@@ -339,6 +339,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*/
|
||||
public int getExpToLevel();
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner()
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 70a32f89c16439c575d8928332cfed64d1d6ab7e..b1dc148301012ba708333d620c8bdf0062140c8b 100644
|
||||
index 63137429779d06fafb162f1bfb823d5149b3c58a..4319dbac54b4cce95ad7479d5bd141a2b12ab7ae 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -735,5 +735,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -749,5 +749,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@Nullable
|
||||
Location getOrigin();
|
||||
|
||||
@@ -8,17 +8,18 @@ Currently the server only supports the English language. To override this,
|
||||
You must replace the language file embedded in the server jar.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index d0530328536840ce126b39942fac35a476ea2ac4..193e36ca6ea3b6528e53ebd07bbd8775b12993af 100644
|
||||
index 30770d03044da684aa8c79ca74796050c319f6be..f0025ba978f4bdf1e6bab7d30466fc950bb2a13b 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -177,5 +177,19 @@ public interface ItemFactory {
|
||||
*/
|
||||
@@ -192,4 +192,20 @@ public interface ItemFactory {
|
||||
@NotNull
|
||||
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
|
||||
// Paper end - Adventure
|
||||
+
|
||||
+ // Paper start - add getI18NDisplayName
|
||||
+ /**
|
||||
+ * Gets the Display name as seen in the Client.
|
||||
+ * Currently the server only supports the English language. To override this,
|
||||
+ * Currently, the server only supports the English language. To override this,
|
||||
+ * You must replace the language file embedded in the server jar.
|
||||
+ *
|
||||
+ * @param item Item to return Display name of
|
||||
@@ -29,13 +30,13 @@ index d0530328536840ce126b39942fac35a476ea2ac4..193e36ca6ea3b6528e53ebd07bbd8775
|
||||
+ @Nullable
|
||||
+ @Deprecated
|
||||
+ String getI18NDisplayName(@Nullable ItemStack item);
|
||||
// Paper end
|
||||
+ // Paper end - add getI18NDisplayName
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 7e6c2bcf42d271184a75c91ecded5824535b3455..b8dfe0d1cebb944dfffc97ac74fdecda2f4884a2 100644
|
||||
index 9d327f0832c40d4a8d212346284274f6cf78834f..09a36df6edce2a283df80c67d5ef62da7ff73555 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -668,5 +668,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -618,5 +618,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public net.kyori.adventure.text.@NotNull Component displayName() {
|
||||
return Bukkit.getServer().getItemFactory().displayName(this);
|
||||
}
|
||||
|
||||
@@ -7,32 +7,33 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
|
||||
to ensure it meets latest minecraft expectations.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index 193e36ca6ea3b6528e53ebd07bbd8775b12993af..c8e1377f804c50d41ad29c6c67dea58526d28125 100644
|
||||
index f0025ba978f4bdf1e6bab7d30466fc950bb2a13b..d641a8293f3acd465d5fdde8507046647cb6c568 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -191,5 +191,17 @@ public interface ItemFactory {
|
||||
@Nullable
|
||||
@@ -208,4 +208,18 @@ public interface ItemFactory {
|
||||
@Deprecated
|
||||
String getI18NDisplayName(@Nullable ItemStack item);
|
||||
// Paper end - add getI18NDisplayName
|
||||
+
|
||||
+ // Paper start - ensure server conversions API
|
||||
+ /**
|
||||
+ * Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks.
|
||||
+ * Minecraft's updates are converting simple item stacks into more complex NBT oriented Item Stacks.
|
||||
+ *
|
||||
+ * Use this method to ensure any desired data conversions are processed.
|
||||
+ * The input itemstack will not be the same as the returned itemstack.
|
||||
+ *
|
||||
+ * @param item The item to process conversions on
|
||||
+ * @return A potentially Data Converted ItemStack
|
||||
+ * @return A potentially Data-Converted-ItemStack
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ ItemStack ensureServerConversions(@NotNull ItemStack item);
|
||||
// Paper end
|
||||
+ // Paper end - ensure server conversions API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index b8dfe0d1cebb944dfffc97ac74fdecda2f4884a2..923f160407a2d4be71ef42a387cb803712404c43 100644
|
||||
index 09a36df6edce2a283df80c67d5ef62da7ff73555..a8faa4c1881bae4d47d901388a78b991d138b518 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -587,7 +587,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -537,7 +537,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ index b8dfe0d1cebb944dfffc97ac74fdecda2f4884a2..923f160407a2d4be71ef42a387cb8037
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -669,6 +669,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -619,6 +619,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return Bukkit.getServer().getItemFactory().displayName(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity#setKiller
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 9977bb3cb5a66c84db816f8e4597db1c053f77c8..ccd8f36c8450bab9f609bb220b5270394960580e 100644
|
||||
index 390bb294d09389877937ee2c6c3f346e65dfb178..6a9df4ec0eee205bcd37de9c4d04a6c67eb21644 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -295,6 +295,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -319,6 +319,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@Nullable
|
||||
public Player getKiller();
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ it without having to shade it in the plugin and going through
|
||||
several layers of logging abstraction.
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 98a7dfdcbcbb44e8f1d376cb213183592d03ea65..fb47a794893d5fef026a35a7c573becf74420aa0 100644
|
||||
index 145f6209a984e74da2d2de03cf725c06c77ef8da..639651972fddce4dff63a0f0a7e566a15b9e2dd6 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,6 +9,8 @@ java {
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ java {
|
||||
val annotationsVersion = "24.0.1"
|
||||
val bungeeCordChatVersion = "1.20-R0.1"
|
||||
val adventureVersion = "4.14.0"
|
||||
+val slf4jVersion = "1.8.0-beta4"
|
||||
+val log4jVersion = "2.17.1"
|
||||
@@ -35,17 +35,15 @@ index 98a7dfdcbcbb44e8f1d376cb213183592d03ea65..fb47a794893d5fef026a35a7c573becf
|
||||
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4")
|
||||
@@ -112,7 +116,9 @@ tasks.withType<Javadoc> {
|
||||
"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
|
||||
@@ -117,6 +121,8 @@ tasks.withType<Javadoc> {
|
||||
"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
|
||||
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
||||
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/"
|
||||
+ "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
||||
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
|
||||
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
|
||||
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/"
|
||||
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
|
||||
// Paper end
|
||||
"https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
|
||||
)
|
||||
options.tags("apiNote:a:API Note:")
|
||||
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
|
||||
index 8c76716249e44ed8bf6be94c1f5c7b6d9bb35be2..4eb639fbb46a0848be207149ea433455550fae1c 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/Plugin.java
|
||||
|
||||
@@ -93,19 +93,18 @@ index 7cd9f98c042dc2bb80876af35c755f81bef34651..5cd236965de12392d8c7aa81307c0ff1
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
index 302319acbc257a075adfb78d9f5c49fdadf45bdc..a8ac1fb22a6fba50d69bf726b49c49ba190ab79a 100644
|
||||
index 74b6581a97a092c44a0876e7981ff8a8e6153100..d6d3e1332e51adc5611543b2a6689efa5921a9f2 100644
|
||||
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
||||
@@ -65,7 +65,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -67,6 +67,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
this.url = file.toURI().toURL();
|
||||
this.libraryLoader = libraryLoader;
|
||||
|
||||
-
|
||||
+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early
|
||||
// Paper start
|
||||
this.dependencyContext = dependencyContext;
|
||||
this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
|
||||
@@ -249,7 +249,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
@@ -262,7 +263,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
|
||||
pluginState = new IllegalStateException("Initial initialization");
|
||||
this.pluginInit = javaPlugin;
|
||||
|
||||
|
||||
@@ -6,13 +6,12 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9a7578ddd
|
||||
index 0000000000000000000000000000000000000000..57521010ff0574f1bbc96727948a6185fd37e9ee
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
|
||||
@@ -0,0 +1,189 @@
|
||||
@@ -0,0 +1,139 @@
|
||||
+package com.destroystokyo.paper.event.player;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
@@ -23,12 +22,11 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+import java.util.Collections;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+import org.bukkit.inventory.ItemType;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.jetbrains.annotations.Unmodifiable;
|
||||
+
|
||||
+import static org.bukkit.inventory.ItemType.*;
|
||||
+import static org.bukkit.Material.*;
|
||||
+
|
||||
+/**
|
||||
+ * Called when the player themselves change their armor items
|
||||
@@ -39,10 +37,11 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ private static final HandlerList HANDLERS = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final SlotType slotType;
|
||||
+ @Nullable private final ItemStack oldItem;
|
||||
+ @Nullable private final ItemStack newItem;
|
||||
+ @NotNull private final ItemStack oldItem;
|
||||
+ @NotNull private final ItemStack newItem;
|
||||
+
|
||||
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @Nullable ItemStack oldItem, @Nullable ItemStack newItem) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @NotNull ItemStack oldItem, @NotNull ItemStack newItem) {
|
||||
+ super(player);
|
||||
+ this.slotType = slotType;
|
||||
+ this.oldItem = oldItem;
|
||||
@@ -64,7 +63,7 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ *
|
||||
+ * @return old item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ @NotNull
|
||||
+ public ItemStack getOldItem() {
|
||||
+ return this.oldItem;
|
||||
+ }
|
||||
@@ -74,7 +73,7 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ *
|
||||
+ * @return new item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ @NotNull
|
||||
+ public ItemStack getNewItem() {
|
||||
+ return this.newItem;
|
||||
+ }
|
||||
@@ -96,17 +95,15 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ }
|
||||
+
|
||||
+ public enum SlotType {
|
||||
+ HEAD(NETHERITE_HELMET, DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, CARVED_PUMPKIN, PLAYER_HEAD, SKELETON_SKULL, ZOMBIE_HEAD, CREEPER_HEAD, WITHER_SKELETON_SKULL, TURTLE_HELMET),
|
||||
+ HEAD(NETHERITE_HELMET, DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, CARVED_PUMPKIN, PLAYER_HEAD, SKELETON_SKULL, ZOMBIE_HEAD, CREEPER_HEAD, WITHER_SKELETON_SKULL, TURTLE_HELMET, DRAGON_HEAD, PIGLIN_HEAD),
|
||||
+ CHEST(NETHERITE_CHESTPLATE, DIAMOND_CHESTPLATE, GOLDEN_CHESTPLATE, IRON_CHESTPLATE, CHAINMAIL_CHESTPLATE, LEATHER_CHESTPLATE, ELYTRA),
|
||||
+ LEGS(NETHERITE_LEGGINGS, DIAMOND_LEGGINGS, GOLDEN_LEGGINGS, IRON_LEGGINGS, CHAINMAIL_LEGGINGS, LEATHER_LEGGINGS),
|
||||
+ FEET(NETHERITE_BOOTS, DIAMOND_BOOTS, GOLDEN_BOOTS, IRON_BOOTS, CHAINMAIL_BOOTS, LEATHER_BOOTS);
|
||||
+
|
||||
+ private final Set<ItemType> mutableTypes = new HashSet<>();
|
||||
+ private Set<ItemType> immutableTypes;
|
||||
+ @Deprecated
|
||||
+ private Set<Material> legacyTypes;
|
||||
+ private final Set<Material> mutableTypes = new HashSet<>();
|
||||
+ private Set<Material> immutableTypes;
|
||||
+
|
||||
+ SlotType(ItemType... types) {
|
||||
+ SlotType(Material... types) {
|
||||
+ this.mutableTypes.addAll(Arrays.asList(types));
|
||||
+ }
|
||||
+
|
||||
@@ -115,32 +112,14 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ * armor slot.
|
||||
+ *
|
||||
+ * @return immutable set of material types
|
||||
+ * @deprecated use {@link #getItemTypes()}
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public @NotNull @Unmodifiable Set<Material> getTypes() {
|
||||
+ if (this.legacyTypes == null) {
|
||||
+ this.legacyTypes = new HashSet<>();
|
||||
+ for (final ItemType itemType : this.getItemTypes()) {
|
||||
+ this.legacyTypes.add(Bukkit.getUnsafe().toMaterial(itemType));
|
||||
+ }
|
||||
+ }
|
||||
+ return Collections.unmodifiableSet(this.legacyTypes);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets an immutable set of all allowed item types that can be placed in an
|
||||
+ * armor slot.
|
||||
+ *
|
||||
+ * @return immutable set of item types
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public @Unmodifiable Set<ItemType> getItemTypes() {
|
||||
+ if (this.immutableTypes == null) {
|
||||
+ this.immutableTypes = Collections.unmodifiableSet(this.mutableTypes);
|
||||
+ public Set<Material> getTypes() {
|
||||
+ if (immutableTypes == null) {
|
||||
+ immutableTypes = Collections.unmodifiableSet(mutableTypes);
|
||||
+ }
|
||||
+
|
||||
+ return this.immutableTypes;
|
||||
+ return immutableTypes;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -148,10 +127,8 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ *
|
||||
+ * @param material material to get slot by
|
||||
+ * @return slot type the material will go in, or null if it won't
|
||||
+ * @deprecated use {@link #getByItemType(ItemType)}
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ @Deprecated
|
||||
+ public static SlotType getByMaterial(@NotNull Material material) {
|
||||
+ for (SlotType slotType : values()) {
|
||||
+ if (slotType.getTypes().contains(material)) {
|
||||
@@ -162,40 +139,13 @@ index 0000000000000000000000000000000000000000..b1985f57d0e52df49304964797dfbbe9
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the type of slot via the specified item type
|
||||
+ *
|
||||
+ * @param itemType item type to get slot by
|
||||
+ * @return slot type the item type will go in, or null if it won't
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public static SlotType getByItemType(@NotNull ItemType itemType) {
|
||||
+ for (SlotType slotType : values()) {
|
||||
+ if (slotType.getItemTypes().contains(itemType)) {
|
||||
+ return slotType;
|
||||
+ }
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets whether this material can be equipped to a slot
|
||||
+ *
|
||||
+ * @param material material to check
|
||||
+ * @return whether this material can be equipped
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public static boolean isEquipable(@NotNull Material material) {
|
||||
+ return getByMaterial(material) != null;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets whether this item type can be equipped to a slot
|
||||
+ *
|
||||
+ * @param itemType item type to check
|
||||
+ * @return whether this item type can be equipped
|
||||
+ */
|
||||
+ public static boolean isEquipable(@NotNull ItemType itemType) {
|
||||
+ return getByItemType(itemType) != null;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
@@ -9,10 +9,10 @@ on the real tile entity.
|
||||
This is useful for where performance is needed
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index d834e8d8d532ce5b46201ff5c02d54a6c047f615..b33c1a227669d01950ceb4162a2910ae05a85a0e 100644
|
||||
index 870ad6cd930653e6248abcc0fce94ffafbe9ebde..9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -271,6 +271,16 @@ public interface Block extends Metadatable, Translatable {
|
||||
@@ -272,6 +272,16 @@ public interface Block extends Metadatable, Translatable {
|
||||
@NotNull
|
||||
BlockState getState();
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9
|
||||
|
||||
@Override
|
||||
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
index c26ea217927ba77611e6ae93f8df50a83bceb3dd..06e96e5c98f1a7a68c8b4b5e527314c1aa774e38 100644
|
||||
index abadff47166722fdc756afdbc6ac7242b6bd4fb0..88f1ca89fa640a686231b8eec87e70419b2d73ef 100644
|
||||
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
||||
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
||||
@@ -48,6 +48,8 @@ public class AnnotationTest {
|
||||
|
||||
@@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..7b2af1bd72dfbcf4e962a982940fc49b
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 26236250f4418def6f65c811800063588b43fa84..bd6881d18d18d03f7e9b7821fa6cc433a79dc17e 100644
|
||||
index 264c6bdeb2f1f0d937e4356d761a3264a1c4d58a..f9239eae50b86f54f0cd8c604d2ba9468fc5f33b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -43,7 +43,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -51,7 +51,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
*/
|
||||
|
||||
@@ -10,26 +10,26 @@ on the players login.
|
||||
Plugin authors need to define a key to keep it consistent between server restarts.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
index e92de5ca8bd48723a493495db3ca2e2f5b55fab5..06b7f273ae66b2c936523c95fd4f802bd39ae324 100644
|
||||
index 9f9c67e935940833bbfe58e6bfa398e6c86980d5..71e494177473c62449aafda1699b26a0c4c81a68 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
|
||||
@@ -37,6 +37,7 @@ public class ShapedRecipe implements Recipe, Keyed {
|
||||
@@ -31,6 +31,7 @@ public class ShapedRecipe extends CraftingRecipe {
|
||||
@Deprecated
|
||||
public ShapedRecipe(@NotNull ItemStack result) {
|
||||
Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result.");
|
||||
this.key = NamespacedKey.randomKey();
|
||||
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace();
|
||||
this.output = new ItemStack(result);
|
||||
super(NamespacedKey.randomKey(), result);
|
||||
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
index 69a25d05efcc96f8b3d3b5455e571259e5af2dab..ebc2c713d8a4ceec86b7dd270c5ca18c78103bcc 100644
|
||||
index 03839302c94adc3175d0a88065cd230257ffd20d..d6e38c7ccfe3b6e85eafb611da20b1a29fb74d97 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
|
||||
@@ -26,6 +26,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
|
||||
@@ -20,6 +20,7 @@ public class ShapelessRecipe extends CraftingRecipe {
|
||||
@Deprecated
|
||||
public ShapelessRecipe(@NotNull ItemStack result) {
|
||||
Preconditions.checkArgument(result.getType() != ItemType.AIR, "Recipe must have non-AIR result.");
|
||||
this.key = NamespacedKey.randomKey();
|
||||
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace();
|
||||
this.output = new ItemStack(result);
|
||||
super(NamespacedKey.randomKey(), result);
|
||||
+ new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -10,10 +10,10 @@ of giving the player experience points.
|
||||
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 0700a76cdccab9a6dbbcbfd50aa6a5f192f15e75..2400d82ea71f22ddb6c671bf74c6480c35910598 100644
|
||||
index f9239eae50b86f54f0cd8c604d2ba9468fc5f33b..9dca8fc727b727063d9ca50fdd8f6452173a5cd4 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1230,6 +1230,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1368,6 +1368,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
public void resetPlayerWeather();
|
||||
|
||||
@@ -29,7 +29,7 @@ index 0700a76cdccab9a6dbbcbfd50aa6a5f192f15e75..2400d82ea71f22ddb6c671bf74c6480c
|
||||
/**
|
||||
* Gets the player's cooldown between picking up experience orbs.
|
||||
*
|
||||
@@ -1255,8 +1264,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1393,8 +1402,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* Gives the player the amount of experience specified.
|
||||
*
|
||||
* @param amount Exp amount to give
|
||||
|
||||
@@ -16,7 +16,7 @@ See: https://github.com/PaperMC/Paper/issues/917
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..24b325625c76d0bc4cdb2f4063d6666aa3deac17
|
||||
index 0000000000000000000000000000000000000000..8b48759bf6f4fcef0847d9a2461993e3f2fdc9aa
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java
|
||||
@@ -0,0 +1,105 @@
|
||||
@@ -43,11 +43,11 @@ index 0000000000000000000000000000000000000000..24b325625c76d0bc4cdb2f4063d6666a
|
||||
+ */
|
||||
+public class PreCreatureSpawnEvent extends Event implements Cancellable {
|
||||
+ @NotNull private final Location location;
|
||||
+ @NotNull private final EntityType<?> type;
|
||||
+ @NotNull private final EntityType type;
|
||||
+ @NotNull private final CreatureSpawnEvent.SpawnReason reason;
|
||||
+ private boolean shouldAbortSpawn;
|
||||
+
|
||||
+ public PreCreatureSpawnEvent(@NotNull Location location, @NotNull EntityType<?> type, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ public PreCreatureSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ this.location = Preconditions.checkNotNull(location, "Location may not be null");
|
||||
+ this.type = Preconditions.checkNotNull(type, "Type may not be null");
|
||||
+ this.reason = Preconditions.checkNotNull(reason, "Reason may not be null");
|
||||
@@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..24b325625c76d0bc4cdb2f4063d6666a
|
||||
+ * @return The type of creature being spawned
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public EntityType<?> getType() {
|
||||
+ public EntityType getType() {
|
||||
+ return type;
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -7,10 +7,10 @@ This allows you to create already filled textures on Skulls to avoid texture loo
|
||||
which commonly cause rate limit issues with Mojang API
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java
|
||||
index c7580fa8e62c6ee35abb0cec2586a39bbae4e8a7..0070b8e4a86f85ee31e071513808c36dbad04845 100644
|
||||
index b39128bb0ca2d4fe7a254193236c60fb5bfaa7da..5135b8e6028e6926e2711e2dd6ce68b76f468fd7 100644
|
||||
--- a/src/main/java/org/bukkit/block/Skull.java
|
||||
+++ b/src/main/java/org/bukkit/block/Skull.java
|
||||
@@ -62,6 +62,20 @@ public interface Skull extends TileState {
|
||||
@@ -63,6 +63,20 @@ public interface Skull extends TileState {
|
||||
*/
|
||||
public void setOwningPlayer(@NotNull OfflinePlayer player);
|
||||
|
||||
@@ -31,7 +31,7 @@ index c7580fa8e62c6ee35abb0cec2586a39bbae4e8a7..0070b8e4a86f85ee31e071513808c36d
|
||||
/**
|
||||
* Gets the profile of the player who owns the skull. This player profile
|
||||
* may appear as the texture depending on skull type.
|
||||
@@ -69,6 +83,7 @@ public interface Skull extends TileState {
|
||||
@@ -70,6 +84,7 @@ public interface Skull extends TileState {
|
||||
* @return the profile of the owning player
|
||||
*/
|
||||
@Nullable
|
||||
@@ -39,7 +39,7 @@ index c7580fa8e62c6ee35abb0cec2586a39bbae4e8a7..0070b8e4a86f85ee31e071513808c36d
|
||||
PlayerProfile getOwnerProfile();
|
||||
|
||||
/**
|
||||
@@ -83,6 +98,7 @@ public interface Skull extends TileState {
|
||||
@@ -84,6 +99,7 @@ public interface Skull extends TileState {
|
||||
* @throws IllegalArgumentException if the profile does not contain the
|
||||
* necessary information
|
||||
*/
|
||||
|
||||
@@ -3,37 +3,17 @@ From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 18 Jan 2018 01:00:27 -0500
|
||||
Subject: [PATCH] Optimize Hoppers
|
||||
|
||||
Adds data about what Item related methods were used in InventoryMoveItem event
|
||||
so that the server can improve the performance of this event.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java
|
||||
index 919cc993e3cb1c14e2a3aebf90e6cc0fa6fbc17f..95e51bcf5dfd27cc9012d7542c4ed1bceca29626 100644
|
||||
index 919cc993e3cb1c14e2a3aebf90e6cc0fa6fbc17f..0161b8a94c7e8774fec3ed9c36d9c37221525928 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java
|
||||
@@ -31,6 +31,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
|
||||
private final Inventory destinationInventory;
|
||||
private ItemStack itemStack;
|
||||
private final boolean didSourceInitiate;
|
||||
+ public boolean calledGetItem; // Paper
|
||||
+ public boolean calledSetItem; // Paper
|
||||
|
||||
public InventoryMoveItemEvent(@NotNull final Inventory sourceInventory, @NotNull final ItemStack itemStack, @NotNull final Inventory destinationInventory, final boolean didSourceInitiate) {
|
||||
Preconditions.checkArgument(itemStack != null, "ItemStack cannot be null");
|
||||
@@ -58,7 +60,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
|
||||
@@ -58,7 +58,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
|
||||
*/
|
||||
@NotNull
|
||||
public ItemStack getItem() {
|
||||
- return itemStack.clone();
|
||||
+ calledGetItem = true; // Paper - record this method was used for auto detection of mode
|
||||
+ return itemStack; // Paper - Removed clone, handled better in Server
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +73,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
|
||||
*/
|
||||
public void setItem(@NotNull ItemStack itemStack) {
|
||||
Preconditions.checkArgument(itemStack != null, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred.");
|
||||
+ calledSetItem = true; // Paper - record this method was used for auto detection of mode
|
||||
this.itemStack = itemStack.clone();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API
|
||||
This can be useful for changing name or skins after a player has logged in.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 9935ca77536c8fa30881376e20cd3193f22879fb..c1cf9328f32d6b4ecbba667a8dda3a60b37aca82 100644
|
||||
index dcd539220e5a2bda41f27101ea4c0ece146e1d0d..f5358612884aae8d0686f3ff98ccee567a746f16 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1230,8 +1230,10 @@ public final class Bukkit {
|
||||
@@ -43,10 +43,10 @@ index 9935ca77536c8fa30881376e20cd3193f22879fb..c1cf9328f32d6b4ecbba667a8dda3a60
|
||||
return server.createPlayerProfile(name);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index 6aa01b6f25e88ea7908edd1db836e62adb1b8da6..ab0c6c479d41e00e31d850d5e35d78484423d5c9 100644
|
||||
index bec480aff819e09220b52175cab0cb6d68ae68c6..12349910297a75c00e64f6ccc7981aeeeb43ecd3 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -57,7 +57,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -59,7 +59,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
* @return the player's profile
|
||||
*/
|
||||
@NotNull
|
||||
@@ -54,9 +54,9 @@ index 6aa01b6f25e88ea7908edd1db836e62adb1b8da6..ab0c6c479d41e00e31d850d5e35d7848
|
||||
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile(); // Paper
|
||||
|
||||
/**
|
||||
* Checks if this player is banned or not
|
||||
* Checks if this player has had their profile banned.
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 136ae88a23ac02f79960d4ee99041486b41806f5..572a5aa724f58dc9795bf83b4151412e26f2a14d 100644
|
||||
index 016cee903c7179baf711984503d1d0793d40c5c5..064edd612885b2ea4b35001a864503b568c53987 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1050,8 +1050,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -93,10 +93,10 @@ index 136ae88a23ac02f79960d4ee99041486b41806f5..572a5aa724f58dc9795bf83b4151412e
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 2400d82ea71f22ddb6c671bf74c6480c35910598..3c2b4ecce2c4ae3ab5a394857988d24776b9ca90 100644
|
||||
index 9dca8fc727b727063d9ca50fdd8f6452173a5cd4..ccd80734cf5641455fd9d9b63238739987e225da 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2519,6 +2519,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2678,6 +2678,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
|
||||
*/
|
||||
boolean hasResourcePack();
|
||||
@@ -110,7 +110,11 @@ index 2400d82ea71f22ddb6c671bf74c6480c35910598..3c2b4ecce2c4ae3ab5a394857988d247
|
||||
+
|
||||
+ /**
|
||||
+ * Changes the PlayerProfile for this player. This will cause this player
|
||||
+ * to be reregistered to all clients that can currently see this player
|
||||
+ * to be reregistered to all clients that can currently see this player.
|
||||
+ *
|
||||
+ * After executing this method, the player {@link java.util.UUID} won't
|
||||
+ * be swapped, only their name and gameprofile properties.
|
||||
+ *
|
||||
+ * @param profile The new profile to use
|
||||
+ */
|
||||
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
|
||||
|
||||
@@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID
|
||||
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index c1cf9328f32d6b4ecbba667a8dda3a60b37aca82..48f3a48268f714eeba3cfcd8e665265fc144f39e 100644
|
||||
index f5358612884aae8d0686f3ff98ccee567a746f16..a6f9336f27cb4a7aed0c01cde417d2287e393929 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -688,6 +688,20 @@ public final class Bukkit {
|
||||
@@ -34,7 +34,7 @@ index c1cf9328f32d6b4ecbba667a8dda3a60b37aca82..48f3a48268f714eeba3cfcd8e665265f
|
||||
* Gets the plugin manager for interfacing with plugins.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 572a5aa724f58dc9795bf83b4151412e26f2a14d..cb3415c9b103f60ce0d7942fb1ad4c8cd39d02d4 100644
|
||||
index 064edd612885b2ea4b35001a864503b568c53987..dfbccef8dd67195d588112989a9ffecb712a9fe9 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -592,6 +592,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 7f12a18a77838266c0394da078a958c6bfb0e776..553cd804126a556f7fdf9f4bcb8640eb33e829d6 100644
|
||||
index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f463c2234 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -497,6 +497,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
@@ -500,6 +500,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*/
|
||||
@Deprecated
|
||||
public void setShoulderEntityRight(@Nullable Entity entity);
|
||||
@@ -36,10 +36,10 @@ index 7f12a18a77838266c0394da078a958c6bfb0e776..553cd804126a556f7fdf9f4bcb8640eb
|
||||
/**
|
||||
* Make the entity drop the item in their hand.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 3c2b4ecce2c4ae3ab5a394857988d24776b9ca90..a2aa3c1e98a4909d3abfa9704da8c3b77918e05a 100644
|
||||
index ccd80734cf5641455fd9d9b63238739987e225da..bca4794a67c369b0bb882e56f489ed952488b2c5 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2364,10 +2364,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2523,10 +2523,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
/**
|
||||
* Open a Sign for editing by the Player.
|
||||
*
|
||||
|
||||
@@ -8,10 +8,10 @@ Allows a more logical API for banning players.
|
||||
player.banPlayer("Breaking the rules");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index ab0c6c479d41e00e31d850d5e35d78484423d5c9..af2973b1f6d4ac73b2ddee33c6a0869b5ec06b54 100644
|
||||
index 12349910297a75c00e64f6ccc7981aeeeb43ecd3..8f2f3e0ac5266f571b62a754921422bb07d61984 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -65,6 +65,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -67,6 +67,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
* @return true if banned, otherwise false
|
||||
*/
|
||||
public boolean isBanned();
|
||||
@@ -72,12 +72,12 @@ index ab0c6c479d41e00e31d850d5e35d78484423d5c9..af2973b1f6d4ac73b2ddee33c6a0869b
|
||||
+ // Paper end
|
||||
|
||||
/**
|
||||
* Checks if this player is whitelisted or not
|
||||
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index a2aa3c1e98a4909d3abfa9704da8c3b77918e05a..de5ac3b6f9cf001e3c3500f23930a6f9876210de 100644
|
||||
index bca4794a67c369b0bb882e56f489ed952488b2c5..a851ec4d350ce442eb01385d21ca75e695cf09d2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -904,6 +904,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1042,6 +1042,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
// Paper start
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
|
||||
Provides more methods to get nearby entities, and filter by types and predicates
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 7f23527168a33b92d823f76765edfe00abe0e4f6..0f76496471c50d5f18cedc735e667265e6c27422 100644
|
||||
index 609e4908ed21f69b9e813500e702bbe784bff00c..7a6caf93606203198369030a295f1edbffde3c31 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1,6 +1,9 @@
|
||||
@@ -19,7 +19,7 @@ index 7f23527168a33b92d823f76765edfe00abe0e4f6..0f76496471c50d5f18cedc735e667265
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -624,6 +627,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -625,6 +628,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ This adds a new Builder API which is much friendlier to use.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..f710167633a8ef1abc4aac2a1912514a959d414c
|
||||
index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f05eb5dc6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
|
||||
@@ -0,0 +1,485 @@
|
||||
@@ -470,20 +470,20 @@ index 0000000000000000000000000000000000000000..f710167633a8ef1abc4aac2a1912514a
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ParticleBuilder color(@Nullable Color color, float size) {
|
||||
+ if (this.particle != Particle.DUST && color != null) {
|
||||
+ if (particle != Particle.REDSTONE && color != null) {
|
||||
+ throw new IllegalStateException("Color may only be set on REDSTONE");
|
||||
+ }
|
||||
+
|
||||
+ // We don't officially support reusing these objects, but here we go
|
||||
+ if (color == null) {
|
||||
+ if (this.data instanceof Particle.DustOptions) {
|
||||
+ if (data instanceof Particle.DustOptions) {
|
||||
+ return data(null);
|
||||
+ } else {
|
||||
+ return this;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return this.data(new Particle.DustOptions(color, size));
|
||||
+ return data(new Particle.DustOptions(color, size));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -500,12 +500,12 @@ index 0000000000000000000000000000000000000000..f710167633a8ef1abc4aac2a1912514a
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
|
||||
index 0f97cf9fd3aebbcda1531f2cfbb9e2e17ba14acf..31c2706e0f038c180821e7c4e543f1177789ce3d 100644
|
||||
index e2adb9901cc92ede9d44ca9939c6a54d4762eb4b..81bd12c8addcee754c71e5e030c729c7e096fb4c 100644
|
||||
--- a/src/main/java/org/bukkit/Particle.java
|
||||
+++ b/src/main/java/org/bukkit/Particle.java
|
||||
@@ -140,6 +140,17 @@ public abstract class Particle<D> extends OldEnum<Particle<D>> implements Keyed
|
||||
@NotNull
|
||||
public abstract Class<D> getDataType();
|
||||
@@ -194,6 +194,18 @@ public enum Particle implements Keyed {
|
||||
return key;
|
||||
}
|
||||
|
||||
+ // Paper start - Particle API expansion
|
||||
+ /**
|
||||
@@ -518,23 +518,20 @@ index 0f97cf9fd3aebbcda1531f2cfbb9e2e17ba14acf..31c2706e0f038c180821e7c4e543f117
|
||||
+ return new com.destroystokyo.paper.ParticleBuilder(this);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Options which can be applied to redstone dust particles - a particle
|
||||
* color and size.
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 48e3e92820f59753df30e5d61f57fb71e2894aa6..61f5fd47381d21b268f58af2106fc8be5e2f1c73 100644
|
||||
index 7a6caf93606203198369030a295f1edbffde3c31..3e7385d21380abcd40649045e4666cf4bed32195 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -2756,7 +2756,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -2777,7 +2777,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
- public <T> void spawnParticle(@NotNull Particle<T> particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
|
||||
+ // Paper start - Expand Particle API
|
||||
+ default <T> void spawnParticle(@NotNull Particle<T> particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) {
|
||||
+ this.spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true);
|
||||
+ }
|
||||
+
|
||||
- public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
|
||||
+ public default <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API
|
||||
+ /**
|
||||
+ * Spawns the particle (the number of times specified by count)
|
||||
+ * at the target location. The position of each particle will be
|
||||
@@ -557,9 +554,7 @@ index 48e3e92820f59753df30e5d61f57fb71e2894aa6..61f5fd47381d21b268f58af2106fc8be
|
||||
+ * the type of this depends on {@link Particle#getDataType()}
|
||||
+ * @param <T> Type
|
||||
+ */
|
||||
+ default <T> void spawnParticle(@NotNull Particle<T> particle, @Nullable List<Player> receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) {
|
||||
+ this.spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true);
|
||||
+ }
|
||||
+ public default <T> void spawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }
|
||||
+ /**
|
||||
+ * Spawns the particle (the number of times specified by count)
|
||||
+ * at the target location. The position of each particle will be
|
||||
@@ -584,8 +579,9 @@ index 48e3e92820f59753df30e5d61f57fb71e2894aa6..61f5fd47381d21b268f58af2106fc8be
|
||||
+ * @param force allows the particle to be seen further away from the player
|
||||
+ * and shows to players using any vanilla client particle settings
|
||||
+ */
|
||||
+ <T> void spawnParticle(@NotNull Particle<T> particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);
|
||||
+ public <T> void spawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] PotionEffect clone methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
index 66dfed07bfb44e99a94fb02dc056e8601115994a..ccdca0d75868135dc7b96daeff2236b225c4add1 100644
|
||||
index 88f720aba13961b08e54b3fd35dbaabc5dd9a4c2..037af5fd6d71a526c0e6620f2db0cd6df9625261 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
|
||||
@@ -106,6 +106,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
@@ -107,6 +107,33 @@ public class PotionEffect implements ConfigurationSerializable {
|
||||
this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)));
|
||||
}
|
||||
|
||||
@@ -41,4 +41,4 @@ index 66dfed07bfb44e99a94fb02dc056e8601115994a..ccdca0d75868135dc7b96daeff2236b2
|
||||
+
|
||||
@NotNull
|
||||
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
|
||||
int type = getInt(map, TYPE);
|
||||
PotionEffectType effect;
|
||||
@@ -7,18 +7,18 @@ Control what potion the witch readies to use
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..af74dcd5dccd26661787219eb8873c5be2f981a7
|
||||
index 0000000000000000000000000000000000000000..57f93af14acc6346c5a343e05fe8f5d44d6adbc6
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
|
||||
@@ -0,0 +1,80 @@
|
||||
+package com.destroystokyo.paper.event.entity;
|
||||
+
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.entity.Witch;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.bukkit.inventory.ItemType;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
@@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..af74dcd5dccd26661787219eb8873c5b
|
||||
+ public static ItemStack process(@NotNull Witch witch, @Nullable ItemStack potion) {
|
||||
+ WitchReadyPotionEvent event = new WitchReadyPotionEvent(witch, potion);
|
||||
+ if (!event.callEvent() || event.getPotion() == null) {
|
||||
+ return ItemStack.of(ItemType.AIR);
|
||||
+ return new ItemStack(Material.AIR);
|
||||
+ }
|
||||
+ return event.getPotion();
|
||||
+ }
|
||||
|
||||
@@ -6,20 +6,20 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
||||
Allows you to determine how long it takes to use a usable/consumable item
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 923f160407a2d4be71ef42a387cb803712404c43..250e39c76dbedbd1d0d118eecf1253738e369c35 100644
|
||||
index a8faa4c1881bae4d47d901388a78b991d138b518..b85eb71ff5d198d6270cbe07da0de3ed27fa72d5 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -696,5 +696,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -646,5 +646,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public String getI18NDisplayName() {
|
||||
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
|
||||
}
|
||||
+
|
||||
+ public int getMaxItemUseDuration() {
|
||||
+ if (this.type == null || this.type == ItemType.AIR) {
|
||||
+ if (type == null || type == Material.AIR || !type.isItem()) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // Requires access to NMS
|
||||
+ return this.ensureServerConversions().getMaxItemUseDuration();
|
||||
+ return ensureServerConversions().getMaxItemUseDuration();
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index ccd8f36c8450bab9f609bb220b5270394960580e..2bfeebe26f32d2e931dc483714d30430deeb9b04 100644
|
||||
index 6a9df4ec0eee205bcd37de9c4d04a6c67eb21644..b470d86c00be238a430e64d349a247e2740cfeec 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -731,5 +731,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -764,5 +764,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
*/
|
||||
@Deprecated
|
||||
void setArrowsStuck(int arrows);
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
|
||||
Adds ability to get what arrow was shot, and control if it should be consumed.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
|
||||
index d4d7ad9c3c953680342c121f39ddaef476549047..6c27a3149b17162cc38206147c759df066186af0 100644
|
||||
index d4d7ad9c3c953680342c121f39ddaef476549047..719d0d878320c1903b44076053989ba99fa0e92a 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
|
||||
@@ -22,7 +22,32 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable {
|
||||
@@ -31,7 +31,7 @@ index d4d7ad9c3c953680342c121f39ddaef476549047..6c27a3149b17162cc38206147c759df0
|
||||
+
|
||||
+ @Deprecated
|
||||
+ public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull final Entity projectile, final float force) {
|
||||
+ this(shooter, bow, ItemStack.of(org.bukkit.inventory.ItemType.AIR), projectile, force);
|
||||
+ this(shooter, bow, new ItemStack(org.bukkit.Material.AIR), projectile, force);
|
||||
+ }
|
||||
|
||||
+ @Deprecated
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
|
||||
Add Entity as a Source capability, and add more API choices, and on Location.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e011e327d 100644
|
||||
index 6693e3d8dc2519facb12db981a6b6325faa095bf..b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -7,6 +7,7 @@ import java.util.HashMap;
|
||||
@@ -17,10 +17,11 @@ index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e
|
||||
import org.bukkit.util.NumberConversions;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -568,6 +569,87 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
@@ -568,6 +569,89 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
return centerLoc;
|
||||
}
|
||||
|
||||
+ // Paper start - Expand Explosions API
|
||||
+ /**
|
||||
+ * Creates explosion at this location with given power
|
||||
+ *
|
||||
@@ -98,18 +99,19 @@ index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e
|
||||
+ * @param breakBlocks Whether or not to have blocks be destroyed
|
||||
+ * @return false if explosion was canceled, otherwise true
|
||||
+ */
|
||||
+ public boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) {
|
||||
+ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire, boolean breakBlocks) {
|
||||
+ return this.getWorld().createExplosion(source, this, power, setFire, breakBlocks);
|
||||
+ }
|
||||
+ // Paper end - Expand Explosions API
|
||||
+
|
||||
/**
|
||||
* Returns a list of entities within a bounding box centered around a Location.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 0ed7a7db90856ff50ed1354f9914c0cc321d2d09..fa192be9916ccd0a443281c104637ba09cde7755 100644
|
||||
index 3e7385d21380abcd40649045e4666cf4bed32195..266ed71b79d32f9b812be322563c247051ccd9d0 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1391,6 +1391,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1392,6 +1392,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*/
|
||||
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 250e39c76dbedbd1d0d118eecf1253738e369c35..8187b1b801c7a6fd71696bfe21de177705b0e3a2 100644
|
||||
index b85eb71ff5d198d6270cbe07da0de3ed27fa72d5..83a0631a80db156ace1d977df71d5fc653b70bb6 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit.inventory;
|
||||
@@ -16,9 +16,9 @@ index 250e39c76dbedbd1d0d118eecf1253738e369c35..8187b1b801c7a6fd71696bfe21de1777
|
||||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
@@ -704,5 +705,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -654,5 +655,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
// Requires access to NMS
|
||||
return this.ensureServerConversions().getMaxItemUseDuration();
|
||||
return ensureServerConversions().getMaxItemUseDuration();
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API
|
||||
How long an entity has raised hands to charge an attack or use an item
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 553cd804126a556f7fdf9f4bcb8640eb33e829d6..7c27f459cf84e87bb294d1a1c8081bc8eba9d852 100644
|
||||
index b3aa3dc6aa5afbc36cc86741b4cba56f463c2234..9e012c3c0671e5d0e55c243fdb4e14057038c153 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -325,7 +325,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
@@ -328,7 +328,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
|
||||
*
|
||||
* @return the item being used by the player, or null if they are not using
|
||||
* an item
|
||||
@@ -20,10 +20,10 @@ index 553cd804126a556f7fdf9f4bcb8640eb33e829d6..7c27f459cf84e87bb294d1a1c8081bc8
|
||||
public ItemStack getItemInUse();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index a48be2a0401a57b6165a849cf29f37a63b54f630..4cb92615ccd45617a282df59574f9c4fc45f119b 100644
|
||||
index b470d86c00be238a430e64d349a247e2740cfeec..97d0f82041a229e85217a7e575bf003eddc31b70 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -745,5 +745,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -778,5 +778,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
* @param delay Delay in ticks
|
||||
*/
|
||||
void setShieldBlockingDelay(int delay);
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add World.getEntity(UUID) API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index fa192be9916ccd0a443281c104637ba09cde7755..e9af7ce218e44940cd074cc0d511268284e312ef 100644
|
||||
index 266ed71b79d32f9b812be322563c247051ccd9d0..ffe6c8be86fc93d39e256a89e5016e3025afbe5c 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -911,6 +911,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -912,6 +912,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ index 9e012c3c0671e5d0e55c243fdb4e14057038c153..d44c5a3fda0b159dc541246cb2fca842
|
||||
* Returns the ItemStack currently in your hand, can be empty.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
index 5861247c1b8ee4fe2736fd5098e05a2ca9ab78ea..21ad8888c0e403bfc63518502577d651c02dda05 100644
|
||||
index c0cc82d98348e8aae3cb56bafb2fcb590b03094f..4db0a07db156c61867644f50c185e63b695e2462 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
|
||||
@@ -11,9 +11,60 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -30,9 +30,60 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class InventoryCloseEvent extends InventoryEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API
|
||||
Get the chunk the entity is currently registered to
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index b1dc148301012ba708333d620c8bdf0062140c8b..5f703c8847a94c8fd356abe2a0cd45e6af6efcec 100644
|
||||
index 4319dbac54b4cce95ad7479d5bd141a2b12ab7ae..5fc085f785719933eef7ab1b3cf173579c64739b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit.entity;
|
||||
@@ -17,7 +17,7 @@ index b1dc148301012ba708333d620c8bdf0062140c8b..5f703c8847a94c8fd356abe2a0cd45e6
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Nameable;
|
||||
@@ -742,5 +743,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -756,5 +757,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @return True if entity spawned from a mob spawner
|
||||
*/
|
||||
boolean fromMobSpawner();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] EnderDragon Events
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483f43da385
|
||||
index 0000000000000000000000000000000000000000..615bc4c973ff371d87f996e981207fc15b70275b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java
|
||||
@@ -0,0 +1,79 @@
|
||||
@@ -0,0 +1,77 @@
|
||||
+package com.destroystokyo.paper.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.AreaEffectCloud;
|
||||
@@ -20,17 +20,21 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when a DragonFireball collides with a block/entity and spawns an AreaEffectCloud
|
||||
+ */
|
||||
+public class EnderDragonFireballHitEvent extends EntityEvent implements Cancellable {
|
||||
+ @Nullable private final Collection<LivingEntity> targets;
|
||||
+ @NotNull private final AreaEffectCloud areaEffectCloud;
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @Nullable Collection<LivingEntity> targets, @NotNull AreaEffectCloud areaEffectCloud) {
|
||||
+ @NotNull private final Collection<LivingEntity> targets;
|
||||
+ @NotNull private final AreaEffectCloud areaEffectCloud;
|
||||
+ private boolean cancelled = false;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @NotNull Collection<LivingEntity> targets, @NotNull AreaEffectCloud areaEffectCloud) {
|
||||
+ super(fireball);
|
||||
+ this.targets = targets;
|
||||
+ this.areaEffectCloud = areaEffectCloud;
|
||||
@@ -48,11 +52,9 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
|
||||
+ /**
|
||||
+ * The living entities hit by fireball
|
||||
+ *
|
||||
+ * May be null if no entities were hit
|
||||
+ *
|
||||
+ * @return the targets
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ @NotNull
|
||||
+ public Collection<LivingEntity> getTargets() {
|
||||
+ return targets;
|
||||
+ }
|
||||
@@ -65,20 +67,6 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
|
||||
+ return areaEffectCloud;
|
||||
+ }
|
||||
+
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ private boolean cancelled = false;
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
@@ -88,6 +76,16 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java
|
||||
new file mode 100644
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Location Manipulation API
|
||||
Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 5a6b33c6d9a68affdbd02c13fdb0854e011e327d..943c3364f6b931fe11f9a6099504590b2da34657 100644
|
||||
index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c43b3754a 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -546,6 +546,54 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
|
||||
@@ -6,21 +6,20 @@ Subject: [PATCH] AnvilDamageEvent
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e041937c56430
|
||||
index 0000000000000000000000000000000000000000..aa5c3690fb898a7560a9551df91588a0cdc69fe2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java
|
||||
@@ -0,0 +1,171 @@
|
||||
@@ -0,0 +1,151 @@
|
||||
+package com.destroystokyo.paper.event.block;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.block.BlockType;
|
||||
+import org.bukkit.block.data.BlockData;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.inventory.InventoryEvent;
|
||||
+import org.bukkit.inventory.AnvilInventory;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
@@ -28,11 +27,13 @@ index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e0419
|
||||
+ * Called when an anvil is damaged from being used
|
||||
+ */
|
||||
+public class AnvilDamagedEvent extends InventoryEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private boolean cancel;
|
||||
+ private DamageState damageState;
|
||||
+
|
||||
+ public AnvilDamagedEvent(@NotNull InventoryView inventory, @NotNull BlockData blockData) {
|
||||
+ @ApiStatus.Internal
|
||||
+ public AnvilDamagedEvent(@NotNull InventoryView inventory, @Nullable BlockData blockData) {
|
||||
+ super(inventory);
|
||||
+ this.damageState = DamageState.getState(blockData);
|
||||
+ }
|
||||
@@ -94,27 +95,27 @@ index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e0419
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Represents the amount of damage on an anvil block
|
||||
+ */
|
||||
+ public enum DamageState {
|
||||
+ FULL(BlockType.ANVIL),
|
||||
+ CHIPPED(BlockType.CHIPPED_ANVIL),
|
||||
+ DAMAGED(BlockType.DAMAGED_ANVIL),
|
||||
+ BROKEN(BlockType.AIR);
|
||||
+ FULL(Material.ANVIL),
|
||||
+ CHIPPED(Material.CHIPPED_ANVIL),
|
||||
+ DAMAGED(Material.DAMAGED_ANVIL),
|
||||
+ BROKEN(Material.AIR);
|
||||
+
|
||||
+ private BlockType<?> blockType;
|
||||
+ private final Material material;
|
||||
+
|
||||
+ DamageState(@NotNull BlockType<?> blockType) {
|
||||
+ this.blockType = blockType;
|
||||
+ DamageState(@NotNull Material material) {
|
||||
+ this.material = material;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -122,18 +123,9 @@ index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e0419
|
||||
+ *
|
||||
+ * @return Material
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public @NotNull Material getMaterial() {
|
||||
+ return Bukkit.getUnsafe().blockTypeToMaterial(this.blockType);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the block type for this damage state.
|
||||
+ *
|
||||
+ * @return the block type
|
||||
+ */
|
||||
+ public @NotNull BlockType<?> getBlockType() {
|
||||
+ return this.blockType;
|
||||
+ @NotNull
|
||||
+ public Material getMaterial() {
|
||||
+ return material;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -145,7 +137,7 @@ index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e0419
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public static DamageState getState(@Nullable BlockData blockData) {
|
||||
+ return blockData == null ? BROKEN : getState(blockData.getBlockType());
|
||||
+ return blockData == null ? BROKEN : getState(blockData.getMaterial());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -154,30 +146,18 @@ index 0000000000000000000000000000000000000000..8174787e87433084035bb3cbc88e0419
|
||||
+ * @param material Block material
|
||||
+ * @return DamageState
|
||||
+ * @throws IllegalArgumentException If non anvil material is given
|
||||
+ * @deprecated use {@link #getState(BlockType)}
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public static @NotNull DamageState getState(@Nullable Material material) {
|
||||
+ return material == null ? BROKEN : getState(material.asBlockType());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get damaged state by block type
|
||||
+ *
|
||||
+ * @param blockType Block type
|
||||
+ * @return DamageState
|
||||
+ * @throws IllegalArgumentException If non anvil block type is given
|
||||
+ */
|
||||
+ public static @NotNull DamageState getState(@Nullable BlockType<?> blockType) {
|
||||
+ if (blockType == null) {
|
||||
+ @NotNull
|
||||
+ public static DamageState getState(@Nullable Material material) {
|
||||
+ if (material == null) {
|
||||
+ return BROKEN;
|
||||
+ }
|
||||
+ for (DamageState state : values()) {
|
||||
+ if (state.blockType == blockType) {
|
||||
+ if (state.material == material) {
|
||||
+ return state;
|
||||
+ }
|
||||
+ }
|
||||
+ throw new IllegalArgumentException("Material not an anvil");
|
||||
+ throw new IllegalArgumentException("Material is not an anvil state");
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ac1d40a697fe98cc9151b53f5d63e283d44fbbf9
|
||||
index 0000000000000000000000000000000000000000..9d7221583454dc922b20af6c233897c0b2ec47da
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java
|
||||
@@ -0,0 +1,116 @@
|
||||
@@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..ac1d40a697fe98cc9151b53f5d63e283
|
||||
+
|
||||
+ /**
|
||||
+ * When TNT prime was caused by an {@link Entity} shooting TNT
|
||||
+ * using a bow with {@link org.bukkit.enchantments.Enchantment#FLAME} enchantment
|
||||
+ * using a bow with {@link org.bukkit.enchantments.Enchantment#ARROW_FIRE} enchantment
|
||||
+ */
|
||||
+ PROJECTILE,
|
||||
+
|
||||
|
||||
@@ -44,10 +44,10 @@ index efbfed855248cff8b4bdbfc181d3e82058df4749..766d643f0fe79660942fdad25e39e488
|
||||
* Gets the world containing this chunk
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index e9af7ce218e44940cd074cc0d511268284e312ef..159307600747c49948c5242d6cf39eed08c902e7 100644
|
||||
index ffe6c8be86fc93d39e256a89e5016e3025afbe5c..315ecb5dc0f33edfef893ead1297c8165d292250 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -179,6 +179,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -180,6 +180,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Chunk getChunkAt(@NotNull Block block);
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||
index 7213bd2ccf6fa03933a9dff878baee8e92bf50b9..efcba8d9105e65f8770e95a20c9718ad93c6af79 100644
|
||||
index eb9d58f8852e732a1284beeaf542989301d21b1c..02e88db63be2d5e31da6b65157ba7b971b1f10f3 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingHistory.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
|
||||
@@ -121,7 +121,7 @@ public class TimingHistory {
|
||||
@@ -120,7 +120,7 @@ public class TimingHistory {
|
||||
data.entityCounts.get(entity.getType()).increment();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Y range: [0, 1023]
|
||||
X, Z range: [-67 108 864, 67 108 863]
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 943c3364f6b931fe11f9a6099504590b2da34657..16a604b6315daff228c827fe02b1234cca3e884d 100644
|
||||
index aa6821aa33d3c579a139bd7c0378253c43b3754a..6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -50,10 +50,10 @@ index 943c3364f6b931fe11f9a6099504590b2da34657..16a604b6315daff228c827fe02b1234c
|
||||
* @return A new location where X/Y/Z are the center of the block
|
||||
*/
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 273d111ccacc31daf7c2f5ea33728d9f04ba06e7..df543e106f22d1e151cd2e056f5741cc83a607cf 100644
|
||||
index 315ecb5dc0f33edfef893ead1297c8165d292250..ad5afa7a05636cee82b517c673d281f0f4e38644 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -96,6 +96,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -97,6 +97,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@NotNull
|
||||
public Block getBlockAt(@NotNull Location location);
|
||||
|
||||
@@ -96,10 +96,10 @@ index 273d111ccacc31daf7c2f5ea33728d9f04ba06e7..df543e106f22d1e151cd2e056f5741cc
|
||||
* Gets the highest non-empty (impassable) block at the given coordinates.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index b33c1a227669d01950ceb4162a2910ae05a85a0e..cad80c8aeb55fe9846189c62ff9cfdb5525c7236 100644
|
||||
index 9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd..78f6cc1a8a8de05aec6f551f8a5f425944f0ffa3 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -155,6 +155,82 @@ public interface Block extends Metadatable, Translatable {
|
||||
@@ -156,6 +156,82 @@ public interface Block extends Metadatable, Translatable {
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
|
||||
@@ -6,16 +6,17 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d44217531
|
||||
index 0000000000000000000000000000000000000000..d8f3f1c354331bc5e6fc1d9aa013476baf2daf05
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java
|
||||
@@ -0,0 +1,31 @@
|
||||
@@ -0,0 +1,33 @@
|
||||
+package com.destroystokyo.paper.event.entity;
|
||||
+
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
@@ -26,6 +27,7 @@ index 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d
|
||||
+public class PhantomPreSpawnEvent extends PreCreatureSpawnEvent {
|
||||
+ @NotNull private final Entity entity;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PhantomPreSpawnEvent(@NotNull Location location, @NotNull Entity entity, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
||||
+ super(location, EntityType.PHANTOM, reason);
|
||||
+ this.entity = entity;
|
||||
@@ -36,7 +38,7 @@ index 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d
|
||||
+ *
|
||||
+ * @return Entity
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ @NotNull
|
||||
+ public Entity getSpawningEntity() {
|
||||
+ return entity;
|
||||
+ }
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#removeItemAnySlot
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
index b0098a34cb07958ae815ed6b6957eb8be76e7a85..889615d40eb90ba62d44d7310fad16bdfb13da36 100644
|
||||
index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..f1a48eab1a357ae64545e1f1dc941c383cff8707 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
@@ -103,7 +103,9 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
@@ -104,7 +104,9 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
public HashMap<Integer, ItemStack> addItem(@NotNull ItemStack... items) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ index b0098a34cb07958ae815ed6b6957eb8be76e7a85..889615d40eb90ba62d44d7310fad16bd
|
||||
* <p>
|
||||
* It will try to remove 'as much as possible' from the types and amounts
|
||||
* you give as arguments.
|
||||
@@ -120,10 +122,39 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
@@ -121,10 +123,39 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
* @param items The ItemStacks to remove
|
||||
* @return A HashMap containing items that couldn't be removed.
|
||||
* @throws IllegalArgumentException if items is null
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] isChunkGenerated API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index 16a604b6315daff228c827fe02b1234cca3e884d..20978b269a7757a561d6b872cc77898b44bbd272 100644
|
||||
index 6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe..8508aa2c6fb7c9f41f3d185f5228c86dd3b8b627 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -3,6 +3,7 @@ package org.bukkit;
|
||||
@@ -34,10 +34,10 @@ index 16a604b6315daff228c827fe02b1234cca3e884d..20978b269a7757a561d6b872cc77898b
|
||||
/**
|
||||
* Sets the position of this Location and returns itself
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index e83de41cbaf0e5a68ce0d5ad2b5ec10877ec4055..c63a660f2deade66fffad9036ce7c7c693bf0207 100644
|
||||
index ad5afa7a05636cee82b517c673d281f0f4e38644..880ff5ee1237096ac2da115b665dc663c677e57b 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -245,6 +245,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -246,6 +246,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
}
|
||||
// Paper end - chunk long key API
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Add source block constructor and getChangedBlockData() to
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
||||
index 55cdfd35a91f82b2c5bf51fff3671e45b49b7d0c..0ae137a46fc505d99c827b099d36c35d9fa891b0 100644
|
||||
index e3a5f5824ed882058f5bac5003f66ce79733a868..1d496e5a3d1541bf0a257a4358b3943fd6415204 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
|
||||
@@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
|
||||
@@ -34,7 +34,7 @@ index 55cdfd35a91f82b2c5bf51fff3671e45b49b7d0c..0ae137a46fc505d99c827b099d36c35d
|
||||
* @return Changed block's type
|
||||
*/
|
||||
@@ -64,6 +72,19 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
|
||||
return changed.getBlockType();
|
||||
return changed.getMaterial();
|
||||
}
|
||||
|
||||
+ // Paper start - Getter for the BlockData
|
||||
|
||||
@@ -8,10 +8,10 @@ Adds API's to load or generate chunks asynchronously.
|
||||
Also adds utility methods to Entity to teleport asynchronously.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index c63a660f2deade66fffad9036ce7c7c693bf0207..67d14468703e0445afccdbd8de8028fb21b90d2d 100644
|
||||
index 880ff5ee1237096ac2da115b665dc663c677e57b..fc6b99e4f37179b15254bf0b398b1a800de1b73f 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -954,6 +954,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -955,6 +955,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
}
|
||||
return nearby;
|
||||
}
|
||||
@@ -495,7 +495,7 @@ index c63a660f2deade66fffad9036ce7c7c693bf0207..67d14468703e0445afccdbd8de8028fb
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 5f703c8847a94c8fd356abe2a0cd45e6af6efcec..9eca441d6702752938813a1c97724edf13134171 100644
|
||||
index 5fc085f785719933eef7ab1b3cf173579c64739b..711d95bfafac0d415895023bdaac4059395667ab 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -165,6 +165,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
|
||||
@@ -78,12 +78,12 @@ index 0000000000000000000000000000000000000000..c896d172519a8552a132031cb956378d
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 4cb92615ccd45617a282df59574f9c4fc45f119b..a4e5225e433e83d56ff96055106593a352639034 100644
|
||||
index 97d0f82041a229e85217a7e575bf003eddc31b70..8a18f269ee1767d57367160cb0e3513a4e2969fb 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -83,6 +83,98 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@NotNull
|
||||
public Block getTargetBlock(@Nullable Set<BlockType<?>> transparent, int maxDistance);
|
||||
public Block getTargetBlock(@Nullable Set<Material> transparent, int maxDistance);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index de5ac3b6f9cf001e3c3500f23930a6f9876210de..9649e65d2b0af4f72d648eb33c0de124ba4b5e34 100644
|
||||
index a851ec4d350ce442eb01385d21ca75e695cf09d2..9954fc11b2c2fe56c194d7d3ce878a343a9b2429 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2691,6 +2691,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -2854,6 +2854,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param profile The new profile to use
|
||||
*/
|
||||
void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
|
||||
|
||||
@@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..909617079db61b675cc7b60b44ef96b3
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 48f3a48268f714eeba3cfcd8e665265fc144f39e..5a7e8b3d073c2ea44909477c38bc2ab454c6a502 100644
|
||||
index a6f9336f27cb4a7aed0c01cde417d2287e393929..67dc67343fc149c21ae234a338f08e2f1fa13867 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -56,6 +56,7 @@ import org.bukkit.util.CachedServerIcon;
|
||||
@@ -87,15 +87,15 @@ index 48f3a48268f714eeba3cfcd8e665265fc144f39e..5a7e8b3d073c2ea44909477c38bc2ab4
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
index b50f614806f4634960d383e8a33f094c2f46935f..e40f017f87d6b6b4770501b106c76dc69ec69abb 100644
|
||||
index b437cf212a63aa96a9492db8d01d5d37061aee23..fd5d9881abfd930bb883120f018f76dc78b62b14 100644
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -240,7 +240,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
private void setVersionMessage(final @NotNull net.kyori.adventure.text.Component msg) {
|
||||
@@ -256,7 +256,7 @@ public class VersionCommand extends BukkitCommand {
|
||||
private void setVersionMessage(final @NotNull Component msg) {
|
||||
lastCheck = System.currentTimeMillis();
|
||||
final net.kyori.adventure.text.Component message = net.kyori.adventure.text.TextComponent.ofChildren(
|
||||
- net.kyori.adventure.text.Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", net.kyori.adventure.text.format.NamedTextColor.WHITE),
|
||||
+ net.kyori.adventure.text.Component.text(Bukkit.getVersionMessage(), net.kyori.adventure.text.format.NamedTextColor.WHITE),
|
||||
net.kyori.adventure.text.Component.newline(),
|
||||
final Component message = Component.textOfChildren(
|
||||
- Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", NamedTextColor.WHITE),
|
||||
+ Component.text(Bukkit.getVersionMessage(), NamedTextColor.WHITE),
|
||||
Component.newline(),
|
||||
msg
|
||||
);
|
||||
@@ -199,10 +199,10 @@ index 0000000000000000000000000000000000000000..28f3fda950999a9c964a3608042ca605
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fee5edc7aa 100644
|
||||
index 4034fcb9abc39b12f0de47c4b679f2ef82353c89..6fa219aef009f8dfb8a2b1e5ee0603b18cf3d0f5 100644
|
||||
--- a/src/main/java/org/bukkit/NamespacedKey.java
|
||||
+++ b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* underscores, hyphens, and forward slashes.
|
||||
*
|
||||
*/
|
||||
@@ -211,7 +211,7 @@ index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fe
|
||||
|
||||
/**
|
||||
* The namespace representing all inbuilt keys.
|
||||
@@ -118,11 +118,13 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key { // Pap
|
||||
@@ -119,11 +119,13 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key { // Pap
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -226,10 +226,10 @@ index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fe
|
||||
return key;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
index f78714c2a6d9da162c9802552984cbfad76ff728..55e9dc5d1d87fbc9d0dabbb7bd59584fe2c5f379 100644
|
||||
index 9d40e6a5ce7adc377934cfc5ce663b5d9cb2e4dc..46ac120ed51274a2084719387e35e517981bbf4b 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
@@ -444,4 +444,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -445,4 +445,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@SuppressWarnings("javadoc")
|
||||
@NotNull
|
||||
ItemMeta clone();
|
||||
|
||||
@@ -37,10 +37,10 @@ index ac3b24c5c99eeb1435d785efade728dd40947da5..dbdf3dbe9517b09a7965cf9d65cae1ed
|
||||
@Override
|
||||
public FurnaceInventory getInventory();
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
index 1440c6115520d692faf75455df35b92aa8734491..1e55f50f04de78ae0b8832a8021ffc7327676e8e 100644
|
||||
index 0808e7aeffb69160913344de5b5e21d5e857f1d6..d386ab5dd46cc6706ace61fe6b646713ffd50cb7 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
@@ -15,10 +15,17 @@ public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
@@ -18,10 +18,17 @@ public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
private final CookingRecipe<?> recipe;
|
||||
private int totalCookTime;
|
||||
|
||||
|
||||
@@ -5,19 +5,26 @@ Subject: [PATCH] Material API additions
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 9941023b98f3822c7b12697ae7326708abf19ead..09669d5757f4fa58835e339deb8d38afa5662997 100644
|
||||
index 7ed67f356cf0ef8b3252256dcd4185f18573c989..d56d899ca7737b537ea55c13a384888a873f5da3 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4439,6 +4439,23 @@ public enum Material implements Keyed, Translatable {
|
||||
@@ -118,6 +118,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* An enum of all material IDs accepted by the official server and client
|
||||
*/
|
||||
+@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper
|
||||
public enum Material implements Keyed, Translatable {
|
||||
//<editor-fold desc="Materials" defaultstate="collapsed">
|
||||
AIR(9648, 0),
|
||||
@@ -4438,6 +4439,22 @@ public enum Material implements Keyed, Translatable {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+
|
||||
+ /**
|
||||
+ * @return If the type is either AIR, CAVE_AIR or VOID_AIR
|
||||
+ * @deprecated Check if the {@link ItemType} is {@link ItemType#AIR} or {@link BlockType#isAir()}
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public boolean isEmpty() {
|
||||
+ switch (this) {
|
||||
+ case AIR:
|
||||
|
||||
@@ -7,14 +7,15 @@ This adds a bunch of useful and missing Tags to be able to identify items that
|
||||
are related to each other by a trait.
|
||||
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Co-authored by: Lena Kolb <lenakolb2204@gmail.com>
|
||||
Co-authored-by: Lena Kolb <lenakolb2204@gmail.com>
|
||||
Co-authored-by: Layla Silbernberg <livsilbernberg@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8f5530188e340336dfffb3054c1743b068bc9342
|
||||
index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab01565b3d92a
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
||||
@@ -0,0 +1,119 @@
|
||||
@@ -0,0 +1,97 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
||||
+ */
|
||||
@@ -23,13 +24,10 @@ index 0000000000000000000000000000000000000000..8f5530188e340336dfffb3054c1743b0
|
||||
+
|
||||
+import com.google.common.collect.Lists;
|
||||
+import io.papermc.paper.tag.BaseTag;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Material;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.Tag;
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.block.BlockType;
|
||||
+import org.bukkit.block.data.BlockData;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+
|
||||
@@ -38,11 +36,9 @@ index 0000000000000000000000000000000000000000..8f5530188e340336dfffb3054c1743b0
|
||||
+import java.util.function.Predicate;
|
||||
+import java.util.stream.Collectors;
|
||||
+import java.util.stream.Stream;
|
||||
+import org.bukkit.inventory.ItemType;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+@Deprecated
|
||||
+public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> {
|
||||
+
|
||||
+ /**
|
||||
@@ -97,17 +93,8 @@ index 0000000000000000000000000000000000000000..8f5530188e340336dfffb3054c1743b0
|
||||
+ return value.name();
|
||||
+ }
|
||||
+
|
||||
+ public MaterialSetTag addTags(@NotNull Tag<BlockType>...tags) {
|
||||
+ for (Tag<BlockType> tag : tags) {
|
||||
+ for (final BlockType<?> value : tag.getValues()) {
|
||||
+ this.add(Bukkit.getUnsafe().blockTypeToMaterial(value));
|
||||
+ }
|
||||
+ }
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isTagged(@NotNull BlockData block) {
|
||||
+ return isTagged(block.getBlockType());
|
||||
+ return isTagged(block.getMaterial());
|
||||
+ }
|
||||
+
|
||||
+ public boolean isTagged(@NotNull BlockState block) {
|
||||
@@ -122,24 +109,16 @@ index 0000000000000000000000000000000000000000..8f5530188e340336dfffb3054c1743b0
|
||||
+ return isTagged(item.getType());
|
||||
+ }
|
||||
+
|
||||
+ public boolean isTagged(@NotNull ItemType itemType) {
|
||||
+ return this.isTagged(Bukkit.getUnsafe().toMaterial(itemType));
|
||||
+ }
|
||||
+
|
||||
+ public boolean isTagged(@NotNull BlockType<?> itemType) {
|
||||
+ return this.isTagged(Bukkit.getUnsafe().blockTypeToMaterial(itemType));
|
||||
+ }
|
||||
+
|
||||
+ public boolean isTagged(@NotNull Material material) {
|
||||
+ return this.tagged.contains(material);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..296fbcb6768d7b21720431e32e39b2702da08324
|
||||
index 0000000000000000000000000000000000000000..f59151cec84fc0e300a8d759c6d74a804cbd047f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
@@ -0,0 +1,705 @@
|
||||
@@ -0,0 +1,708 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
||||
+ *
|
||||
@@ -177,7 +156,6 @@ index 0000000000000000000000000000000000000000..296fbcb6768d7b21720431e32e39b270
|
||||
+ * {@link UnsupportedOperationException}.
|
||||
+ */
|
||||
+@SuppressWarnings({"NonFinalUtilityClass", "unused", "WeakerAccess"})
|
||||
+@Deprecated
|
||||
+public class MaterialTags {
|
||||
+
|
||||
+ private static NamespacedKey keyFor(String key) {
|
||||
@@ -675,7 +653,7 @@ index 0000000000000000000000000000000000000000..296fbcb6768d7b21720431e32e39b270
|
||||
+ */
|
||||
+ @SuppressWarnings("unchecked")
|
||||
+ public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
|
||||
+ .addTags(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock();
|
||||
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock();
|
||||
+ //.ensureSize("COLORABLE", 81).lock(); unit test don't have the vanilla item tags, so counts don't line up for real
|
||||
+
|
||||
+ /**
|
||||
@@ -705,8 +683,12 @@ index 0000000000000000000000000000000000000000..296fbcb6768d7b21720431e32e39b270
|
||||
+ */
|
||||
+ public static final MaterialSetTag ENCHANTABLE = new MaterialSetTag(keyFor("enchantable"))
|
||||
+ .add(PICKAXES, SWORDS, SHOVELS, AXES, HOES, HELMETS, CHEST_EQUIPPABLE, LEGGINGS, BOOTS, BOWS)
|
||||
+ .add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS, Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK)
|
||||
+ .ensureSize("ENCHANTABLE", 65).lock();
|
||||
+ .add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS,
|
||||
+ Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK,
|
||||
+ Material.BRUSH, Material.CARVED_PUMPKIN, Material.COMPASS, Material.SKELETON_SKULL,
|
||||
+ Material.WITHER_SKELETON_SKULL, Material.PLAYER_HEAD, Material.ZOMBIE_HEAD,
|
||||
+ Material.CREEPER_HEAD, Material.DRAGON_HEAD, Material.PIGLIN_HEAD)
|
||||
+ .ensureSize("ENCHANTABLE", 75).lock();
|
||||
+
|
||||
+ /**
|
||||
+ * Covers the variants of raw ores.
|
||||
@@ -1034,10 +1016,10 @@ index 0000000000000000000000000000000000000000..794787912325ae32b3cfc8217bc3fc21
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/tag/EntitySetTag.java b/src/main/java/io/papermc/paper/tag/EntitySetTag.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d120fb50bf1f36c3f991d7170b5423af1db4021c
|
||||
index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1e93db871
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/tag/EntitySetTag.java
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -0,0 +1,42 @@
|
||||
+package io.papermc.paper.tag;
|
||||
+
|
||||
+import org.bukkit.NamespacedKey;
|
||||
@@ -1050,7 +1032,6 @@ index 0000000000000000000000000000000000000000..d120fb50bf1f36c3f991d7170b5423af
|
||||
+import java.util.stream.Collectors;
|
||||
+import java.util.stream.Stream;
|
||||
+
|
||||
+@Deprecated
|
||||
+public class EntitySetTag extends BaseTag<EntityType, EntitySetTag> {
|
||||
+
|
||||
+ public EntitySetTag(@NotNull NamespacedKey key, @NotNull Predicate<EntityType> filter) {
|
||||
@@ -1083,10 +1064,10 @@ index 0000000000000000000000000000000000000000..d120fb50bf1f36c3f991d7170b5423af
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/tag/EntityTags.java b/src/main/java/io/papermc/paper/tag/EntityTags.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..eafae2a211c58719ef008a5d4018541249dcf4b7
|
||||
index 0000000000000000000000000000000000000000..5376e51adf5af15572b0d760b17f2de6d3f24a9b
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/tag/EntityTags.java
|
||||
@@ -0,0 +1,55 @@
|
||||
@@ -0,0 +1,54 @@
|
||||
+package io.papermc.paper.tag;
|
||||
+
|
||||
+import org.bukkit.NamespacedKey;
|
||||
@@ -1097,7 +1078,6 @@ index 0000000000000000000000000000000000000000..eafae2a211c58719ef008a5d40185412
|
||||
+ * All tags in this class are unmodifiable, attempting to modify them will throw an
|
||||
+ * {@link UnsupportedOperationException}.
|
||||
+ */
|
||||
+@Deprecated
|
||||
+public class EntityTags {
|
||||
+
|
||||
+ private static NamespacedKey keyFor(String key) {
|
||||
@@ -1107,7 +1087,7 @@ index 0000000000000000000000000000000000000000..eafae2a211c58719ef008a5d40185412
|
||||
+
|
||||
+ /**
|
||||
+ * Covers undead mobs
|
||||
+ * @see <a href="https://minecraft.gamepedia.com/Mob#Undead_mobs">https://minecraft.gamepedia.com/Mob#Undead_mobs</a>
|
||||
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Undead_mobs">https://minecraft.wiki/wiki/Mob#Undead_mobs</a>
|
||||
+ */
|
||||
+ public static final EntitySetTag UNDEADS = new EntitySetTag(keyFor("undeads"))
|
||||
+ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN)
|
||||
@@ -1136,17 +1116,17 @@ index 0000000000000000000000000000000000000000..eafae2a211c58719ef008a5d40185412
|
||||
+
|
||||
+ /**
|
||||
+ * Covers all water based mobs
|
||||
+ * @see <a href="https://minecraft.gamepedia.com/Mob#Water-based_mobs">https://minecraft.gamepedia.com/Mob#Water-based_mobs</a>
|
||||
+ * @see <a href="https://minecraft.wiki/wiki/Mob#Aquatic_mobs">https://minecraft.wiki/wiki/Mob#Aquatic_mobs</a>
|
||||
+ */
|
||||
+ public static final EntitySetTag WATER_BASED = new EntitySetTag(keyFor("water_based"))
|
||||
+ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH)
|
||||
+ .ensureSize("WATER_BASED", 11).lock();
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
|
||||
index b7871206d4d8c3cd869d9f2f15b7a1184722c2f9..bbf7dd8ca90ba1c3626e87ca221201568163101f 100644
|
||||
index 02f75db7ac55f792e84a08138e89657a3e226ff5..69462a0679c255acee2adb84f590523d3fc3c9aa 100644
|
||||
--- a/src/main/java/org/bukkit/Tag.java
|
||||
+++ b/src/main/java/org/bukkit/Tag.java
|
||||
@@ -13,6 +13,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -11,6 +11,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Note that whilst all tags defined within this interface must be present in
|
||||
* implementations, their existence is not guaranteed across future versions.
|
||||
*
|
||||
@@ -1159,10 +1139,10 @@ index b7871206d4d8c3cd869d9f2f15b7a1184722c2f9..bbf7dd8ca90ba1c3626e87ca22120156
|
||||
public interface Tag<T extends Keyed> extends Keyed {
|
||||
diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374b9d19823
|
||||
index 0000000000000000000000000000000000000000..82ee9a486d1c3deec6e529b1cb12ecc2c6a5862e
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
|
||||
@@ -0,0 +1,62 @@
|
||||
@@ -0,0 +1,58 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
||||
+ */
|
||||
@@ -1171,23 +1151,20 @@ index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374
|
||||
+
|
||||
+import io.papermc.paper.tag.BaseTag;
|
||||
+import io.papermc.paper.tag.EntityTags;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.junit.Ignore;
|
||||
+import org.junit.Test;
|
||||
+
|
||||
+import java.lang.reflect.Field;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+import java.util.logging.Level;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+import static org.junit.Assert.assertTrue;
|
||||
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
+
|
||||
+public class MaterialTagsTest extends AbstractTestingBase {
|
||||
+
|
||||
+ @Test
|
||||
+ @Ignore
|
||||
+ public void testInitialize() {
|
||||
+ try {
|
||||
+ MaterialTags.SHULKER_BOXES.getValues();
|
||||
@@ -1199,7 +1176,6 @@ index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ @Ignore
|
||||
+ public void testLocked() {
|
||||
+ testLocked(MaterialTags.class);
|
||||
+ testLocked(EntityTags.class);
|
||||
@@ -1207,7 +1183,7 @@ index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374
|
||||
+
|
||||
+ private static void testLocked(Class<?> clazz) {
|
||||
+ for (BaseTag<?, ?> tag : collectTags(clazz)) {
|
||||
+ assertTrue("Tag " + tag.key() + " is not locked", tag.isLocked());
|
||||
+ assertTrue(tag.isLocked(), "Tag " + tag.key() + " is not locked");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -1227,23 +1203,21 @@ index 0000000000000000000000000000000000000000..556e347fd10fd8f8358d8aaee1bcd374
|
||||
+}
|
||||
diff --git a/src/test/java/io/papermc/paper/EntityTagsTest.java b/src/test/java/io/papermc/paper/EntityTagsTest.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d92e2bf0d8c2d3c861dbf14d31b9bf13c53beec2
|
||||
index 0000000000000000000000000000000000000000..91d70cc703192b5a3a48211ee0dadd2e4260ec00
|
||||
--- /dev/null
|
||||
+++ b/src/test/java/io/papermc/paper/EntityTagsTest.java
|
||||
@@ -0,0 +1,23 @@
|
||||
@@ -0,0 +1,21 @@
|
||||
+package io.papermc.paper;
|
||||
+
|
||||
+import io.papermc.paper.tag.EntityTags;
|
||||
+import java.util.logging.Level;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.support.AbstractTestingBase;
|
||||
+import org.junit.Ignore;
|
||||
+import org.junit.Test;
|
||||
+import org.junit.jupiter.api.Test;
|
||||
+
|
||||
+public class EntityTagsTest extends AbstractTestingBase {
|
||||
+
|
||||
+ @Test
|
||||
+ @Ignore
|
||||
+ public void testInitialize() {
|
||||
+ try {
|
||||
+ EntityTags.HORSES.getValues();
|
||||
|
||||
@@ -12,7 +12,7 @@ Dropped as it does not apply due to the earlier PreCreatureSpawnEvent patch not
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..765440cedcddc4a7b7312a930fef857efd7ad661
|
||||
index 0000000000000000000000000000000000000000..48cff063594840a07aeaf35513780e28ea019a76
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java
|
||||
@@ -0,0 +1,29 @@
|
||||
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..765440cedcddc4a7b7312a930fef857e
|
||||
+public class PreSpawnerSpawnEvent extends PreCreatureSpawnEvent {
|
||||
+ @NotNull private final Location spawnerLocation;
|
||||
+
|
||||
+ public PreSpawnerSpawnEvent(@NotNull Location location, @NotNull EntityType<?> type, @NotNull Location spawnerLocation) {
|
||||
+ public PreSpawnerSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull Location spawnerLocation) {
|
||||
+ super(location, type, CreatureSpawnEvent.SpawnReason.SPAWNER);
|
||||
+ this.spawnerLocation = Preconditions.checkNotNull(spawnerLocation, "Spawner location may not be null");
|
||||
+ }
|
||||
|
||||
@@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..af8765b213390cf75fe02a6eb68aecf7
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 8cccec99cdb028e86b71b3984f4f94201fd9a390..94fad96f8fd57314c571b6396f44cd9d91254cfc 100644
|
||||
index 8a18f269ee1767d57367160cb0e3513a4e2969fb..79fdb183887cb8153254f6ac84a981a7ffcb561c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -173,6 +173,77 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 67d14468703e0445afccdbd8de8028fb21b90d2d..c6019065869130608ac97af951c7036031eec242 100644
|
||||
index fc6b99e4f37179b15254bf0b398b1a800de1b73f..df511007ca4b3b5df04abfa6b7f1c4de636407fc 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -1781,6 +1781,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -1782,6 +1782,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*/
|
||||
public void setFullTime(long time);
|
||||
|
||||
|
||||
Loaded 100 of 1389 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user